pub struct Interaction {Show 18 fields
pub id: Option<String>,
pub status: InteractionStatus,
pub model: Option<String>,
pub agent: Option<String>,
pub object: Option<String>,
pub created: Option<String>,
pub updated: Option<String>,
pub steps: Vec<Step>,
pub usage: Option<InteractionUsage>,
pub system_instruction: Option<String>,
pub tools: Vec<InteractionTool>,
pub previous_interaction_id: Option<String>,
pub environment_id: Option<String>,
pub response_modalities: Option<Vec<ResponseModality>>,
pub service_tier: Option<ServiceTier>,
pub cached_content: Option<String>,
pub agent_config: Option<AgentConfig>,
pub error: Option<InteractionError>,
}Expand description
Interaction resource — represents a complete interaction.
Fields§
§id: Option<String>§status: InteractionStatus§model: Option<String>§agent: Option<String>§object: Option<String>§created: Option<String>§updated: Option<String>§steps: Vec<Step>§usage: Option<InteractionUsage>§system_instruction: Option<String>§tools: Vec<InteractionTool>§previous_interaction_id: Option<String>§environment_id: Option<String>§response_modalities: Option<Vec<ResponseModality>>§service_tier: Option<ServiceTier>§cached_content: Option<String>§agent_config: Option<AgentConfig>§error: Option<InteractionError>Implementations§
Source§impl Interaction
Convenience methods on Interaction.
impl Interaction
Convenience methods on Interaction.
Sourcepub fn output_text(&self) -> String
pub fn output_text(&self) -> String
Get the concatenated final text output.
Extracts text from the last model_output step’s text content items.
Sourcepub fn function_calls(&self) -> Vec<&Step>
pub fn function_calls(&self) -> Vec<&Step>
Get all function_call steps.
Sourcepub fn model_outputs(&self) -> Vec<&Step>
pub fn model_outputs(&self) -> Vec<&Step>
Get all model_output steps.
Sourcepub fn requires_action(&self) -> bool
pub fn requires_action(&self) -> bool
Whether the interaction requires user action (e.g., function calling).
Sourcepub fn is_completed(&self) -> bool
pub fn is_completed(&self) -> bool
Whether the interaction is completed.
Sourcepub fn output_image(&self) -> Option<&InteractionContent>
pub fn output_image(&self) -> Option<&InteractionContent>
Get the output image (last model-generated image).
Sourcepub fn output_audio(&self) -> Option<&InteractionContent>
pub fn output_audio(&self) -> Option<&InteractionContent>
Get the output audio (last model-generated audio).
Sourcepub fn output_video(&self) -> Option<&InteractionContent>
pub fn output_video(&self) -> Option<&InteractionContent>
Get the output video (last model-generated video).
Sourcepub fn output_document(&self) -> Option<&InteractionContent>
pub fn output_document(&self) -> Option<&InteractionContent>
Get the output document (last model-generated document).
Sourcepub fn citations(&self) -> Vec<&Annotation>
pub fn citations(&self) -> Vec<&Annotation>
Get all citation annotations from model outputs.
Sourcepub fn total_tokens(&self) -> Option<i64>
pub fn total_tokens(&self) -> Option<i64>
Get the total token count.
Trait Implementations§
Source§impl Clone for Interaction
impl Clone for Interaction
Source§fn clone(&self) -> Interaction
fn clone(&self) -> Interaction
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 Interaction
impl Debug for Interaction
Source§impl<'de> Deserialize<'de> for Interaction
impl<'de> Deserialize<'de> for Interaction
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for Interaction
impl PartialEq for Interaction
Source§impl Serialize for Interaction
impl Serialize for Interaction
impl StructuralPartialEq for Interaction
Auto Trait Implementations§
impl Freeze for Interaction
impl RefUnwindSafe for Interaction
impl Send for Interaction
impl Sync for Interaction
impl Unpin for Interaction
impl UnsafeUnpin for Interaction
impl UnwindSafe for Interaction
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