pub struct TemplateBuilder { /* private fields */ }Expand description
Fluent builder for PromptTemplate.
Implementations§
Source§impl TemplateBuilder
impl TemplateBuilder
pub fn version(self, v: impl Into<String>) -> Self
pub fn system(self, s: impl Into<String>) -> Self
pub fn body(self, b: impl Into<String>) -> Self
Sourcepub fn var_default(
self,
name: impl Into<String>,
default: impl Into<String>,
) -> Self
pub fn var_default( self, name: impl Into<String>, default: impl Into<String>, ) -> Self
Declare a variable with a fallback default value.
pub fn tag(self, t: impl Into<String>) -> Self
pub fn description(self, d: impl Into<String>) -> Self
Sourcepub fn build(self) -> PromptTemplate
pub fn build(self) -> PromptTemplate
Finalise and return the PromptTemplate.
Auto-detects variables from {{…}} placeholders in the body if they
haven’t been explicitly declared.
Trait Implementations§
Source§impl Default for TemplateBuilder
impl Default for TemplateBuilder
Source§fn default() -> TemplateBuilder
fn default() -> TemplateBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for TemplateBuilder
impl RefUnwindSafe for TemplateBuilder
impl Send for TemplateBuilder
impl Sync for TemplateBuilder
impl Unpin for TemplateBuilder
impl UnsafeUnpin for TemplateBuilder
impl UnwindSafe for TemplateBuilder
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