Table of Contents

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

environment InteractionEnvironment

The environment configuration.

InteractionEnvironmentReference(string)

Creates a reference to an existing environment by ID.

public InteractionEnvironmentReference(string environmentId)

Parameters

environmentId string

The environment ID.

Properties

Environment

The environment configuration, when the environment is given as an object.

public InteractionEnvironment? Environment { get; }

Property Value

InteractionEnvironment

EnvironmentId

The referenced environment ID, when the environment is given as a string.

public string? EnvironmentId { get; }

Property Value

string

Methods

FromInteractionEnvironment(InteractionEnvironment)

Creates an environment reference from a configuration.

public static InteractionEnvironmentReference FromInteractionEnvironment(InteractionEnvironment environment)

Parameters

environment InteractionEnvironment

The environment configuration.

Returns

InteractionEnvironmentReference

The reference.

FromString(string)

Creates a reference to an existing environment by ID.

public static InteractionEnvironmentReference FromString(string environmentId)

Parameters

environmentId string

The 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

environment InteractionEnvironment

The environment configuration.

Returns

InteractionEnvironmentReference

implicit operator InteractionEnvironmentReference(string)

Converts an environment ID to a reference.

public static implicit operator InteractionEnvironmentReference(string environmentId)

Parameters

environmentId string

The environment ID.

Returns

InteractionEnvironmentReference