TsgcHTTP_API_Anthropic › 属性 › ReadTimeout
等待 Anthropic API 响应的最长时间(毫秒),超时后中止请求
property ReadTimeout: Integer read FReadTimeout write FReadTimeout;
—
ReadTimeout 适用于针对 https://api.anthropic.com/v1 的每次 HTTP 调用,涵盖简单请求和流式 Server-Sent Event 响应。调用生成长补全的模型或使用大型提示词调用 CountTokens/CreateMessage 时,应使用较大的值。值为零表示无超时。
oAPI := TsgcHTTP_API_Anthropic.Create(nil);
oAPI.AnthropicOptions.ApiKey := 'sk-ant-...';
// wait up to 120 seconds for Claude to finish the response
oAPI.ReadTimeout := 120000;