跳转到主要内容 跳转到页脚
Bricks Templates
  • 首页
  • 模型列表
  • 文档
进入API中转站

入门

1
  • 快速接入

默拉APi

9
  • 聊天对话
  • 音频(Audio)
  • 自动补全
  • 嵌入向量
  • 微调模型
  • 创建图像
  • 模型列表
  • 上传文件
  • 内容审查
  • 首页
  • 文档
  • 默拉API中转站
  • 默拉APi
  • 上传文件

上传文件

POST 上传文件 #

POST https://api.mygptlife.com/v1/files

上传可跨各种端点/功能使用的文件。一个组织上传的所有文件大小最大可达 100 GB。

单个文件的大小最大为 512MB。请参阅助手工具指南 (opens new window)以了解有关支持的文件类型的更多信息。Fine-tuning API 仅支持.jsonl文件。

如果您需要增加这些存储限制,请联系我们。

Body 请求参数

file: string
purpose: fine-tune

请求参数 #

名称位置类型必选说明
Authorizationheaderstring否none
bodybodyobject否none
» filebodystring(binary)是要上传的JSONL (opens new window)文件的名称。
» purposebodystring是上传文件的预期目的。

详细说明 #

» file: 要上传的JSONL (opens new window)文件的名称。

如果purpose设置为“微调”,则每一行都是一个 JSON 记录,其中包含代表您的训练示例 (opens new window)的“提示”和“完成”字段。

» purpose: 上传文件的预期目的。

使用“fine-tune”进行微调 (opens new window),使用“assistants”进行助手 (opens new window)和消息 (opens new window)。这使我们能够验证上传文件的格式是否正确以进行微调。

返回示例

成功

{
  "id": "file-BK7bzQj3FfZFXr7DbL6xJwfo",
  "object": "file",
  "bytes": 120000,
  "created_at": 1677610602,
  "filename": "mydata.jsonl",
  "purpose": "fine-tune"
}

返回结果 #

状态码状态码含义说明数据模型
200OK(opens new window)成功Inline

返回数据结构 #

状态码 200

名称类型必选约束中文名说明
» idstringtruenonenone
» objectstringtruenonenone
» bytesintegertruenonenone
» created_atintegertruenonenone
» filenamestringtruenonenone
» purposestringtruenonenone

DELETE 删除文件 #

DELETE https://api.mygptlife.com/v1/files/{file_id}

删除文件。

请求参数 #

名称位置类型必选说明
file_idpathstring是用于此请求的文件的 ID。
Authorizationheaderstring否none

返回示例

成功

{
  "id": "file-abc123",
  "object": "file",
  "deleted": true
}

返回结果 #

状态码状态码含义说明数据模型
200OK(opens new window)成功Inline

返回数据结构 #

状态码 200

名称类型必选约束中文名说明
» idstringtruenonenone
» objectstringtruenonenone
» deletedbooleantruenonenone

GET 检索文件 #

GET https://api.mygptlife.com/v1/files/{file_id}

返回有关特定文件的信息。

请求参数 #

名称位置类型必选说明
file_idpathstring是用于此请求的文件的 ID。
Authorizationheaderstring否none

返回示例

成功

{
  "id": "file-BK7bzQj3FfZFXr7DbL6xJwfo",
  "object": "file",
  "bytes": 120000,
  "created_at": 1677610602,
  "filename": "mydata.jsonl",
  "purpose": "fine-tune"
}

返回结果 #

状态码状态码含义说明数据模型
200OK(opens new window)成功Inline

返回数据结构 #

状态码 200

名称类型必选约束中文名说明
» idstringtruenonenone
» objectstringtruenonenone
» bytesintegertruenonenone
» created_atintegertruenonenone
» filenamestringtruenonenone
» purposestringtruenonenone

GET 检索文件内容 #

GET https://api.mygptlife.com/v1/files/{file_id}/content

请求参数 #

名称位置类型必选说明
file_idpathstring是用于此请求的文件的 ID。
Authorizationheaderstring否none

返回示例

200 Response

{}

返回结果 #

状态码状态码含义说明数据模型
200OK(opens new window)成功Inline

返回数据结构 #

GET 列出文件 #

GET https://api.mygptlife.com/v1/files%2520_

请求参数 #

名称位置类型必选说明
purposequerystring否Only return files with the given purpose.
Authorizationheaderstring否none

详细说明 #

purpose: Only return files with the given purpose.

返回示例

成功

{
  "data": [
    {
      "id": "file-abc123",
      "object": "file",
      "bytes": 175,
      "created_at": 1613677385,
      "filename": "salesOverview.pdf",
      "purpose": "assistants"
    },
    {
      "id": "file-abc123",
      "object": "file",
      "bytes": 140,
      "created_at": 1613779121,
      "filename": "puppy.jsonl",
      "purpose": "fine-tune"
    }
  ],
  "object": "list"
}

返回结果 #

状态码状态码含义说明数据模型
200OK(opens new window)成功Inline

返回数据结构 #

状态码 200

名称类型必选约束中文名说明
» data[object]truenonenone
»» idstringtruenonenone
»» objectstringtruenonenone
»» bytesintegertruenonenone
»» created_atintegertruenonenone
»» filenamestringtruenonenone
»» purposestringtruenonenone
» objectstringtruenonenone
您的感觉是什么
还有问题?我们能帮忙吗?

需要什么帮助?

更新 2024-06-04
模型列表内容审查
内容目录
  • POST 上传文件
    • 请求参数
      • 详细说明
    • 返回结果
    • 返回数据结构
  • DELETE 删除文件
    • 请求参数
    • 返回结果
    • 返回数据结构
  • GET 检索文件
    • 请求参数
    • 返回结果
    • 返回数据结构
  • GET 检索文件内容
    • 请求参数
    • 返回结果
    • 返回数据结构
  • GET 列出文件
    • 请求参数
      • 详细说明
    • 返回结果
    • 返回数据结构
© 2020-2024 默拉智能API中转站