TsgcHTTP_API_Anthropic › 方法 › ListBatches
列出 Anthropic 工作区中的所有消息批次,支持可选分页
function ListBatches(const aLimit: Integer = 20; const aAfterId: string = ''; const aBeforeId: string = '') : TsgcAnthropicClass_Response_List_Batches;
| 名称 | 类型 | 描述 |
|---|---|---|
aLimit | const Integer | 每页返回的最大批次数量。默认值为 20。 |
aAfterId | const string | Cursor:返回在具有此 id 的批次之后创建的批次。首页时为空。 |
aBeforeId | const string | 游标:返回在指定 ID 的批次之前创建的批次。留空表示忽略。 |
包含 Data 批量描述符数组和分页游标的响应(TsgcAnthropicClass_Response_List_Batches)
向 Anthropic Message Batches API 发送 GET /v1/messages/batches 请求,返回当前工作区提交的所有批次及其当前处理状态(in_progress、ended、canceled 等)。使用 aAfterId 可翻页查看后续内容。AnthropicOptions 中的 anthropic-version 请求头将自动附加。返回的对象必须由调用方释放。
oResponse := oAPI.ListBatches(20);
try
for i := 0 to oResponse.Data.Count - 1 do
Memo1.Lines.Add(oResponse.Data[i].Id + ' = ' + oResponse.Data[i].ProcessingStatus);
finally
oResponse.Free;
end;