获取生成指定 Response 时所使用的输入项列表。在多轮对话(使用 previous_response_id 串联)中,会一并返回历史轮次的用户输入和模型回复。仅当原创建请求中 store=true 时,返回的 Response ID 才支持查询。
调用时请将
当指定的 Response ID 不存在时,返回以下错误:
{WorkspaceId}替换为真实的业务空间ID。
- 华北2(北京)
SDK 调用配置的
base_url:https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/compatible-mode/v1HTTP 请求地址:GET https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/compatible-mode/v1/responses/{response_id}/input_items路径参数response_idstring(必选)要查询输入项的 Response ID,格式为 resp_xxx。仅当原创建请求中 store=true 时,返回的 Response ID 才支持查询。查询参数afterstring(可选)以指定的 item ID(格式为 msg_xxx)作为起点,返回排在该 ID 之后的数据,顺序由 order 决定。item ID 来源:创建响应返回的 output[].id;或本接口返回的 data[].id、first_id、last_id。常用于翻页:把上一次返回的 last_id 作为本次的 after 传入,即可继续获取后续数据。limitinteger(可选)返回的最大条数,取值范围 [1, 100],默认值为 20。orderstring(可选)排序方式,支持 asc(升序)和 desc(降序),默认值为 desc。 |
Python |
返回结果dataarray输入项列表。每个元素是一个消息对象,包含 id、role、content、type、status 字段。role 取值为 user 或 assistant;content 中元素的 type 取值为 input_text(用户输入)或 output_text(模型回复)。多轮对话(使用 previous_response_id 串联)中,会按发生顺序包含历史用户消息与历史模型回复。first_id string列表中第一个元素的 ID。last_id string列表中最后一个元素的 ID。has_more boolean是否还有未返回的数据。当为 true 时,把本次返回的 last_id 作为下一次请求的 after 参数,可继续获取后续数据。id string对应的 Response ID。model string生成该 Response 时使用的模型名称。created_at integerResponse 创建时间的 Unix 时间戳(毫秒)。注意:与"创建响应/检索响应"接口返回的 created_at(秒)单位不同。previous_response_id string多轮对话(使用 previous_response_id 串联)时返回,值为上一轮的 Response ID。 |