Table of Contents

Class AssistantOptions

Represents configuration options for creating and interacting with an OpenAI Assistant tool.

public class AssistantOptions
Inheritance
object
AssistantOptions

Properties

AssistantFetchCount

Optional if Glitch9.IO.Networking.FetchMethod is set to Glitch9.IO.Networking.FetchMethod.FetchWithName. The number of Assistants to fetch to find the correct one. Default is 20.

public int AssistantFetchCount { get; set; }

Property Value

int

CustomClient

Optional. Gets or sets the custom client to use for the assistant's operations.

public OpenAI CustomClient { get; set; }

Property Value

OpenAI

CustomEventStreamHandler

Optional. Gets or sets the custom event stream handler for AssistantsAPIv2.

public IAssistantEventStreamHandler CustomEventStreamHandler { get; set; }

Property Value

IAssistantEventStreamHandler

Description

Required. Gets or sets the description of the assistant's functionality.

public string Description { get; set; }

Property Value

string

EventHandler

Optional. Event handler for AssistantsAPIv2

public AssistantEventHandler EventHandler { get; set; }

Property Value

AssistantEventHandler

Exception

[Deprecated] Use customized OpenAI with OnTokensValidated, OnTokensConsumed, and Exception instead. Optional. Gets or sets an event handler that is called when an error occurs during the assistant's operation.

public CRUDClient<OpenAI>.ExceptionHandler Exception { get; set; }

Property Value

CRUDClient<OpenAI>.ExceptionHandler

ForcedTool

Optional. Forces the AssistantsAPI to use the specified tool on every request.

public ToolChoice ForcedTool { get; set; }

Property Value

ToolChoice

HasCodeInterpreter

Enable or disable the Assistant's access to the code_interpreter tool.

public bool HasCodeInterpreter { get; set; }

Property Value

bool

HasFileSearch

Enable or disable the Assistant's access to the file_search tool.

public bool HasFileSearch { get; set; }

Property Value

bool

Id

Required. Unique identifier for the AssistantsAPI. This is used to locally identify the AssistantsAPI instance and is not related to the OpenAI API.

public string Id { get; set; }

Property Value

string

InitialDelayForRunStatusCheckSec

Optional. Gets or sets the initial delay in seconds before checking the run status for the first time.

public int InitialDelayForRunStatusCheckSec { get; set; }

Property Value

int

Instructions

Required. Gets or sets the instructions for using the assistant.

public string Instructions { get; set; }

Property Value

string

IsValid

Validates if the configuration options are correctly set.

public IResult IsValid { get; }

Property Value

IResult

LogRunStatusChange

Optional. If true, AssistantsAPIv2 will log the Run status change.

public bool LogRunStatusChange { get; set; }

Property Value

bool

MaxRequestLength

Optional. Gets or sets the maximum number of characters the assistant's responses can contain. Use -1 for no limit.

public int MaxRequestLength { get; set; }

Property Value

int

Metadata

Optional. Gets or sets the metadata associated with this assistant.

public Dictionary<string, string> Metadata { get; set; }

Property Value

Dictionary<string, string>

MinTokenRequirementPerRequest

Optional. Gets or sets the minimum number of tokens required per request.

public int MinTokenRequirementPerRequest { get; set; }

Property Value

int

Model

Required. Gets or sets the GPT model to be used by the tool. Defaults to GPT-3.5 Turbo.

public Model Model { get; set; }

Property Value

Model

Name

Required. Gets or sets the name of the assistant.

public string Name { get; set; }

Property Value

string

OnTokensConsumed

[Deprecated] Use customized OpenAI with OnTokensValidated, OnTokensConsumed, and Exception instead. Optional. Gets or sets an event handler that is called when tokens are consumed during the assistant's operation.

public AIClient<OpenAI>.UsageHandler OnTokensConsumed { get; set; }

Property Value

AIClient<OpenAI>.UsageHandler

RecurringRunStatusCheckIntervalSec

Optional. Gets or sets the recurring interval in seconds for checking the run status.

public int RecurringRunStatusCheckIntervalSec { get; set; }

Property Value

int

ResponseFormat

Optional. Gets or sets the response format for this assistant. Defaults to auto.

public TextFormat? ResponseFormat { get; set; }

Property Value

TextFormat?

RunOperationTimeoutSec

Optional. Gets or sets the timeout in seconds for the run operation.

public int RunOperationTimeoutSec { get; set; }

Property Value

int

SaveThreadMessages

Optional. If true, AssistantsAPIv2 will save the thread messages to PlayerPrefs.

public bool SaveThreadMessages { get; set; }

Property Value

bool

Sender

Optional. Set the sender name to track prompt history.

public string Sender { get; set; }

Property Value

string

Stream

Optional. Gets or sets a value indicating whether the assistant should stream responses. [ASSISTANTS API STREAM IS NOT SUPPORTED YET] Defaults to false.

public bool Stream { get; set; }

Property Value

bool

Temperature

Optional. Gets or sets the sampling temperature to use, between 0 and 2. Higher values make the output more random, while lower values make it more focused and deterministic.

public float Temperature { get; set; }

Property Value

float

ToolResources

Optional. Give the tools like code_interpreter and file_search access to files. Files are uploaded using the File upload endpoint and must have the purpose set to assistants to be used with this API.

public ToolResources ToolResources { get; set; }

Property Value

ToolResources

Tools

Give the Assistant access to up to 128 tools. You can give it access to OpenAI-hosted tools like code_interpreter and file_search, or call a third-party tools via a function calling.

public List<ToolCall> Tools { get; set; }

Property Value

List<ToolCall>

TopP

Optional. Gets or sets the nucleus sampling parameter, where the model considers the results of the tokens with top_p probability mass. Values like 0.1 mean only the tokens comprising the top 10% probability mass are considered. It is generally recommended to alter either this or the temperature, but not both.

public float TopP { get; set; }

Property Value

float