pub struct GoogleLanguageModel { /* private fields */ }Expand description
Language model backed by generateContent.
Implementations§
Source§impl GoogleLanguageModel
impl GoogleLanguageModel
Sourcepub fn new(config: SharedConfig, model_id: impl Into<ModelId>) -> Self
pub fn new(config: SharedConfig, model_id: impl Into<ModelId>) -> Self
Creates the model.
Sourcepub fn config(&self) -> &SharedConfig
pub fn config(&self) -> &SharedConfig
Shared configuration.
Sourcepub fn prepare_request(
&self,
options: &CallOptions,
) -> Result<PreparedRequest, ProviderError>
pub fn prepare_request( &self, options: &CallOptions, ) -> Result<PreparedRequest, ProviderError>
Sourcepub fn convert_response(
&self,
prepared: &PreparedRequest,
body: &GenerateContentResponse,
raw: Option<&JsonValue>,
) -> Result<GenerateResult, ProviderError>
pub fn convert_response( &self, prepared: &PreparedRequest, body: &GenerateContentResponse, raw: Option<&JsonValue>, ) -> Result<GenerateResult, ProviderError>
Converts a parsed generateContent response (raw is the original
JSON) into a result. Used for direct calls and batch results.
§Errors
Trait Implementations§
Source§impl Clone for GoogleLanguageModel
impl Clone for GoogleLanguageModel
Source§fn clone(&self) -> GoogleLanguageModel
fn clone(&self) -> GoogleLanguageModel
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for GoogleLanguageModel
impl Debug for GoogleLanguageModel
Source§impl LanguageModel for GoogleLanguageModel
impl LanguageModel for GoogleLanguageModel
Source§fn provider(&self) -> &ProviderId
fn provider(&self) -> &ProviderId
Provider identifier, for example
openai.responses.Source§async fn supported_urls(&self) -> SupportedUrls
async fn supported_urls(&self) -> SupportedUrls
URL patterns (by media type) the provider can fetch itself. Read more
Source§async fn do_generate(
&self,
options: CallOptions,
) -> Result<GenerateResult, ProviderError>
async fn do_generate( &self, options: CallOptions, ) -> Result<GenerateResult, ProviderError>
Generates a complete response.
Source§async fn do_stream(
&self,
options: CallOptions,
) -> Result<StreamResult, ProviderError>
async fn do_stream( &self, options: CallOptions, ) -> Result<StreamResult, ProviderError>
Generates a streamed response.
Auto Trait Implementations§
impl !RefUnwindSafe for GoogleLanguageModel
impl !UnwindSafe for GoogleLanguageModel
impl Freeze for GoogleLanguageModel
impl Send for GoogleLanguageModel
impl Sync for GoogleLanguageModel
impl Unpin for GoogleLanguageModel
impl UnsafeUnpin for GoogleLanguageModel
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