pub struct CotPromptBuilder;Expand description
Builds prompts that elicit chain-of-thought reasoning.
Implementations§
Source§impl CotPromptBuilder
impl CotPromptBuilder
Sourcepub fn build_cot_prompt(&self, question: &str, strategy: &CotStrategy) -> String
pub fn build_cot_prompt(&self, question: &str, strategy: &CotStrategy) -> String
Build a CoT prompt for question using the given strategy.
Sourcepub fn few_shot_examples(&self) -> Vec<(String, String)>
pub fn few_shot_examples(&self) -> Vec<(String, String)>
Return a set of (question, CoT answer) example pairs for common reasoning types.
Sourcepub fn tree_of_thought_prompt(&self, question: &str, branching: u8) -> String
pub fn tree_of_thought_prompt(&self, question: &str, branching: u8) -> String
Build a tree-of-thought prompt that instructs the model to explore
branching parallel solution paths.
Trait Implementations§
Source§impl Debug for CotPromptBuilder
impl Debug for CotPromptBuilder
Source§impl Default for CotPromptBuilder
impl Default for CotPromptBuilder
Source§fn default() -> CotPromptBuilder
fn default() -> CotPromptBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for CotPromptBuilder
impl RefUnwindSafe for CotPromptBuilder
impl Send for CotPromptBuilder
impl Sync for CotPromptBuilder
impl Unpin for CotPromptBuilder
impl UnsafeUnpin for CotPromptBuilder
impl UnwindSafe for CotPromptBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request