pub struct ModelRunner { /* private fields */ }Implementations§
Source§impl ModelRunner
impl ModelRunner
pub fn new(bedrock_client: Arc<BedrockClient>) -> Self
Sourcepub async fn invoke_model(
&self,
model_id: &str,
prompt: &str,
max_tokens: u32,
) -> Result<(String, Option<TokenUsage>)>
pub async fn invoke_model( &self, model_id: &str, prompt: &str, max_tokens: u32, ) -> Result<(String, Option<TokenUsage>)>
Invoke a Bedrock model with the given prompt and model configuration
Sourcepub async fn invoke_model_with_file_content(
&self,
model_id: &str,
file_content: &str,
analysis_prompt: &str,
max_tokens: u32,
) -> Result<(String, Option<TokenUsage>)>
pub async fn invoke_model_with_file_content( &self, model_id: &str, file_content: &str, analysis_prompt: &str, max_tokens: u32, ) -> Result<(String, Option<TokenUsage>)>
Invoke a model with file content and analysis prompt
pub fn get_model_pricing() -> HashMap<&'static str, ModelPricing>
Sourcepub fn calculate_cost_estimate(
token_usage: Option<TokenUsage>,
model_id: &str,
) -> Option<f64>
pub fn calculate_cost_estimate( token_usage: Option<TokenUsage>, model_id: &str, ) -> Option<f64>
Calculates cost estimate based on token usage and model pricing
Auto Trait Implementations§
impl Freeze for ModelRunner
impl !RefUnwindSafe for ModelRunner
impl Send for ModelRunner
impl Sync for ModelRunner
impl Unpin for ModelRunner
impl !UnwindSafe for ModelRunner
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> 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.