pub struct InteractionsCompletionModel<T = Client> {
pub model: String,
/* private fields */
}Expand description
Completion model wrapper for the Gemini Interactions API.
Fields§
§model: StringImplementations§
Source§impl<T> InteractionsCompletionModel<T>
impl<T> InteractionsCompletionModel<T>
Sourcepub async fn raw_stream(
&self,
completion_request: CompletionRequest,
) -> Result<Pin<Box<dyn Stream<Item = Result<RawStreamingChoice<StreamingCompletionResponse>, CompletionError>> + Send>>, CompletionError>
pub async fn raw_stream( &self, completion_request: CompletionRequest, ) -> Result<Pin<Box<dyn Stream<Item = Result<RawStreamingChoice<StreamingCompletionResponse>, CompletionError>> + Send>>, CompletionError>
Open an Interactions stream whose terminal record stays provider-native.
The normalized CompletionModel::stream
delegates here and maps only the terminal record, so both paths open
exactly one stream over the same request, telemetry, and error handling.
Source§impl<T> InteractionsCompletionModel<T>
impl<T> InteractionsCompletionModel<T>
Sourcepub fn new(
client: Client<GeminiInteractionsExt, T>,
model: impl Into<String>,
) -> InteractionsCompletionModel<T>
pub fn new( client: Client<GeminiInteractionsExt, T>, model: impl Into<String>, ) -> InteractionsCompletionModel<T>
Create a new Interactions completion model for the given client and model name.
Sourcepub fn with_model(
client: Client<GeminiInteractionsExt, T>,
model: &str,
) -> InteractionsCompletionModel<T>
pub fn with_model( client: Client<GeminiInteractionsExt, T>, model: &str, ) -> InteractionsCompletionModel<T>
Create a new Interactions completion model using a string model name.
Sourcepub fn generate_content_api(self) -> CompletionModel<T>
pub fn generate_content_api(self) -> CompletionModel<T>
Use the GenerateContent API instead of Interactions.
Source§impl<T> InteractionsCompletionModel<T>
impl<T> InteractionsCompletionModel<T>
Sourcepub async fn create_interaction(
&self,
completion_request: CompletionRequest,
) -> Result<Interaction, CompletionError>
pub async fn create_interaction( &self, completion_request: CompletionRequest, ) -> Result<Interaction, CompletionError>
Create an interaction and return the raw response payload.
Sourcepub async fn get_interaction(
&self,
interaction_id: impl AsRef<str>,
) -> Result<Interaction, CompletionError>
pub async fn get_interaction( &self, interaction_id: impl AsRef<str>, ) -> Result<Interaction, CompletionError>
Fetch an interaction by ID for polling background tasks.
Sourcepub async fn stream_interaction_events(
&self,
completion_request: CompletionRequest,
) -> Result<Pin<Box<dyn Stream<Item = Result<InteractionSseEvent, CompletionError>> + Send>>, CompletionError>
pub async fn stream_interaction_events( &self, completion_request: CompletionRequest, ) -> Result<Pin<Box<dyn Stream<Item = Result<InteractionSseEvent, CompletionError>> + Send>>, CompletionError>
Start an interaction and stream raw SSE events.
Sourcepub async fn stream_interaction_events_by_id(
&self,
interaction_id: impl AsRef<str>,
last_event_id: Option<&str>,
) -> Result<Pin<Box<dyn Stream<Item = Result<InteractionSseEvent, CompletionError>> + Send>>, CompletionError>
pub async fn stream_interaction_events_by_id( &self, interaction_id: impl AsRef<str>, last_event_id: Option<&str>, ) -> Result<Pin<Box<dyn Stream<Item = Result<InteractionSseEvent, CompletionError>> + Send>>, CompletionError>
Resume an interaction stream by ID and optional last event ID.
Source§impl<T> InteractionsCompletionModel<T>
impl<T> InteractionsCompletionModel<T>
Sourcepub async fn raw_completion(
&self,
completion_request: CompletionRequest,
) -> Result<Interaction, CompletionError>
pub async fn raw_completion( &self, completion_request: CompletionRequest, ) -> Result<Interaction, CompletionError>
Execute a completion and return the Interactions API’s own payload.
This is the escape hatch for interaction fields rig does not normalize —
step history, lifecycle status, hosted-tool exchanges. It shares the
request builder, transport, telemetry, and error handling with
CompletionModel::completion,
which calls it and then applies the provider-local mapping — one network
request either way.
Trait Implementations§
Source§impl<T> Clone for InteractionsCompletionModel<T>where
T: Clone,
impl<T> Clone for InteractionsCompletionModel<T>where
T: Clone,
Source§fn clone(&self) -> InteractionsCompletionModel<T>
fn clone(&self) -> InteractionsCompletionModel<T>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<T> CompletionModel for InteractionsCompletionModel<T>
impl<T> CompletionModel for InteractionsCompletionModel<T>
Source§async fn completion(
&self,
completion_request: CompletionRequest,
) -> Result<CompletionResponse, CompletionError>
async fn completion( &self, completion_request: CompletionRequest, ) -> Result<CompletionResponse, CompletionError>
Source§async fn stream(
&self,
request: CompletionRequest,
) -> Result<StreamingCompletionResponse, CompletionError>
async fn stream( &self, request: CompletionRequest, ) -> Result<StreamingCompletionResponse, CompletionError>
Source§fn completion_request(
&self,
prompt: impl Into<Message>,
) -> CompletionRequestBuilder<Self>
fn completion_request( &self, prompt: impl Into<Message>, ) -> CompletionRequestBuilder<Self>
prompt.