Class InteractionEnvironmentReference
- Namespace
- GenerativeAI.Types
- Assembly
- GenerativeAI.dll
The environment of an interaction: either an existing environment ID or an
InteractionEnvironment configuration.
[JsonConverter(typeof(InteractionEnvironmentReferenceConverter))]
public sealed class InteractionEnvironmentReference
- Inheritance
-
InteractionEnvironmentReference
- Inherited Members
- Extension Methods
Constructors
InteractionEnvironmentReference(InteractionEnvironment)
Creates an environment reference from a configuration.
public InteractionEnvironmentReference(InteractionEnvironment environment)
Parameters
environmentInteractionEnvironmentThe environment configuration.
InteractionEnvironmentReference(string)
Creates a reference to an existing environment by ID.
public InteractionEnvironmentReference(string environmentId)
Parameters
environmentIdstringThe environment ID.
Properties
Environment
The environment configuration, when the environment is given as an object.
public InteractionEnvironment? Environment { get; }
Property Value
EnvironmentId
The referenced environment ID, when the environment is given as a string.
public string? EnvironmentId { get; }
Property Value
Methods
FromInteractionEnvironment(InteractionEnvironment)
Creates an environment reference from a configuration.
public static InteractionEnvironmentReference FromInteractionEnvironment(InteractionEnvironment environment)
Parameters
environmentInteractionEnvironmentThe environment configuration.
Returns
- InteractionEnvironmentReference
The reference.
FromString(string)
Creates a reference to an existing environment by ID.
public static InteractionEnvironmentReference FromString(string environmentId)
Parameters
environmentIdstringThe environment ID.
Returns
- InteractionEnvironmentReference
The reference.
Operators
implicit operator InteractionEnvironmentReference(InteractionEnvironment)
Converts an environment configuration to a reference.
public static implicit operator InteractionEnvironmentReference(InteractionEnvironment environment)
Parameters
environmentInteractionEnvironmentThe environment configuration.
Returns
implicit operator InteractionEnvironmentReference(string)
Converts an environment ID to a reference.
public static implicit operator InteractionEnvironmentReference(string environmentId)
Parameters
environmentIdstringThe environment ID.