codecamp

OpenAI 下载会话产物内容

get /agents/sessions/{session_id}/artifacts/{artifact_id}/content

下载不可变会话产物的字节。执行环境过期后仍可下载。参见会话产物。

路径参数

  • session_id: string

拥有此产物的会话 ID。

minLength: 0, maxLength: 1048576

  • artifact_id: string

不可变会话产物的 ID。

minLength: 0, maxLength: 1048576

返回值

file

内容类型为 application/octet-stream。

示例

## 从环境变量读取 API 密钥。
## 将 SESSION_ID 设置为目标会话的 ID。
## 将 ARTIFACT_ID 设置为目标产物的 ID。
## 响应为二进制内容。下载文件时可给 curl 添加 --output 及目标文件名。
curl https://api.openai.com/v1/agents/sessions/$SESSION_ID/artifacts/$ARTIFACT_ID/content \
    -H 'OpenAI-Beta: agents=v1' \
    -H "Authorization: Bearer $OPENAI_API_KEY"
OpenAI 列出会话产物
OpenAI 提交会话输入事件
温馨提示
下载编程狮App,免费阅读超1000+编程语言教程
取消
确定
目录

其他能力与进阶指南

Embeddings 接口参考

审计日志接口参考

项目管理及子资源接口参考

Agents 接口及子资源

Decisions 接口参考

关闭

MIP.setData({ 'pageTheme' : getCookie('pageTheme') || {'day':true, 'night':false}, 'pageFontSize' : getCookie('pageFontSize') || 20 }); MIP.watch('pageTheme', function(newValue){ setCookie('pageTheme', JSON.stringify(newValue)) }); MIP.watch('pageFontSize', function(newValue){ setCookie('pageFontSize', newValue) }); function setCookie(name, value){ var days = 1; var exp = new Date(); exp.setTime(exp.getTime() + days*24*60*60*1000); document.cookie = name + '=' + value + ';expires=' + exp.toUTCString(); } function getCookie(name){ var reg = new RegExp('(^| )' + name + '=([^;]*)(;|$)'); return document.cookie.match(reg) ? JSON.parse(document.cookie.match(reg)[2]) : null; }