Class InteractionInput
- Namespace
- GenerativeAI.Types
- Assembly
- GenerativeAI.dll
The input of an interaction: a string, a single content block, a list of content blocks, or a list of steps (for example the previous turns plus function results).
[JsonConverter(typeof(InteractionInputConverter))]
public sealed class InteractionInput
- Inheritance
-
InteractionInput
- Inherited Members
- Extension Methods
Constructors
InteractionInput(InteractionContent)
Creates an input made of a single content block.
public InteractionInput(InteractionContent content)
Parameters
contentInteractionContentThe content block.
InteractionInput(string)
Creates a text input.
public InteractionInput(string text)
Parameters
textstringThe text.
Properties
Content
The input content, when the input is a single content block.
public InteractionContent? Content { get; }
Property Value
Contents
The input contents, when the input is a list of content blocks.
public List<InteractionContent>? Contents { get; }
Property Value
Steps
The input steps, when the input is a list of steps.
public List<InteractionStep>? Steps { get; }
Property Value
Text
The input text, when the input is a string.
public string? Text { get; }
Property Value
Methods
FromContents(IEnumerable<InteractionContent>)
Creates an input from content blocks (e.g. text plus an image).
public static InteractionInput FromContents(IEnumerable<InteractionContent> contents)
Parameters
contentsIEnumerable<InteractionContent>The content blocks.
Returns
- InteractionInput
The input.
FromSteps(IEnumerable<InteractionStep>)
Creates an input from steps (e.g. function results).
public static InteractionInput FromSteps(IEnumerable<InteractionStep> steps)
Parameters
stepsIEnumerable<InteractionStep>The steps.
Returns
- InteractionInput
The input.
FromString(string)
Creates a text input (same as FromText(string)).
public static InteractionInput FromString(string text)
Parameters
textstringThe text.
Returns
- InteractionInput
The input.
FromText(string)
Creates a text input.
public static InteractionInput FromText(string text)
Parameters
textstringThe text.
Returns
- InteractionInput
The input.
Operators
implicit operator InteractionInput(string)
Creates a text input.
public static implicit operator InteractionInput(string text)
Parameters
textstringThe text.