TsgcHTTP_API_Anthropic属性 › ReadTimeout

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;

返回属性