TsgcAIChat › Properties › ChatOptions
Connection and sampling options shared by every provider.
property ChatOptions: TsgcAIChatOptions read FChatOptions write SetChatOptions;
—
Published sub-properties used regardless of the selected Provider:
ApiKey: credential sent to the provider. Leave empty for local Ollama deployments.Model: model name (for example gpt-4o-mini, claude-sonnet-4-20250514, grok-3, llama3).MaxTokens: upper bound on generated tokens. Defaults to 4096.Temperature: randomness control. Negative values mean "leave default"; set 0..2 for OpenAI/Gemini-style providers or 0..1 for Anthropic.TopP: nucleus sampling, 0..1. Negative values mean "leave default".BaseUrl: custom endpoint base. It replaces the vendor endpoint of every provider, so a gateway, a proxy or a local OpenAI compatible server can be used; trailing slashes are trimmed and an empty value keeps the vendor endpoint. With aicpOllama it is the Host of the Ollama options.ResponseFormat: structured output. rfText (the default) builds the request exactly as before, rfJSON asks for any valid JSON document and rfJSONSchema asks for one that validates against JSONSchema.JSONSchema: the JSON Schema document. Required when ResponseFormat is rfJSONSchema, and it must itself be valid JSON, otherwise the first request raises EsgcAIChat.JSONSchemaName: the name sent with the schema, and the name of the forced tool of Anthropic. Defaults to response.
Each provider receives structured output in its own shape, and ChatJSON is the call that reads the answer back. See TsgcAIChat Structured Output.
oChat.ChatOptions.ApiKey := 'API_KEY';
oChat.ChatOptions.Model := 'gpt-4o-mini';
oChat.ChatOptions.MaxTokens := 2048;
oChat.ChatOptions.Temperature := 0.7;