Class AssistantOptions
Represents configuration options for creating and interacting with an OpenAI Assistant tool.
Inheritance
Namespace: Glitch9.AIDevKit.OpenAI.Assistants
Assembly: .dll
Syntax
public class 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.
Declaration
public int AssistantFetchCount { get; set; }
Property Value
Type | Description |
---|---|
int |
CustomClient
Optional. Gets or sets the custom client to use for the assistant's operations.
Declaration
public OpenAI CustomClient { get; set; }
Property Value
Type | Description |
---|---|
OpenAI |
CustomEventStreamHandler
Optional. Gets or sets the custom event stream handler for AssistantsAPIv2.
Declaration
public IAssistantEventStreamHandler CustomEventStreamHandler { get; set; }
Property Value
Type | Description |
---|---|
IAssistantEventStreamHandler |
Description
Required. Gets or sets the description of the assistant's functionality.
Declaration
public string Description { get; set; }
Property Value
Type | Description |
---|---|
string |
EventHandler
Optional. Event handler for AssistantsAPIv2
Declaration
public AssistantEventHandler EventHandler { get; set; }
Property Value
Type | Description |
---|---|
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.
Declaration
public CRUDClient<OpenAI>.ExceptionHandler Exception { get; set; }
Property Value
Type | Description |
---|---|
CRUDClient<OpenAI>.ExceptionHandler |
ForcedTool
Optional. Forces the AssistantsAPI to use the specified tool on every request.
Declaration
public ToolChoice ForcedTool { get; set; }
Property Value
Type | Description |
---|---|
ToolChoice |
HasCodeInterpreter
Enable or disable the Assistant's access to the code_interpreter tool.
Declaration
public bool HasCodeInterpreter { get; set; }
Property Value
Type | Description |
---|---|
bool |
HasFileSearch
Enable or disable the Assistant's access to the file_search tool.
Declaration
public bool HasFileSearch { get; set; }
Property Value
Type | Description |
---|---|
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.
Declaration
public string Id { get; set; }
Property Value
Type | Description |
---|---|
string |
InitialDelayForRunStatusCheckSec
Optional. Gets or sets the initial delay in seconds before checking the run status for the first time.
Declaration
public int InitialDelayForRunStatusCheckSec { get; set; }
Property Value
Type | Description |
---|---|
int |
Instructions
Required. Gets or sets the instructions for using the assistant.
Declaration
public string Instructions { get; set; }
Property Value
Type | Description |
---|---|
string |
IsValid
Validates if the configuration options are correctly set.
Declaration
public IResult IsValid { get; }
Property Value
Type | Description |
---|---|
IResult |
LogRunStatusChange
Optional. If true, AssistantsAPIv2 will log the Run status change.
Declaration
public bool LogRunStatusChange { get; set; }
Property Value
Type | Description |
---|---|
bool |
MaxRequestLength
Optional. Gets or sets the maximum number of characters the assistant's responses can contain. Use -1 for no limit.
Declaration
public int MaxRequestLength { get; set; }
Property Value
Type | Description |
---|---|
int |
Metadata
Optional. Gets or sets the metadata associated with this assistant.
Declaration
public Dictionary<string, string> Metadata { get; set; }
Property Value
Type | Description |
---|---|
Dictionary<string, string> |
MinTokenRequirementPerRequest
Optional. Gets or sets the minimum number of tokens required per request.
Declaration
public int MinTokenRequirementPerRequest { get; set; }
Property Value
Type | Description |
---|---|
int |
Model
Required. Gets or sets the GPT model to be used by the tool. Defaults to GPT-3.5 Turbo.
Declaration
public Model Model { get; set; }
Property Value
Type | Description |
---|---|
Model |
Name
Required. Gets or sets the name of the assistant.
Declaration
public string Name { get; set; }
Property Value
Type | Description |
---|---|
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.
Declaration
public AIClient<OpenAI>.UsageHandler OnTokensConsumed { get; set; }
Property Value
Type | Description |
---|---|
AIClient<OpenAI>.UsageHandler |
RecurringRunStatusCheckIntervalSec
Optional. Gets or sets the recurring interval in seconds for checking the run status.
Declaration
public int RecurringRunStatusCheckIntervalSec { get; set; }
Property Value
Type | Description |
---|---|
int |
ResponseFormat
Optional. Gets or sets the response format for this assistant. Defaults to auto.
Declaration
public TextFormat? ResponseFormat { get; set; }
Property Value
Type | Description |
---|---|
TextFormat? |
RunOperationTimeoutSec
Optional. Gets or sets the timeout in seconds for the run operation.
Declaration
public int RunOperationTimeoutSec { get; set; }
Property Value
Type | Description |
---|---|
int |
SaveThreadMessages
Optional. If true, AssistantsAPIv2 will save the thread messages to PlayerPrefs.
Declaration
public bool SaveThreadMessages { get; set; }
Property Value
Type | Description |
---|---|
bool |
Sender
Optional. Set the sender name to track prompt history.
Declaration
public string Sender { get; set; }
Property Value
Type | Description |
---|---|
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.
Declaration
public bool Stream { get; set; }
Property Value
Type | Description |
---|---|
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.
Declaration
public float Temperature { get; set; }
Property Value
Type | Description |
---|---|
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.
Declaration
public ToolResources ToolResources { get; set; }
Property Value
Type | Description |
---|---|
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.
Declaration
public List<ToolCall> Tools { get; set; }
Property Value
Type | Description |
---|---|
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.
Declaration
public float TopP { get; set; }
Property Value
Type | Description |
---|---|
float |