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<RawStreamingResult<StreamingCompletionResponse>, CompletionError>
pub async fn raw_stream( &self, completion_request: CompletionRequest, ) -> Result<RawStreamingResult<StreamingCompletionResponse>, 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: InteractionsClient<T>, model: impl Into<String>) -> Self
pub fn new(client: InteractionsClient<T>, model: impl Into<String>) -> Self
Create a new Interactions completion model for the given client and model name.
Sourcepub fn with_model(client: InteractionsClient<T>, model: &str) -> Self
pub fn with_model(client: InteractionsClient<T>, model: &str) -> Self
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<InteractionEventStream, CompletionError>
pub async fn stream_interaction_events( &self, completion_request: CompletionRequest, ) -> Result<InteractionEventStream, 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<InteractionEventStream, CompletionError>
pub async fn stream_interaction_events_by_id( &self, interaction_id: impl AsRef<str>, last_event_id: Option<&str>, ) -> Result<InteractionEventStream, 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> Clone for InteractionsCompletionModel<T>
impl<T: Clone> Clone for InteractionsCompletionModel<T>
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.Source§fn capabilities(&self) -> ProviderCapabilities
fn capabilities(&self) -> ProviderCapabilities
Source§impl<T> ConstructCompletionModel<Client<GeminiInteractionsExt, T>> for InteractionsCompletionModel<T>where
InteractionsClient<T>: Clone,
impl<T> ConstructCompletionModel<Client<GeminiInteractionsExt, T>> for InteractionsCompletionModel<T>where
InteractionsClient<T>: Clone,
Source§fn construct(client: &InteractionsClient<T>, model: String) -> Self
fn construct(client: &InteractionsClient<T>, model: String) -> Self
Auto Trait Implementations§
impl<T> Freeze for InteractionsCompletionModel<T>where
T: Freeze,
impl<T> RefUnwindSafe for InteractionsCompletionModel<T>where
T: RefUnwindSafe,
impl<T> Send for InteractionsCompletionModel<T>where
T: Send,
impl<T> Sync for InteractionsCompletionModel<T>where
T: Sync,
impl<T> Unpin for InteractionsCompletionModel<T>where
T: Unpin,
impl<T> UnsafeUnpin for InteractionsCompletionModel<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for InteractionsCompletionModel<T>where
T: UnwindSafe,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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> 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> ⓘ
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> ⓘ
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