Class CreateInteractionRequest
- Namespace
- GenerativeAI.Types
- Assembly
- GenerativeAI.dll
Request body of POST /interactions. Set either Model (model interaction) or
Agent (agent interaction, e.g. Deep Research or Antigravity), not both.
public sealed class CreateInteractionRequest
- Inheritance
-
CreateInteractionRequest
- Inherited Members
- Extension Methods
Properties
Agent
The agent to interact with (see InteractionAgents).
[JsonPropertyName("agent")]
public string? Agent { get; set; }
Property Value
AgentConfig
Configuration of the agent. Only valid with Agent.
[JsonPropertyName("agent_config")]
public InteractionAgentConfig? AgentConfig { get; set; }
Property Value
Background
Input only. Run the interaction in the background; poll it with GetAsync.
[JsonPropertyName("background")]
public bool? Background { get; set; }
Property Value
- bool?
CachedContent
Deprecated in the API. The cached content used as context (cachedContents/{id}). Only valid with
Model.
[JsonPropertyName("cached_content")]
public string? CachedContent { get; set; }
Property Value
ContinuationToken
Opaque token to resume a long decode: pass back the ContinuationToken of an interaction whose status is RequiresContinuation.
[JsonPropertyName("continuation_token")]
public string? ContinuationToken { get; set; }
Property Value
Environment
The environment: an existing environment ID or a remote environment configuration.
[JsonPropertyName("environment")]
public InteractionEnvironmentReference? Environment { get; set; }
Property Value
ExtensionData
Additional body fields to send (for API features this SDK does not model yet).
[JsonExtensionData]
public Dictionary<string, JsonElement>? ExtensionData { get; set; }
Property Value
GenerationConfig
Generation parameters. Only valid with Model.
[JsonPropertyName("generation_config")]
public InteractionGenerationConfig? GenerationConfig { get; set; }
Property Value
Input
The input of the interaction: a string, content blocks, or steps.
[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 will complete the prompt (see InteractionModels).
[JsonPropertyName("model")]
public string? Model { get; set; }
Property Value
PreviousInteractionId
The ID of the previous interaction, to continue a conversation with server-side state.
[JsonPropertyName("previous_interaction_id")]
public string? PreviousInteractionId { get; set; }
Property Value
ResponseFormat
The requested output format(s): structured text, image, audio and/or video. A single entry is sent as an object, several as an array.
[JsonPropertyName("response_format")]
[JsonConverter(typeof(InteractionResponseFormatListConverter))]
public List<InteractionResponseFormat>? ResponseFormat { get; set; }
Property Value
ResponseMimeType
Deprecated in the API in favour of ResponseFormat. The MIME type of the response.
[JsonPropertyName("response_mime_type")]
public string? ResponseMimeType { get; set; }
Property Value
ResponseModalities
Deprecated in the API in favour of ResponseFormat. 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
Store
Input only. Whether to store the request and response for later retrieval (default true).
[JsonPropertyName("store")]
public bool? Store { get; set; }
Property Value
- bool?
Stream
Input only. Whether the response is streamed as Server-Sent Events. Set by StreamAsync.
[JsonPropertyName("stream")]
public bool? Stream { get; set; }
Property Value
- bool?
SystemInstruction
System instruction for the interaction.
[JsonPropertyName("system_instruction")]
public string? SystemInstruction { get; set; }
Property Value
Tools
Tools the model may call during the interaction.
[JsonPropertyName("tools")]
public List<InteractionTool>? Tools { get; set; }
Property Value
WebhookConfig
Webhook configuration.
[JsonPropertyName("webhook_config")]
public InteractionWebhookConfig? WebhookConfig { get; set; }
Property Value
Methods
Clone()
Creates a shallow copy of this request.
public CreateInteractionRequest Clone()
Returns
- CreateInteractionRequest
The copy.