Class Interaction
- Namespace
- GenerativeAI.Types
- Assembly
- GenerativeAI.dll
The Interaction resource returned by the Interactions API (/interactions). The output is exposed as
Steps; OutputText, OutputImage, OutputAudio and
OutputVideo are convenience accessors computed from the steps, like python-genai's helpers.
public sealed class Interaction
- Inheritance
-
Interaction
- Inherited Members
- Extension Methods
Properties
Agent
The agent that served the interaction.
[JsonPropertyName("agent")]
public string? Agent { get; set; }
Property Value
AgentConfig
The agent configuration.
[JsonPropertyName("agent_config")]
public InteractionAgentConfig? AgentConfig { get; set; }
Property Value
CachedContent
Deprecated in the API. The cached content used as context.
[JsonPropertyName("cached_content")]
public string? CachedContent { get; set; }
Property Value
ContinuationToken
Opaque token to resume a long decode. Set when Status is RequiresContinuation; pass it back unchanged to continue decoding.
[JsonPropertyName("continuation_token")]
public string? ContinuationToken { get; set; }
Property Value
Created
Output only. Creation time in ISO 8601 format.
[JsonPropertyName("created")]
public string? Created { get; set; }
Property Value
Environment
The environment configuration of the interaction.
[JsonPropertyName("environment")]
public InteractionEnvironmentReference? Environment { get; set; }
Property Value
EnvironmentId
Output only. The environment ID, when an environment was configured.
[JsonPropertyName("environment_id")]
public string? EnvironmentId { get; set; }
Property Value
Errors
Output only. Diagnostic faults or platform errors recorded on the interaction.
[JsonPropertyName("errors")]
public List<InteractionError>? Errors { get; set; }
Property Value
ExtensionData
Fields returned by the API that this SDK does not model yet.
[JsonExtensionData]
public Dictionary<string, JsonElement>? ExtensionData { get; set; }
Property Value
FunctionCalls
The function calls of the trailing model turn (after the last user input), which the client must answer with InteractionFunctionResultSteps when Status is RequiresAction.
[JsonIgnore]
public IReadOnlyList<InteractionFunctionCallStep> FunctionCalls { get; }
Property Value
GenerationConfig
The generation configuration.
[JsonPropertyName("generation_config")]
public InteractionGenerationConfig? GenerationConfig { get; set; }
Property Value
Id
Output only. A unique identifier for the interaction.
[JsonPropertyName("id")]
public string? Id { get; set; }
Property Value
Input
The input of the interaction (only returned when requested with include_input).
[JsonPropertyName("input")]
public InteractionInput? Input { get; set; }
Property Value
Labels
User-defined labels.
[JsonPropertyName("labels")]
public Dictionary<string, string>? Labels { get; set; }
Property Value
Model
The model that served the interaction.
[JsonPropertyName("model")]
public string? Model { get; set; }
Property Value
Object
Output only. The resource type. Only present on interactions embedded in streaming events.
[JsonPropertyName("object")]
public string? Object { get; set; }
Property Value
OutputAudio
The last generated audio of the model output steps, or null.
[JsonIgnore]
public InteractionAudioContent? OutputAudio { get; }
Property Value
OutputImage
The last generated image of the model output steps, or null.
[JsonIgnore]
public InteractionImageContent? OutputImage { get; }
Property Value
OutputText
Concatenated text of the trailing model output, after the last user input (thought steps are skipped);
an empty string when there is none. Mirrors python-genai's Interaction.output_text.
[JsonIgnore]
public string OutputText { get; }
Property Value
OutputVideo
The last generated video of the model output steps, or null. The video is either inline
(Data, see GetDataBytes()) or
referenced by Uri.
[JsonIgnore]
public InteractionVideoContent? OutputVideo { get; }
Property Value
PreviousInteractionId
The ID of the previous interaction, if any.
[JsonPropertyName("previous_interaction_id")]
public string? PreviousInteractionId { get; set; }
Property Value
ResponseFormat
The requested response format(s).
[JsonPropertyName("response_format")]
[JsonConverter(typeof(InteractionResponseFormatListConverter))]
public List<InteractionResponseFormat>? ResponseFormat { get; set; }
Property Value
ResponseMimeType
Deprecated in the API. The MIME type of the response.
[JsonPropertyName("response_mime_type")]
public string? ResponseMimeType { get; set; }
Property Value
ResponseModalities
Deprecated in the API. The requested response modalities (see InteractionModalities).
[JsonPropertyName("response_modalities")]
public List<string>? ResponseModalities { get; set; }
Property Value
SafetySettings
Safety settings.
[JsonPropertyName("safety_settings")]
public List<InteractionSafetySetting>? SafetySettings { get; set; }
Property Value
ServiceTier
The service tier (see InteractionServiceTiers).
[JsonPropertyName("service_tier")]
public string? ServiceTier { get; set; }
Property Value
Status
Output only. The status of the interaction (see InteractionStatuses).
[JsonPropertyName("status")]
public string? Status { get; set; }
Property Value
Steps
Output only. The steps that make up the interaction, when included in the response.
[JsonPropertyName("steps")]
public List<InteractionStep>? Steps { get; set; }
Property Value
SystemInstruction
The system instruction.
[JsonPropertyName("system_instruction")]
public string? SystemInstruction { get; set; }
Property Value
Tools
The tools available to the model.
[JsonPropertyName("tools")]
public List<InteractionTool>? Tools { get; set; }
Property Value
Updated
Output only. Last update time in ISO 8601 format.
[JsonPropertyName("updated")]
public string? Updated { get; set; }
Property Value
Usage
Statistics on the interaction's token usage.
[JsonPropertyName("usage")]
public InteractionUsage? Usage { get; set; }
Property Value
WebhookConfig
Webhook configuration.
[JsonPropertyName("webhook_config")]
public InteractionWebhookConfig? WebhookConfig { get; set; }