Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
dify
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ai-tech
dify
Commits
aa6254a3
Commit
aa6254a3
authored
Mar 13, 2024
by
JzoNg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add doc for workflow app
parent
0b05d293
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
163 additions
and
311 deletions
+163
-311
template_workflow.en.mdx
web/app/components/develop/template/template_workflow.en.mdx
+2
-75
template_workflow.zh.mdx
web/app/components/develop/template/template_workflow.zh.mdx
+161
-236
No files found.
web/app/components/develop/template/template_workflow.en.mdx
View file @
aa6254a3
...
@@ -75,7 +75,7 @@ Workflow applications offers non-session support and is ideal for translation, a
...
@@ -75,7 +75,7 @@ Workflow applications offers non-session support and is ideal for translation, a
- `error` (string) Optional reason of error
- `error` (string) Optional reason of error
- `elapsed_time` (float) Optional total seconds to be used
- `elapsed_time` (float) Optional total seconds to be used
- `total_tokens` (int) Optional tokens to be used
- `total_tokens` (int) Optional tokens to be used
- `total_steps` (int) def
ua
lt 0
- `total_steps` (int) def
au
lt 0
- `created_at` (timestamp) start time
- `created_at` (timestamp) start time
- `finished_at` (timestamp) end time
- `finished_at` (timestamp) end time
...
@@ -140,7 +140,7 @@ Workflow applications offers non-session support and is ideal for translation, a
...
@@ -140,7 +140,7 @@ Workflow applications offers non-session support and is ideal for translation, a
- `error` (string) Optional reason of error
- `error` (string) Optional reason of error
- `elapsed_time` (float) Optional total seconds to be used
- `elapsed_time` (float) Optional total seconds to be used
- `total_tokens` (int) Optional tokens to be used
- `total_tokens` (int) Optional tokens to be used
- `total_steps` (int) def
ua
lt 0
- `total_steps` (int) def
au
lt 0
- `created_at` (timestamp) start time
- `created_at` (timestamp) start time
- `finished_at` (timestamp) end time
- `finished_at` (timestamp) end time
- `event: text_chunk` Output text in chunks
- `event: text_chunk` Output text in chunks
...
@@ -219,79 +219,6 @@ Workflow applications offers non-session support and is ideal for translation, a
...
@@ -219,79 +219,6 @@ Workflow applications offers non-session support and is ideal for translation, a
</Col>
</Col>
</Row>
</Row>
---
<Heading
url='/files/upload'
method='POST'
title='File Upload'
name='#file-upload'
/>
<Row>
<Col>
Upload a file (currently only images are supported) for use when sending messages, enabling multimodal understanding of images and text.
Supports png, jpg, jpeg, webp, gif formats.
Uploaded files are for use by the current end-user only.
### Request Body
This interface requires a `multipart/form-data` request.
- `file` (File) Required
The file to be uploaded.
- `user` (string) Required
User identifier, defined by the developer's rules, must be unique within the application.
### 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, e.g., 1705395332
### Errors
- 400, `no_file_uploaded`, a file must be provided
- 400, `too_many_files`, currently only one file is accepted
- 400, `unsupported_preview`, the file does not support preview
- 400, `unsupported_estimate`, the file does not support estimation
- 413, `file_too_large`, the file is too large
- 415, `unsupported_file_type`, unsupported extension, currently only document files are accepted
- 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
- 500, internal server error
</Col>
<Col sticky>
### Request Example
<CodeGroup title="Request" tag="POST" label="/files/upload" targetCode={`curl -X POST '${props.appDetail.api_base_url}/files/upload' \\\n--header 'Authorization: Bearer {api_key}' \\\n--form 'file=@localfile;type=image/[png|jpeg|jpg|webp|gif] \\\n--form 'user=abc-123'`}>
```bash {{ title: 'cURL' }}
curl -X POST '${props.appDetail.api_base_url}/files/upload' \
--header 'Authorization: Bearer {api_key}' \
--form 'file=@"/path/to/file"'
```
</CodeGroup>
### Response Example
<CodeGroup title="Response">
```json {{ title: 'Response' }}
{
"id": "72fa9618-8f89-4a37-9b33-7e1178a24a67",
"name": "example.png",
"size": 1024,
"extension": "png",
"mime_type": "image/png",
"created_by": "6ad1ab0a-73ff-4ac1-b9e4-cdb312f71f13",
"created_at": 1577836800,
}
```
</CodeGroup>
</Col>
</Row>
---
---
<Heading
<Heading
...
...
web/app/components/develop/template/template_workflow.zh.mdx
View file @
aa6254a3
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment