pub struct GoogleGenerativeAiModel { /* private fields */ }Implementations§
Source§impl GoogleGenerativeAiModel
impl GoogleGenerativeAiModel
pub fn new(model_id: impl Into<String>, api_key: impl Into<String>) -> Self
pub fn with_client( model_id: impl Into<String>, client: ClientWithMiddleware, config: GoogleConfig, ) -> Self
Trait Implementations§
Source§impl Clone for GoogleGenerativeAiModel
impl Clone for GoogleGenerativeAiModel
Source§fn clone(&self) -> GoogleGenerativeAiModel
fn clone(&self) -> GoogleGenerativeAiModel
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl LanguageModel for GoogleGenerativeAiModel
impl LanguageModel for GoogleGenerativeAiModel
Source§fn provider_name(&self) -> &str
fn provider_name(&self) -> &str
Provider name, e.g. “openai”, “anthropic”, etc.
Source§fn model_id(&self) -> &str
fn model_id(&self) -> &str
The upstream model ID, e.g. “gpt-4o”, “claude-3-5-sonnet-20241022”, etc.
Source§fn supported_urls(&self) -> impl Future<Output = HashMap<String, Regex>>
fn supported_urls(&self) -> impl Future<Output = HashMap<String, Regex>>
Media type -> Regex for supported URLs of that media type Read more
Source§async fn generate(
&self,
options: LanguageModelCallOptions,
) -> Result<LanguageModelGenerateResult>
async fn generate( &self, options: LanguageModelCallOptions, ) -> Result<LanguageModelGenerateResult>
Generates content based on the given options.
Source§async fn stream(
&self,
options: LanguageModelCallOptions,
) -> Result<LanguageModelStreamResult>
async fn stream( &self, options: LanguageModelCallOptions, ) -> Result<LanguageModelStreamResult>
Generates content based on the given options, but returns a stream of partial results.
Auto Trait Implementations§
impl Freeze for GoogleGenerativeAiModel
impl !RefUnwindSafe for GoogleGenerativeAiModel
impl Send for GoogleGenerativeAiModel
impl Sync for GoogleGenerativeAiModel
impl Unpin for GoogleGenerativeAiModel
impl UnsafeUnpin for GoogleGenerativeAiModel
impl !UnwindSafe for GoogleGenerativeAiModel
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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 more