API 参考
完成上传
完成上传,使文件对智能体可用。
在把字节发送到 POST /experimental/files 返回的 upload_url 之后调用。在此之前,文件已存储,但项目中的任务看不到它。
OpenAPI
openapi: 3.1.0
info:
title: BioAgent API — V1
description: Public API for BioAgent, the biomedical AI agent platform.
version: 0.1.0
servers:
- url: https://bioagent.cloud/api/v1
description: >-
BioAgent public API base URL. Every endpoint on this page is served from
this host.
security: []
paths:
/experimental/files/{file_id}/finalize:
post:
tags:
- files
summary: Finalize an upload
description: Finish an upload so the file becomes available to the agent.
operationId: finalize_upload_experimental_files__file_id__finalize_post
parameters:
- name: file_id
in: path
required: true
schema:
type: string
title: File Id
requestBody:
content:
application/json:
schema:
anyOf:
- $ref: '#/components/schemas/FinalizeUploadRequest'
- type: 'null'
title: Req
responses:
'200':
description: Upload finished. The file becomes available to the agent shortly.
content:
application/json:
schema:
$ref: '#/components/schemas/UploadFinalized'
example:
type: upload_finalized
file_id: file_014komnJmtG0aWnZwu4yCzzw
security:
- bearerAuth: []
components:
schemas:
FinalizeUploadRequest:
properties:
upload_id:
anyOf:
- type: string
- type: 'null'
title: Upload Id
parts:
anyOf:
- items:
$ref: '#/components/schemas/CompletedPart'
type: array
- type: 'null'
title: Parts
additionalProperties: false
type: object
title: FinalizeUploadRequest
description: |-
Omit both fields for a single upload.
For a multipart upload, send the `upload_id` from
`POST /experimental/files` and every part's `{part_number, etag}`.
UploadFinalized:
properties:
type:
type: string
const: upload_finalized
title: Type
default: upload_finalized
file_id:
type: string
title: File Id
type: object
required:
- file_id
title: UploadFinalized
CompletedPart:
properties:
part_number:
type: integer
exclusiveMinimum: 0
title: Part Number
etag:
type: string
title: Etag
description: ETag returned in the part's PUT response
additionalProperties: false
type: object
required:
- part_number
- etag
title: CompletedPart
securitySchemes:
bearerAuth:
type: http
scheme: bearer
description: Requires an API key. See the Authentication guide.