feat: add documentation for remote file upload feature across multiple languages

pull/18666/head
ZeroZ_JQ 1 year ago
parent fdb314e178
commit 3e87f915d5

@ -275,6 +275,76 @@ The text generation application offers non-session support and is ideal for tran
</CodeGroup>
</Col>
</Row>
---
<Heading
url='/remote-files/upload'
method='POST'
title='Upload Remote File'
name='#remote-files-upload'
/>
<Row>
<Col>
Upload a remote file via URL for use when sending messages, enabling multimodal understanding.
<i>Uploaded files are for use by the current end-user only.</i>
### Request Body
<Properties>
<Property name='url' type='string' key='url'>
The URL address of the remote file.
</Property>
</Properties>
### Response
After a successful upload, the server will return the file's ID and related information.
- `id` (uuid) ID
- `name` (string) File name
- `size` (int) File size (bytes)
- `extension` (string) File extension
- `mime_type` (string) File mime-type
- `created_by` (uuid) End-user ID
- `created_at` (timestamp) Creation timestamp
- `url` (string) The signed access URL of the file
### Errors
- 400, `remote_file_upload_error`, Remote file upload failed, including the following cases:
- Request timeout
- Network error
- Empty file content
- File processing failure
- 400, `file_too_large`, The file is too large
- 400, `unsupported_file_type`, Unsupported extension
- 503, `s3_connection_failed`, Unable to connect to S3 service
- 503, `s3_permission_denied`, No permission to upload files to S3
- 503, `s3_file_too_large`, File exceeds S3 size limit
</Col>
<Col sticky>
<CodeGroup title="Request" tag="POST" label="/remote-files/upload" targetCode={`curl -X POST '${props.appDetail.api_base_url}/remote-files/upload' \\\n--header 'Authorization: Bearer {api_key}' \\\n--form 'url=https://example.com/image.jpg'`}>
```bash {{ title: 'cURL' }}
curl -X POST '${props.appDetail.api_base_url}/remote-files/upload' \
--header 'Authorization: Bearer {api_key}' \
--form 'url=https://example.com/image.jpg'
```
</CodeGroup>
<CodeGroup title="Response">
```json {{ title: 'Response' }}
{
"id": "72fa9618-8f89-4a37-9b33-7e1178a24a67",
"name": "example.jpg",
"size": 1024,
"extension": "jpg",
"mime_type": "image/jpeg",
"created_by": 123,
"created_at": 1577836800,
"url": "https://example.com/signed-url"
}
```
</CodeGroup>
</Col>
</Row>
---
<Heading

@ -274,6 +274,76 @@ import { Row, Col, Properties, Property, Heading, SubProperty, Paragraph } from
</CodeGroup>
</Col>
</Row>
---
<Heading
url='/remote-files/upload'
method='POST'
title='リモートファイルのアップロード'
name='#remote-files-upload'
/>
<Row>
<Col>
URLを使用してリモートファイルをアップロードし、メッセージ送信時に使用することで、マルチモーダルな理解を可能にします。
<i>アップロードされたファイルは、現在のエンドユーザーのみが使用できます。</i>
### リクエストボディ
<Properties>
<Property name='url' type='string' key='url'>
リモートファイルのURLアドレス。
</Property>
</Properties>
### レスポンス
アップロードが成功すると、サーバーはファイルのIDと関連情報を返します。
- `id` (uuid) ID
- `name` (string) ファイル名
- `size` (int) ファイルサイズ(バイト)
- `extension` (string) ファイル拡張子
- `mime_type` (string) ファイルのMIMEタイプ
- `created_by` (uuid) エンドユーザーID
- `created_at` (timestamp) 作成タイムスタンプ
- `url` (string) ファイルの署名付きアクセスURL
### エラー
- 400, `remote_file_upload_error`, リモートファイルのアップロードに失敗しました。以下の場合が含まれます:
- リクエストタイムアウト
- ネットワークエラー
- 空のファイル内容
- ファイル処理の失敗
- 400, `file_too_large`, ファイルが大きすぎます
- 400, `unsupported_file_type`, サポートされていない拡張子です
- 503, `s3_connection_failed`, S3サービスに接続できません
- 503, `s3_permission_denied`, S3へのファイルアップロード権限がありません
- 503, `s3_file_too_large`, ファイルがS3のサイズ制限を超えています
</Col>
<Col sticky>
<CodeGroup title="Request" tag="POST" label="/remote-files/upload" targetCode={`curl -X POST '${props.appDetail.api_base_url}/remote-files/upload' \\\n--header 'Authorization: Bearer {api_key}' \\\n--form 'url=https://example.com/image.jpg'`}>
```bash {{ title: 'cURL' }}
curl -X POST '${props.appDetail.api_base_url}/remote-files/upload' \
--header 'Authorization: Bearer {api_key}' \
--form 'url=https://example.com/image.jpg'
```
</CodeGroup>
<CodeGroup title="Response">
```json {{ title: 'Response' }}
{
"id": "72fa9618-8f89-4a37-9b33-7e1178a24a67",
"name": "example.jpg",
"size": 1024,
"extension": "jpg",
"mime_type": "image/jpeg",
"created_by": 123,
"created_at": 1577836800,
"url": "https://example.com/signed-url"
}
```
</CodeGroup>
</Col>
</Row>
---
<Heading

@ -251,6 +251,75 @@ import { Row, Col, Properties, Property, Heading, SubProperty } from '../md.tsx'
</CodeGroup>
</Col>
</Row>
---
<Heading
url='/remote-files/upload'
method='POST'
title='上传远程文件'
name='#remote-files-upload'
/>
<Row>
<Col>
通过URL上传远程文件并在发送消息时使用可实现多模态理解。
<i>上传的文件仅供当前终端用户使用。</i>
### Request Body
<Properties>
<Property name='url' type='string' key='url'>
远程文件的URL地址。
</Property>
</Properties>
### Response
成功上传后,服务器会返回文件的 ID 和相关信息。
- `id` (uuid) ID
- `name` (string) 文件名
- `size` (int) 文件大小byte
- `extension` (string) 文件后缀
- `mime_type` (string) 文件 mime-type
- `created_by` (uuid) 上传人 ID
- `created_at` (timestamp) 上传时间
- `url` (string) 文件的签名访问URL
### Errors
- 400`remote_file_upload_error`,远程文件上传失败,包括以下情况:
- 请求超时
- 网络错误
- 空文件内容
- 文件处理失败
- 400`file_too_large`,文件太大
- 400`unsupported_file_type`,不支持的扩展名
- 503`s3_connection_failed`,无法连接到 S3 服务
- 503`s3_permission_denied`,无权限上传文件到 S3
- 503`s3_file_too_large`,文件超出 S3 大小限制
</Col>
<Col sticky>
<CodeGroup title="Request" tag="POST" label="/remote-files/upload" targetCode={`curl -X POST '${props.appDetail.api_base_url}/remote-files/upload' \\\n--header 'Authorization: Bearer {api_key}' \\\n--form 'url=https://example.com/image.jpg'`}>
```bash {{ title: 'cURL' }}
curl -X POST '${props.appDetail.api_base_url}/remote-files/upload' \
--header 'Authorization: Bearer {api_key}' \
--form 'url=https://example.com/image.jpg'
```
</CodeGroup>
<CodeGroup title="Response">
```json {{ title: 'Response' }}
{
"id": "72fa9618-8f89-4a37-9b33-7e1178a24a67",
"name": "example.jpg",
"size": 1024,
"extension": "jpg",
"mime_type": "image/jpeg",
"created_by": 123,
"created_at": 1577836800,
"url": "https://example.com/signed-url"
}
```
</CodeGroup>
</Col>
</Row>
---
<Heading
url='/completion-messages/:task_id/stop'

@ -379,6 +379,76 @@ Chat applications support session persistence, allowing previous chat history to
</CodeGroup>
</Col>
</Row>
---
<Heading
url='/remote-files/upload'
method='POST'
title='Upload Remote File'
name='#remote-files-upload'
/>
<Row>
<Col>
Upload a remote file via URL for use when sending messages, enabling multimodal understanding.
<i>Uploaded files are for use by the current end-user only.</i>
### Request Body
<Properties>
<Property name='url' type='string' key='url'>
The URL address of the remote file.
</Property>
</Properties>
### Response
After a successful upload, the server will return the file's ID and related information.
- `id` (uuid) ID
- `name` (string) File name
- `size` (int) File size (bytes)
- `extension` (string) File extension
- `mime_type` (string) File mime-type
- `created_by` (uuid) End-user ID
- `created_at` (timestamp) Creation timestamp
- `url` (string) The signed access URL of the file
### Errors
- 400, `remote_file_upload_error`, Remote file upload failed, including the following cases:
- Request timeout
- Network error
- Empty file content
- File processing failure
- 400, `file_too_large`, The file is too large
- 400, `unsupported_file_type`, Unsupported extension
- 503, `s3_connection_failed`, Unable to connect to S3 service
- 503, `s3_permission_denied`, No permission to upload files to S3
- 503, `s3_file_too_large`, File exceeds S3 size limit
</Col>
<Col sticky>
<CodeGroup title="Request" tag="POST" label="/remote-files/upload" targetCode={`curl -X POST '${props.appDetail.api_base_url}/remote-files/upload' \\\n--header 'Authorization: Bearer {api_key}' \\\n--form 'url=https://example.com/image.jpg'`}>
```bash {{ title: 'cURL' }}
curl -X POST '${props.appDetail.api_base_url}/remote-files/upload' \
--header 'Authorization: Bearer {api_key}' \
--form 'url=https://example.com/image.jpg'
```
</CodeGroup>
<CodeGroup title="Response">
```json {{ title: 'Response' }}
{
"id": "72fa9618-8f89-4a37-9b33-7e1178a24a67",
"name": "example.jpg",
"size": 1024,
"extension": "jpg",
"mime_type": "image/jpeg",
"created_by": "6ad1ab0a-73ff-4ac1-b9e4-cdb312f71f13",
"created_at": 1577836800,
"url": "https://example.com/signed-url"
}
```
</CodeGroup>
</Col>
</Row>
---
<Heading

@ -381,6 +381,74 @@ import { Row, Col, Properties, Property, Heading, SubProperty, Paragraph } from
</Row>
---
<Heading
url='/remote-files/upload'
method='POST'
title='リモートファイルのアップロード'
name='#remote-files-upload'
/>
<Row>
<Col>
URLを使用してリモートファイルをアップロードし、メッセージ送信時に使用することで、マルチモーダルな理解を可能にします。
<i>アップロードされたファイルは、現在のエンドユーザーのみが使用できます。</i>
### リクエストボディ
<Properties>
<Property name='url' type='string' key='url'>
リモートファイルのURLアドレス。
</Property>
</Properties>
### レスポンス
アップロードが成功すると、サーバーはファイルのIDと関連情報を返します。
- `id` (uuid) ID
- `name` (string) ファイル名
- `size` (int) ファイルサイズ(バイト)
- `extension` (string) ファイル拡張子
- `mime_type` (string) ファイルのMIMEタイプ
- `created_by` (uuid) エンドユーザーID
- `created_at` (timestamp) 作成タイムスタンプ
- `url` (string) ファイルの署名付きアクセスURL
### エラー
- 400, `remote_file_upload_error`, リモートファイルのアップロードに失敗しました。以下の場合が含まれます:
- リクエストタイムアウト
- ネットワークエラー
- 空のファイル内容
- ファイル処理の失敗
- 400, `file_too_large`, ファイルが大きすぎます
- 400, `unsupported_file_type`, サポートされていない拡張子です
- 503, `s3_connection_failed`, S3サービスに接続できません
- 503, `s3_permission_denied`, S3へのファイルアップロード権限がありません
- 503, `s3_file_too_large`, ファイルがS3のサイズ制限を超えています
</Col>
<Col sticky>
<CodeGroup title="Request" tag="POST" label="/remote-files/upload" targetCode={`curl -X POST '${props.appDetail.api_base_url}/remote-files/upload' \\\n--header 'Authorization: Bearer {api_key}' \\\n--form 'url=https://example.com/image.jpg'`}>
```bash {{ title: 'cURL' }}
curl -X POST '${props.appDetail.api_base_url}/remote-files/upload' \
--header 'Authorization: Bearer {api_key}' \
--form 'url=https://example.com/image.jpg'
```
</CodeGroup>
<CodeGroup title="Response">
```json {{ title: 'Response' }}
{
"id": "72fa9618-8f89-4a37-9b33-7e1178a24a67",
"name": "example.jpg",
"size": 1024,
"extension": "jpg",
"mime_type": "image/jpeg",
"created_by": 123,
"created_at": 1577836800,
"url": "https://example.com/signed-url"
}
```
</CodeGroup>
</Col>
</Row>
---
<Heading
url='/chat-messages/:task_id/stop'
method='POST'

@ -387,6 +387,75 @@ import { Row, Col, Properties, Property, Heading, SubProperty } from '../md.tsx'
</CodeGroup>
</Col>
</Row>
---
<Heading
url='/remote-files/upload'
method='POST'
title='上传远程文件'
name='#remote-files-upload'
/>
<Row>
<Col>
通过 URL 上传远程文件,用于发送消息时使用,可实现多模态理解。
<i>上传的文件仅供当前终端用户使用。</i>
### Request Body
<Properties>
<Property name='url' type='string' key='url'>
远程文件的 URL 地址。
</Property>
</Properties>
### Response
成功上传后,服务器会返回文件的 ID 和相关信息。
- `id` (uuid) ID
- `name` (string) 文件名
- `size` (int) 文件大小byte
- `extension` (string) 文件后缀
- `mime_type` (string) 文件 mime-type
- `created_by` (uuid) 上传人 ID
- `created_at` (timestamp) 上传时间
- `url` (string) 文件的签名访问 URL
### Errors
- 400, `remote_file_upload_error`, 远程文件上传失败,包括以下情况:
- 请求超时
- 网络错误
- 空文件内容
- 文件处理失败
- 400, `file_too_large`, 文件太大
- 400, `unsupported_file_type`, 不支持的扩展名
- 503, `s3_connection_failed`, 无法连接到 S3 服务
- 503, `s3_permission_denied`, 无权限上传文件到 S3
- 503, `s3_file_too_large`, 文件超出 S3 大小限制
</Col>
<Col sticky>
<CodeGroup title="Request" tag="POST" label="/remote-files/upload" targetCode={`curl -X POST '${props.appDetail.api_base_url}/remote-files/upload' \\\n--header 'Authorization: Bearer {api_key}' \\\n--form 'url=https://example.com/image.jpg'`}>
```bash {{ title: 'cURL' }}
curl -X POST '${props.appDetail.api_base_url}/remote-files/upload' \
--header 'Authorization: Bearer {api_key}' \
--form 'url=https://example.com/image.jpg'
```
</CodeGroup>
<CodeGroup title="Response">
```json {{ title: 'Response' }}
{
"id": "72fa9618-8f89-4a37-9b33-7e1178a24a67",
"name": "example.jpg",
"size": 1024,
"extension": "jpg",
"mime_type": "image/jpeg",
"created_by": 123,
"created_at": 1577836800,
"url": "https://example.com/signed-url"
}
```
</CodeGroup>
</Col>
</Row>
---
<Heading
url='/chat-messages/:task_id/stop'

@ -342,6 +342,77 @@ Chat applications support session persistence, allowing previous chat history to
</CodeGroup>
</Col>
</Row>
---
<Heading
url='/remote-files/upload'
method='POST'
title='Upload Remote File'
name='#remote-files-upload'
/>
<Row>
<Col>
Upload a remote file via URL for use when sending messages, enabling multimodal understanding.
<i>Uploaded files are for use by the current end-user only.</i>
### Request Body
<Properties>
<Property name='url' type='string' key='url'>
The URL address of the remote file.
</Property>
</Properties>
### Response
After a successful upload, the server will return the file's ID and related information.
- `id` (uuid) ID
- `name` (string) File name
- `size` (int) File size (bytes)
- `extension` (string) File extension
- `mime_type` (string) File mime-type
- `created_by` (uuid) End-user ID
- `created_at` (timestamp) Creation timestamp
- `url` (string) The signed access URL of the file
### Errors
- 400, `remote_file_upload_error`, Remote file upload failed, including the following cases:
- Request timeout
- Network error
- Empty file content
- File processing failure
- 400, `file_too_large`, The file is too large
- 400, `unsupported_file_type`, Unsupported extension
- 503, `s3_connection_failed`, Unable to connect to S3 service
- 503, `s3_permission_denied`, No permission to upload files to S3
- 503, `s3_file_too_large`, File exceeds S3 size limit
</Col>
<Col sticky>
<CodeGroup title="Request" tag="POST" label="/remote-files/upload" targetCode={`curl -X POST '${props.appDetail.api_base_url}/remote-files/upload' \\\n--header 'Authorization: Bearer {api_key}' \\\n--form 'url=https://example.com/image.jpg'`}>
```bash {{ title: 'cURL' }}
curl -X POST '${props.appDetail.api_base_url}/remote-files/upload' \
--header 'Authorization: Bearer {api_key}' \
--form 'url=https://example.com/image.jpg'
```
</CodeGroup>
<CodeGroup title="Response">
```json {{ title: 'Response' }}
{
"id": "72fa9618-8f89-4a37-9b33-7e1178a24a67",
"name": "example.jpg",
"size": 1024,
"extension": "jpg",
"mime_type": "image/jpeg",
"created_by": 123,
"created_at": 1577836800,
"url": "https://example.com/signed-url"
}
```
</CodeGroup>
</Col>
</Row>
---
<Heading

@ -344,6 +344,75 @@ import { Row, Col, Properties, Property, Heading, SubProperty, Paragraph } from
</Row>
---
<Heading
url='/remote-files/upload'
method='POST'
title='リモートファイルのアップロード'
name='#remote-files-upload'
/>
<Row>
<Col>
URLを使用してリモートファイルをアップロードし、メッセージ送信時に使用することで、マルチモーダルな理解を可能にします。
<i>アップロードされたファイルは、現在のエンドユーザーのみが使用できます。</i>
### リクエストボディ
<Properties>
<Property name='url' type='string' key='url'>
リモートファイルのURLアドレス。
</Property>
</Properties>
### レスポンス
アップロードが成功すると、サーバーはファイルのIDと関連情報を返します。
- `id` (uuid) ID
- `name` (string) ファイル名
- `size` (int) ファイルサイズ(バイト)
- `extension` (string) ファイル拡張子
- `mime_type` (string) ファイルのMIMEタイプ
- `created_by` (uuid) エンドユーザーID
- `created_at` (timestamp) 作成タイムスタンプ
- `url` (string) ファイルの署名付きアクセスURL
### エラー
- 400, `remote_file_upload_error`, リモートファイルのアップロードに失敗しました。以下の場合が含まれます:
- リクエストタイムアウト
- ネットワークエラー
- 空のファイル内容
- ファイル処理の失敗
- 400, `file_too_large`, ファイルが大きすぎます
- 400, `unsupported_file_type`, サポートされていない拡張子です
- 503, `s3_connection_failed`, S3サービスに接続できません
- 503, `s3_permission_denied`, S3へのファイルアップロード権限がありません
- 503, `s3_file_too_large`, ファイルがS3のサイズ制限を超えています
</Col>
<Col sticky>
<CodeGroup title="Request" tag="POST" label="/remote-files/upload" targetCode={`curl -X POST '${props.appDetail.api_base_url}/remote-files/upload' \\\n--header 'Authorization: Bearer {api_key}' \\\n--form 'url=https://example.com/image.jpg'`}>
```bash {{ title: 'cURL' }}
curl -X POST '${props.appDetail.api_base_url}/remote-files/upload' \
--header 'Authorization: Bearer {api_key}' \
--form 'url=https://example.com/image.jpg'
```
</CodeGroup>
<CodeGroup title="Response">
```json {{ title: 'Response' }}
{
"id": "72fa9618-8f89-4a37-9b33-7e1178a24a67",
"name": "example.jpg",
"size": 1024,
"extension": "jpg",
"mime_type": "image/jpeg",
"created_by": 123,
"created_at": 1577836800,
"url": "https://example.com/signed-url"
}
```
</CodeGroup>
</Col>
</Row>
---
<Heading
url='/chat-messages/:task_id/stop'
method='POST'
@ -1168,3 +1237,4 @@ import { Row, Col, Properties, Property, Heading, SubProperty, Paragraph } from
</CodeGroup>
</Col>
</Row>

@ -358,6 +358,75 @@ import { Row, Col, Properties, Property, Heading, SubProperty } from '../md.tsx'
</CodeGroup>
</Col>
</Row>
---
<Heading
url='/remote-files/upload'
method='POST'
title='上传远程文件'
name='#remote-files-upload'
/>
<Row>
<Col>
通过 URL 上传远程文件,用于发送消息时使用,可实现多模态理解。
<i>上传的文件仅供当前终端用户使用。</i>
### Request Body
<Properties>
<Property name='url' type='string' key='url'>
远程文件的 URL 地址。
</Property>
</Properties>
### Response
成功上传后,服务器会返回文件的 ID 和相关信息。
- `id` (uuid) ID
- `name` (string) 文件名
- `size` (int) 文件大小byte
- `extension` (string) 文件后缀
- `mime_type` (string) 文件 mime-type
- `created_by` (uuid) 上传人 ID
- `created_at` (timestamp) 上传时间
- `url` (string) 文件的签名访问 URL
### Errors
- 400, `remote_file_upload_error`, 远程文件上传失败,包括以下情况:
- 请求超时
- 网络错误
- 空文件内容
- 文件处理失败
- 400, `file_too_large`, 文件太大
- 400, `unsupported_file_type`, 不支持的扩展名
- 503, `s3_connection_failed`, 无法连接到 S3 服务
- 503, `s3_permission_denied`, 无权限上传文件到 S3
- 503, `s3_file_too_large`, 文件超出 S3 大小限制
</Col>
<Col sticky>
<CodeGroup title="Request" tag="POST" label="/remote-files/upload" targetCode={`curl -X POST '${props.appDetail.api_base_url}/remote-files/upload' \\\n--header 'Authorization: Bearer {api_key}' \\\n--form 'url=https://example.com/image.jpg'`}>
```bash {{ title: 'cURL' }}
curl -X POST '${props.appDetail.api_base_url}/remote-files/upload' \
--header 'Authorization: Bearer {api_key}' \
--form 'url=https://example.com/image.jpg'
```
</CodeGroup>
<CodeGroup title="Response">
```json {{ title: 'Response' }}
{
"id": "72fa9618-8f89-4a37-9b33-7e1178a24a67",
"name": "example.jpg",
"size": 1024,
"extension": "jpg",
"mime_type": "image/jpeg",
"created_by": 123,
"created_at": 1577836800,
"url": "https://example.com/signed-url"
}
```
</CodeGroup>
</Col>
</Row>
---
<Heading
url='/chat-messages/:task_id/stop'

@ -499,6 +499,75 @@ Workflow applications offers non-session support and is ideal for translation, a
---
<Heading
url='/remote-files/upload'
method='POST'
title='Upload Remote File'
name='#remote-files-upload'
/>
<Row>
<Col>
Upload a remote file via URL for use when sending messages, enabling multimodal understanding.
<i>Uploaded files are for use by the current end-user only.</i>
### Request Body
<Properties>
<Property name='url' type='string' key='url'>
The URL address of the remote file.
</Property>
</Properties>
### Response
After a successful upload, the server will return the file's ID and related information.
- `id` (uuid) ID
- `name` (string) File name
- `size` (int) File size (bytes)
- `extension` (string) File extension
- `mime_type` (string) File mime-type
- `created_by` (uuid) End-user ID
- `created_at` (timestamp) Creation timestamp
- `url` (string) The signed access URL of the file
### Errors
- 400, `remote_file_upload_error`, Remote file upload failed, including the following cases:
- Request timeout
- Network error
- Empty file content
- File processing failure
- 400, `file_too_large`, The file is too large
- 400, `unsupported_file_type`, Unsupported extension
- 503, `s3_connection_failed`, Unable to connect to S3 service
- 503, `s3_permission_denied`, No permission to upload files to S3
- 503, `s3_file_too_large`, File exceeds S3 size limit
</Col>
<Col sticky>
<CodeGroup title="Request" tag="POST" label="/remote-files/upload" targetCode={`curl -X POST '${props.appDetail.api_base_url}/remote-files/upload' \\\n--header 'Authorization: Bearer {api_key}' \\\n--form 'url=https://example.com/image.jpg'`}>
```bash {{ title: 'cURL' }}
curl -X POST '${props.appDetail.api_base_url}/remote-files/upload' \
--header 'Authorization: Bearer {api_key}' \
--form 'url=https://example.com/image.jpg'
```
</CodeGroup>
<CodeGroup title="Response">
```json {{ title: 'Response' }}
{
"id": "72fa9618-8f89-4a37-9b33-7e1178a24a67",
"name": "example.jpg",
"size": 1024,
"extension": "jpg",
"mime_type": "image/jpeg",
"created_by": 123,
"created_at": 1577836800,
"url": "https://example.com/signed-url"
}
```
</CodeGroup>
</Col>
</Row>
---
<Heading
url='/workflows/logs'
method='GET'

@ -502,6 +502,75 @@ import { Row, Col, Properties, Property, Heading, SubProperty, Paragraph } from
---
<Heading
url='/remote-files/upload'
method='POST'
title='リモートファイルのアップロード'
name='#remote-files-upload'
/>
<Row>
<Col>
URLを使用してリモートファイルをアップロードし、メッセージ送信時に使用することで、マルチモーダルな理解を可能にします。
<i>アップロードされたファイルは、現在のエンドユーザーのみが使用できます。</i>
### リクエストボディ
<Properties>
<Property name='url' type='string' key='url'>
リモートファイルのURLアドレス。
</Property>
</Properties>
### レスポンス
アップロードが成功すると、サーバーはファイルのIDと関連情報を返します。
- `id` (uuid) ID
- `name` (string) ファイル名
- `size` (int) ファイルサイズ(バイト)
- `extension` (string) ファイル拡張子
- `mime_type` (string) ファイルのMIMEタイプ
- `created_by` (uuid) エンドユーザーID
- `created_at` (timestamp) 作成タイムスタンプ
- `url` (string) ファイルの署名付きアクセスURL
### エラー
- 400, `remote_file_upload_error`, リモートファイルのアップロードに失敗しました。以下の場合が含まれます:
- リクエストタイムアウト
- ネットワークエラー
- 空のファイル内容
- ファイル処理の失敗
- 400, `file_too_large`, ファイルが大きすぎます
- 400, `unsupported_file_type`, サポートされていない拡張子です
- 503, `s3_connection_failed`, S3サービスに接続できません
- 503, `s3_permission_denied`, S3へのファイルアップロード権限がありません
- 503, `s3_file_too_large`, ファイルがS3のサイズ制限を超えています
</Col>
<Col sticky>
<CodeGroup title="Request" tag="POST" label="/remote-files/upload" targetCode={`curl -X POST '${props.appDetail.api_base_url}/remote-files/upload' \\\n--header 'Authorization: Bearer {api_key}' \\\n--form 'url=https://example.com/image.jpg'`}>
```bash {{ title: 'cURL' }}
curl -X POST '${props.appDetail.api_base_url}/remote-files/upload' \
--header 'Authorization: Bearer {api_key}' \
--form 'url=https://example.com/image.jpg'
```
</CodeGroup>
<CodeGroup title="Response">
```json {{ title: 'Response' }}
{
"id": "72fa9618-8f89-4a37-9b33-7e1178a24a67",
"name": "example.jpg",
"size": 1024,
"extension": "jpg",
"mime_type": "image/jpeg",
"created_by": 123,
"created_at": 1577836800,
"url": "https://example.com/signed-url"
}
```
</CodeGroup>
</Col>
</Row>
---
<Heading
url='/workflows/logs'
method='GET'
@ -605,6 +674,7 @@ import { Row, Col, Properties, Property, Heading, SubProperty, Paragraph } from
</CodeGroup>
</Col>
</Row>
---
<Heading

@ -488,6 +488,76 @@ Workflow 应用无会话支持,适合用于翻译/文章写作/总结 AI 等
</CodeGroup>
</Col>
</Row>
---
<Heading
url='/remote-files/upload'
method='POST'
title='上传远程文件'
name='#remote-files-upload'
/>
<Row>
<Col>
通过 URL 上传远程文件,用于发送消息时使用,可实现多模态理解。
<i>上传的文件仅供当前终端用户使用。</i>
### Request Body
<Properties>
<Property name='url' type='string' key='url'>
远程文件的 URL 地址。
</Property>
</Properties>
### Response
成功上传后,服务器会返回文件的 ID 和相关信息。
- `id` (uuid) ID
- `name` (string) 文件名
- `size` (int) 文件大小byte
- `extension` (string) 文件后缀
- `mime_type` (string) 文件 mime-type
- `created_by` (uuid) 上传人 ID
- `created_at` (timestamp) 上传时间
- `url` (string) 文件的签名访问 URL
### Errors
- 400, `remote_file_upload_error`, 远程文件上传失败,包括以下情况:
- 请求超时
- 网络错误
- 空文件内容
- 文件处理失败
- 400, `file_too_large`, 文件太大
- 400, `unsupported_file_type`, 不支持的扩展名
- 503, `s3_connection_failed`, 无法连接到 S3 服务
- 503, `s3_permission_denied`, 无权限上传文件到 S3
- 503, `s3_file_too_large`, 文件超出 S3 大小限制
</Col>
<Col sticky>
<CodeGroup title="Request" tag="POST" label="/remote-files/upload" targetCode={`curl -X POST '${props.appDetail.api_base_url}/remote-files/upload' \\\n--header 'Authorization: Bearer {api_key}' \\\n--form 'url=https://example.com/image.jpg'`}>
```bash {{ title: 'cURL' }}
curl -X POST '${props.appDetail.api_base_url}/remote-files/upload' \
--header 'Authorization: Bearer {api_key}' \
--form 'url=https://example.com/image.jpg'
```
</CodeGroup>
<CodeGroup title="Response">
```json {{ title: 'Response' }}
{
"id": "72fa9618-8f89-4a37-9b33-7e1178a24a67",
"name": "example.jpg",
"size": 1024,
"extension": "jpg",
"mime_type": "image/jpeg",
"created_by": 123,
"created_at": 1577836800,
"url": "https://example.com/signed-url"
}
```
</CodeGroup>
</Col>
</Row>
---
<Heading
@ -593,6 +663,7 @@ Workflow 应用无会话支持,适合用于翻译/文章写作/总结 AI 等
</CodeGroup>
</Col>
</Row>
---
<Heading

Loading…
Cancel
Save