pub struct WriterModel { /* private fields */ }Expand description
Writer model provider implementation.
Implementations§
Source§impl WriterModel
impl WriterModel
Sourcepub fn new(config: WriterConfig) -> Self
pub fn new(config: WriterConfig) -> Self
Create a new Writer model.
Sourcepub fn writer_config(&self) -> &WriterConfig
pub fn writer_config(&self) -> &WriterConfig
Get the Writer configuration.
Sourcepub fn update_writer_config(&mut self, config: WriterConfig)
pub fn update_writer_config(&mut self, config: WriterConfig)
Update the Writer configuration.
Sourcepub fn is_palmyra_x5(&self) -> bool
pub fn is_palmyra_x5(&self) -> bool
Check if this is a Palmyra X5 model (supports vision).
Trait Implementations§
Source§impl Model for WriterModel
impl Model for WriterModel
Source§fn config(&self) -> &ModelConfig
fn config(&self) -> &ModelConfig
Returns the model configuration.
Source§fn update_config(&mut self, config: ModelConfig)
fn update_config(&mut self, config: ModelConfig)
Updates the model configuration.
Source§fn stream<'a>(
&'a self,
_messages: &'a [Message],
_tool_specs: Option<&'a [ToolSpec]>,
_system_prompt: Option<&'a str>,
_tool_choice: Option<ToolChoice>,
_system_prompt_content: Option<&'a [SystemContentBlock]>,
) -> StreamEventStream<'a>
fn stream<'a>( &'a self, _messages: &'a [Message], _tool_specs: Option<&'a [ToolSpec]>, _system_prompt: Option<&'a str>, _tool_choice: Option<ToolChoice>, _system_prompt_content: Option<&'a [SystemContentBlock]>, ) -> StreamEventStream<'a>
Streams a response from the model.
Auto Trait Implementations§
impl Freeze for WriterModel
impl RefUnwindSafe for WriterModel
impl Send for WriterModel
impl Sync for WriterModel
impl Unpin for WriterModel
impl UnwindSafe for WriterModel
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
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreCreates a shared type from an unshared type.
Source§impl<T> ModelExt for Twhere
T: Model,
impl<T> ModelExt for Twhere
T: Model,
Source§fn structured_output<'life0, 'life1, 'life2, 'async_trait, T>(
&'life0 self,
messages: &'life1 [Message],
system_prompt: Option<&'life2 str>,
) -> Pin<Box<dyn Future<Output = Result<T, StrandsError>> + Send + 'async_trait>>where
T: DeserializeOwned + JsonSchema + Send + 'async_trait,
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn structured_output<'life0, 'life1, 'life2, 'async_trait, T>(
&'life0 self,
messages: &'life1 [Message],
system_prompt: Option<&'life2 str>,
) -> Pin<Box<dyn Future<Output = Result<T, StrandsError>> + Send + 'async_trait>>where
T: DeserializeOwned + JsonSchema + Send + 'async_trait,
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Generates a structured output from the model.