TsgcHTTP_API_Anthropic › Properties › AnthropicOptions
Bevat verbindingsinstellingen voor de Anthropic API, inclusief API-sleutel, HTTP-opties, logboekregistratie, nieuwe pogingen en de anthropic-version-header.
property AnthropicOptions: TsgcHTTPAnthropic_Options read FAnthropicOptions
write SetAnthropicOptions;
—
AnthropicOptions stelt sub-eigenschappen beschikbaar die worden gebruikt door elk verzoek dat wordt verzonden naar https://api.anthropic.com/v1: ApiKey wordt verzonden in de header x-api-key, HttpOptions beheert proxy/user-agent/verbindingsinstellingen, LogOptions schakelt verzoek/antwoord-tracing in en RetryOptions configureert automatisch opnieuw proberen bij tijdelijke fouten. De verplichte header anthropic-version (bijvoorbeeld 2023-06-01) wordt hier ook beheerd. Configureer deze eigenschap eenmalig tijdens ontwerptijd of opstarten en alle volgende API-aanroepen hergebruiken dezelfde inloggegevens en beleidsregels.
oAPI := TsgcHTTP_API_Anthropic.Create(nil);
oAPI.AnthropicOptions.ApiKey := 'sk-ant-...';
oAPI.AnthropicOptions.AnthropicVersion := '2023-06-01';
oAPI.AnthropicOptions.HttpOptions.UserAgent := 'MyApp/1.0';
oAPI.AnthropicOptions.RetryOptions.Enabled := True;