pub struct SageMakerModel { /* private fields */ }Expand description
Amazon SageMaker model provider implementation.
Implementations§
Source§impl SageMakerModel
impl SageMakerModel
Sourcepub fn new(
endpoint_config: SageMakerEndpointConfig,
payload_config: SageMakerPayloadConfig,
) -> Self
pub fn new( endpoint_config: SageMakerEndpointConfig, payload_config: SageMakerPayloadConfig, ) -> Self
Create a new SageMaker model.
Sourcepub fn endpoint_config(&self) -> &SageMakerEndpointConfig
pub fn endpoint_config(&self) -> &SageMakerEndpointConfig
Get the endpoint configuration.
Sourcepub fn payload_config(&self) -> &SageMakerPayloadConfig
pub fn payload_config(&self) -> &SageMakerPayloadConfig
Get the payload configuration.
Sourcepub fn update_endpoint_config(&mut self, config: SageMakerEndpointConfig)
pub fn update_endpoint_config(&mut self, config: SageMakerEndpointConfig)
Update the endpoint configuration.
Sourcepub fn update_payload_config(&mut self, config: SageMakerPayloadConfig)
pub fn update_payload_config(&mut self, config: SageMakerPayloadConfig)
Update the payload configuration.
Trait Implementations§
Source§impl Model for SageMakerModel
impl Model for SageMakerModel
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 SageMakerModel
impl RefUnwindSafe for SageMakerModel
impl Send for SageMakerModel
impl Sync for SageMakerModel
impl Unpin for SageMakerModel
impl UnwindSafe for SageMakerModel
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.