TsgcAIOpenAIChatBotProperties › OpenAIOptions

OpenAIOptions Property

OpenAI API credentials and logging (ApiKey, Organization, LogOptions) shared by Whisper, ChatCompletion and Embeddings calls.

Syntax

property OpenAIOptions: TsgcHTTPOpenAI_Options read FOpenAIOptions write SetOpenAIOptions;

Default Value

Remarks

Holds the credentials and log settings used for every REST call made by the ChatBot. ApiKey is mandatory; Organization is optional. When LogOptions.Enabled is true every request/response is appended to LogOptions.FileName, which helps diagnose Whisper, ChatCompletion and Embeddings calls without extra plumbing.

Example

sgcChatBot.OpenAIOptions.ApiKey := 'sk-...';
sgcChatBot.OpenAIOptions.Organization := 'org-...';
sgcChatBot.OpenAIOptions.LogOptions.Enabled := True;
sgcChatBot.OpenAIOptions.LogOptions.FileName := 'chatbot.log';

Back to Properties