擷取產生指定 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。 |