pub struct GenerativeModel { /* private fields */ }Expand description
Port of the Firebase JS SDK GenerativeModel class.
Reference: packages/ai/src/models/generative-model.ts.
Implementations§
Source§impl GenerativeModel
impl GenerativeModel
Sourcepub fn new(
service: Arc<AiService>,
model_name: impl Into<String>,
request_options: Option<RequestOptions>,
) -> AiResult<Self>
pub fn new( service: Arc<AiService>, model_name: impl Into<String>, request_options: Option<RequestOptions>, ) -> AiResult<Self>
Creates a new generative model bound to the provided AiService.
This mirrors the TypeScript constructor, normalising the model name according to the selected backend and capturing the service API settings for later requests.
Sourcepub fn prepare_generate_content_request(
&self,
body: Value,
request_options: Option<RequestOptions>,
) -> AiResult<PreparedRequest>
pub fn prepare_generate_content_request( &self, body: Value, request_options: Option<RequestOptions>, ) -> AiResult<PreparedRequest>
Prepares a generateContent request using the stored API settings.
Trait Implementations§
Source§impl Clone for GenerativeModel
impl Clone for GenerativeModel
Source§fn clone(&self) -> GenerativeModel
fn clone(&self) -> GenerativeModel
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 moreAuto Trait Implementations§
impl Freeze for GenerativeModel
impl RefUnwindSafe for GenerativeModel
impl Send for GenerativeModel
impl Sync for GenerativeModel
impl Unpin for GenerativeModel
impl UnwindSafe for GenerativeModel
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