Table of Contents

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

string

AgentConfig

Configuration of the agent. Only valid with Agent.

[JsonPropertyName("agent_config")]
public InteractionAgentConfig? AgentConfig { get; set; }

Property Value

InteractionAgentConfig

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

string

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

string

Environment

The environment: an existing environment ID or a remote environment configuration.

[JsonPropertyName("environment")]
public InteractionEnvironmentReference? Environment { get; set; }

Property Value

InteractionEnvironmentReference

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

Dictionary<string, JsonElement>

GenerationConfig

Generation parameters. Only valid with Model.

[JsonPropertyName("generation_config")]
public InteractionGenerationConfig? GenerationConfig { get; set; }

Property Value

InteractionGenerationConfig

Input

The input of the interaction: a string, content blocks, or steps.

[JsonPropertyName("input")]
public InteractionInput? Input { get; set; }

Property Value

InteractionInput

Labels

User-defined labels.

[JsonPropertyName("labels")]
public Dictionary<string, string>? Labels { get; set; }

Property Value

Dictionary<string, string>

Model

The model that will complete the prompt (see InteractionModels).

[JsonPropertyName("model")]
public string? Model { get; set; }

Property Value

string

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

string

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

List<InteractionResponseFormat>

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

string

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

List<string>

SafetySettings

Safety settings.

[JsonPropertyName("safety_settings")]
public List<InteractionSafetySetting>? SafetySettings { get; set; }

Property Value

List<InteractionSafetySetting>

ServiceTier

The service tier (see InteractionServiceTiers).

[JsonPropertyName("service_tier")]
public string? ServiceTier { get; set; }

Property Value

string

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

string

Tools

Tools the model may call during the interaction.

[JsonPropertyName("tools")]
public List<InteractionTool>? Tools { get; set; }

Property Value

List<InteractionTool>

WebhookConfig

Webhook configuration.

[JsonPropertyName("webhook_config")]
public InteractionWebhookConfig? WebhookConfig { get; set; }

Property Value

InteractionWebhookConfig

Methods

Clone()

Creates a shallow copy of this request.

public CreateInteractionRequest Clone()

Returns

CreateInteractionRequest

The copy.