TsgcAIOpenAITranslatorProperties › OpenAIOptions

OpenAIOptions Property

Configures the OpenAI account credentials and logging used to reach the Whisper and Chat Completion endpoints.

Syntax

property OpenAIOptions: TsgcHTTPOpenAI_Options read FOpenAIOptions write SetOpenAIOptions;

Default Value

Remarks

Set ApiKey with the secret generated from your OpenAI dashboard; this credential authenticates every request the translator issues to the Whisper transcription API and to the Chat Completion endpoint used for translation. The optional Organization field selects which OpenAI organization is billed when your account belongs to more than one. Enable LogOptions.Enabled with a valid FileName to capture all request and response payloads for troubleshooting. An invalid or missing API key causes the component to raise an authentication error as soon as Start is invoked.

Example

sgcTranslator := TsgcAIOpenAITranslator.Create(nil);
sgcTranslator.OpenAIOptions.ApiKey := 'your_openai_api_key';
sgcTranslator.OpenAIOptions.LogOptions.Enabled := True;
sgcTranslator.OpenAIOptions.LogOptions.FileName := 'translator.log';

Back to Properties