Table of Contents

Class InteractionContent

Namespace
GenerativeAI.Types
Assembly
GenerativeAI.dll

A content block of the Interactions API (text, image, audio, video or document), discriminated by type. Unknown content types are read as UnknownInteractionContent.

[JsonConverter(typeof(InteractionContentConverter))]
public abstract class InteractionContent
Inheritance
InteractionContent
Derived
Inherited Members
Extension Methods

Constructors

InteractionContent(string)

Initializes a new content block with the given discriminator.

protected InteractionContent(string type)

Parameters

type string

The type discriminator.

Properties

ExtensionData

Fields returned by the API that this SDK does not model yet.

[JsonExtensionData]
public Dictionary<string, JsonElement>? ExtensionData { get; set; }

Property Value

Dictionary<string, JsonElement>

Type

The content type discriminator (see InteractionContentTypes).

[JsonPropertyName("type")]
public string Type { get; }

Property Value

string

Methods

FromText(string)

Creates a text content block.

public static InteractionTextContent FromText(string text)

Parameters

text string

The text.

Returns

InteractionTextContent

A new InteractionTextContent.