From a430284aa21e3ae1f0d5654e55b2ad2852519cc2 Mon Sep 17 00:00:00 2001 From: wwf <yearningwang@iqtogether.com> Date: 星期三, 04 六月 2025 15:17:49 +0800 Subject: [PATCH] 初始化 --- app/components/develop/template/template_workflow.zh.mdx | 113 ++++++++++++-------------------------------------------- 1 files changed, 25 insertions(+), 88 deletions(-) diff --git a/app/components/develop/template/template_workflow.zh.mdx b/app/components/develop/template/template_workflow.zh.mdx index e78b309..40dfb86 100644 --- a/app/components/develop/template/template_workflow.zh.mdx +++ b/app/components/develop/template/template_workflow.zh.mdx @@ -41,17 +41,8 @@ ### Request Body - `inputs` (object) Required 鍏佽浼犲叆 App 瀹氫箟鐨勫悇鍙橀噺鍊笺�� - inputs 鍙傛暟鍖呭惈浜嗗缁勯敭鍊煎锛圞ey/Value pairs锛夛紝姣忕粍鐨勯敭瀵瑰簲涓�涓壒瀹氬彉閲忥紝姣忕粍鐨勫�煎垯鏄鍙橀噺鐨勫叿浣撳�笺�傚彉閲忓彲浠ユ槸鏂囦欢鍒楄〃绫诲瀷銆� - 鏂囦欢鍒楄〃绫诲瀷鍙橀噺閫傜敤浜庝紶鍏ユ枃浠剁粨鍚堟枃鏈悊瑙e苟鍥炵瓟闂锛屼粎褰撴ā鍨嬫敮鎸佽绫诲瀷鏂囦欢瑙f瀽鑳藉姏鏃跺彲鐢ㄣ�傚鏋滆鍙橀噺鏄枃浠跺垪琛ㄧ被鍨嬶紝璇ュ彉閲忓搴旂殑鍊煎簲鏄垪琛ㄦ牸寮忥紝鍏朵腑姣忎釜鍏冪礌搴斿寘鍚互涓嬪唴瀹癸細 - - `type` (string) 鏀寔绫诲瀷锛� - - `document` 鍏蜂綋绫诲瀷鍖呭惈锛�'TXT', 'MD', 'MARKDOWN', 'PDF', 'HTML', 'XLSX', 'XLS', 'DOCX', 'CSV', 'EML', 'MSG', 'PPTX', 'PPT', 'XML', 'EPUB' - - `image` 鍏蜂綋绫诲瀷鍖呭惈锛�'JPG', 'JPEG', 'PNG', 'GIF', 'WEBP', 'SVG' - - `audio` 鍏蜂綋绫诲瀷鍖呭惈锛�'MP3', 'M4A', 'WAV', 'WEBM', 'AMR' - - `video` 鍏蜂綋绫诲瀷鍖呭惈锛�'MP4', 'MOV', 'MPEG', 'MPGA' - - `custom` 鍏蜂綋绫诲瀷鍖呭惈锛氬叾浠栨枃浠剁被鍨� - - `transfer_method` (string) 浼犻�掓柟寮忥紝`remote_url` 鍥剧墖鍦板潃 / `local_file` 涓婁紶鏂囦欢 - - `url` (string) 鍥剧墖鍦板潃锛堜粎褰撲紶閫掓柟寮忎负 `remote_url` 鏃讹級 - - `upload_file_id` (string) 涓婁紶鏂囦欢 ID锛堜粎褰撲紶閫掓柟寮忎负 `local_file` 鏃讹級 + inputs 鍙傛暟鍖呭惈浜嗗缁勯敭鍊煎锛圞ey/Value pairs锛夛紝姣忕粍鐨勯敭瀵瑰簲涓�涓壒瀹氬彉閲忥紝姣忕粍鐨勫�煎垯鏄鍙橀噺鐨勫叿浣撳�笺�� + 濡傛灉鍙橀噺鏄枃浠剁被鍨嬶紝璇锋寚瀹氫竴涓寘鍚互涓� `files` 涓墍杩伴敭鐨勫璞°�� - `response_mode` (string) Required 杩斿洖鍝嶅簲妯″紡锛屾敮鎸侊細 - `streaming` 娴佸紡妯″紡锛堟帹鑽愶級銆傚熀浜� SSE锛�**[Server-Sent Events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events)**锛夊疄鐜扮被浼兼墦瀛楁満杈撳嚭鏂瑰紡鐨勬祦寮忚繑鍥炪�� @@ -60,7 +51,17 @@ - `user` (string) Required 鐢ㄦ埛鏍囪瘑锛岀敤浜庡畾涔夌粓绔敤鎴风殑韬唤锛屾柟渚挎绱€�佺粺璁°�� 鐢卞紑鍙戣�呭畾涔夎鍒欙紝闇�淇濊瘉鐢ㄦ埛鏍囪瘑鍦ㄥ簲鐢ㄥ唴鍞竴銆� - + - `files` (array[object]) Optional + 鏂囦欢鍒楄〃锛岄�傜敤浜庝紶鍏ユ枃浠剁粨鍚堟枃鏈悊瑙e苟鍥炵瓟闂锛屼粎褰撴ā鍨嬫敮鎸佽绫诲瀷鏂囦欢瑙f瀽鑳藉姏鏃跺彲鐢ㄣ�� + - `type` (string) 鏀寔绫诲瀷锛� + - `document` 鍏蜂綋绫诲瀷鍖呭惈锛�'TXT', 'MD', 'MARKDOWN', 'PDF', 'HTML', 'XLSX', 'XLS', 'DOCX', 'CSV', 'EML', 'MSG', 'PPTX', 'PPT', 'XML', 'EPUB' + - `image` 鍏蜂綋绫诲瀷鍖呭惈锛�'JPG', 'JPEG', 'PNG', 'GIF', 'WEBP', 'SVG' + - `audio` 鍏蜂綋绫诲瀷鍖呭惈锛�'MP3', 'M4A', 'WAV', 'WEBM', 'AMR' + - `video` 鍏蜂綋绫诲瀷鍖呭惈锛�'MP4', 'MOV', 'MPEG', 'MPGA' + - `custom` 鍏蜂綋绫诲瀷鍖呭惈锛氬叾浠栨枃浠剁被鍨� + - `transfer_method` (string) 浼犻�掓柟寮忥紝`remote_url` 鍥剧墖鍦板潃 / `local_file` 涓婁紶鏂囦欢 + - `url` (string) 鍥剧墖鍦板潃锛堜粎褰撲紶閫掓柟寮忎负 `remote_url` 鏃讹級 + - `upload_file_id` (string) (string) 涓婁紶鏂囦欢 ID锛堜粎褰撲紶閫掓柟寮忎负 `local_file` 鏃讹級 ### Response 褰� `response_mode` 涓� `blocking` 鏃讹紝杩斿洖 CompletionResponse object銆� @@ -87,7 +88,7 @@ 姣忎釜娴佸紡鍧楀潎涓� data: 寮�澶达紝鍧椾箣闂翠互 `\n\n` 鍗充袱涓崲琛岀鍒嗛殧锛屽涓嬫墍绀猴細 <CodeGroup> ```streaming {{ title: 'Response' }} - data: {"event": "text_chunk", "workflow_run_id": "b85e5fc5-751b-454d-b14e-dc5f240b0a31", "task_id": "bd029338-b068-4d34-a331-fc85478922c2", "data": {"text": "\u4e3a\u4e86", "from_variable_selector": ["1745912968134", "text"]}}\n\n + data: {"event": "message", "task_id": "900bbd43-dc0b-4383-a372-aa6e6c414227", "id": "663c5084-a254-4040-8ad3-51f2a3c1a77c", "answer": "Hi", "created_at": 1705398420}\n\n ``` </CodeGroup> 娴佸紡鍧椾腑鏍规嵁 `event` 涓嶅悓锛岀粨鏋勪篃涓嶅悓锛屽寘鍚互涓嬬被鍨嬶細 @@ -113,13 +114,6 @@ - `predecessor_node_id` (string) 鍓嶇疆鑺傜偣 ID锛岀敤浜庣敾甯冨睍绀烘墽琛岃矾寰� - `inputs` (object) 鑺傜偣涓墍鏈変娇鐢ㄥ埌鐨勫墠缃妭鐐瑰彉閲忓唴瀹� - `created_at` (timestamp) 寮�濮嬫椂闂� - - `event: text_chunk` 鏂囨湰鐗囨 - - `task_id` (string) 浠诲姟 ID锛岀敤浜庤姹傝窡韪拰涓嬫柟鐨勫仠姝㈠搷搴旀帴鍙� - - `workflow_run_id` (string) workflow 鎵ц ID - - `event` (string) 鍥哄畾涓� `text_chunk` - - `data` (object) 璇︾粏鍐呭 - - `text` (string) 鏂囨湰鍐呭 - - `from_variable_selector` (array) 鏂囨湰鏉ユ簮璺緞锛屽府鍔╁紑鍙戣�呬簡瑙f枃鏈槸鐢卞摢涓妭鐐圭殑鍝釜鍙橀噺鐢熸垚鐨� - `event: node_finished` node 鎵ц缁撴潫锛屾垚鍔熷け璐ュ悓涓�浜嬩欢涓笉鍚岀姸鎬� - `task_id` (string) 浠诲姟 ID锛岀敤浜庤姹傝窡韪拰涓嬫柟鐨勫仠姝㈠搷搴旀帴鍙� - `workflow_run_id` (string) workflow 鎵ц ID @@ -190,18 +184,15 @@ }' ``` </CodeGroup> - <CodeGroup title="Example: file array as an input variable"> + <CodeGroup title="File variable example"> ```json {{ title: 'File variable example' }} { "inputs": { - "{variable_name}": - [ - { + "{variable_name}": { "transfer_method": "local_file", "upload_file_id": "{upload_file_id}", "type": "{document_type}" - } - ] + } } } ``` @@ -282,11 +273,11 @@ data = { "inputs": { - "orig_mail": [{ + "orig_mail": { "transfer_method": "local_file", "upload_file_id": file_id, "type": "document" - }] + } }, "response_mode": response_mode, "user": user @@ -325,7 +316,7 @@ --- <Heading - url='/workflows/run/:workflow_run_id' + url='/workflows/run/:workflow_id' method='GET' title='鑾峰彇workflow鎵ц鎯呭喌' name='#get-workflow-run-detail' @@ -334,7 +325,7 @@ <Col> 鏍规嵁 workflow 鎵ц ID 鑾峰彇 workflow 浠诲姟褰撳墠鎵ц缁撴灉 ### Path - - `workflow_run_id` (string) workflow_run_id锛屽彲鍦ㄦ祦寮忚繑鍥� Chunk 涓幏鍙� + - `workflow_id` (string) workflow 鎵ц ID锛屽彲鍦ㄦ祦寮忚繑鍥� Chunk 涓幏鍙� ### Response - `id` (string) workflow 鎵ц ID - `workflow_id` (string) 鍏宠仈鐨� Workflow ID @@ -350,9 +341,9 @@ </Col> <Col sticky> ### Request Example - <CodeGroup title="Request" tag="GET" label="/workflows/run/:workflow_run_id" targetCode={`curl -X GET '${props.appDetail.api_base_url}/workflows/run/:workflow_run_id' \\\n-H 'Authorization: Bearer {api_key}' \\\n-H 'Content-Type: application/json'`}> + <CodeGroup title="Request" tag="GET" label="/workflows/run/:workflow_id" targetCode={`curl -X GET '${props.appDetail.api_base_url}/workflows/run/:workflow_id' \\\n-H 'Authorization: Bearer {api_key}' \\\n-H 'Content-Type: application/json'`}> ```bash {{ title: 'cURL' }} - curl -X GET '${props.appDetail.api_base_url}/workflows/run/:workflow_run_id' \ + curl -X GET '${props.appDetail.api_base_url}/workflows/run/:workflow_id' \ -H 'Authorization: Bearer {api_key}' \ -H 'Content-Type: application/json' ``` @@ -370,8 +361,8 @@ "error": null, "total_steps": 3, "total_tokens": 0, - "created_at": 1705407629, - "finished_at": 1727807631, + "created_at": "Thu, 18 Jul 2024 03:17:40 -0000", + "finished_at": "Thu, 18 Jul 2024 03:18:10 -0000", "elapsed_time": 30.098514399956912 } ``` @@ -727,57 +718,3 @@ </CodeGroup> </Col> </Row> - ---- - -<Heading - url='/site' - method='GET' - title='鑾峰彇搴旂敤 WebApp 璁剧疆' - name='#site' -/> -<Row> - <Col> - 鐢ㄤ簬鑾峰彇搴旂敤鐨� WebApp 璁剧疆 - ### Response - - `title` (string) WebApp 鍚嶇О - - `icon_type` (string) 鍥炬爣绫诲瀷, `emoji`-琛ㄦ儏, `image`-鍥剧墖 - - `icon` (string) 鍥炬爣, 濡傛灉鏄� `emoji` 绫诲瀷, 鍒欐槸 emoji 琛ㄦ儏绗﹀彿, 濡傛灉鏄� `image` 绫诲瀷, 鍒欐槸鍥剧墖 URL - - `icon_background` (string) hex 鏍煎紡鐨勮儗鏅壊 - - `icon_url` (string) 鍥炬爣 URL - - `description` (string) 鎻忚堪 - - `copyright` (string) 鐗堟潈淇℃伅 - - `privacy_policy` (string) 闅愮鏀跨瓥閾炬帴 - - `custom_disclaimer` (string) 鑷畾涔夊厤璐e0鏄� - - `default_language` (string) 榛樿璇█ - - `show_workflow_steps` (bool) 鏄惁鏄剧ず宸ヤ綔娴佽鎯� - </Col> - <Col> - <CodeGroup title="Request" tag="POST" label="/meta" targetCode={`curl -X GET '${props.appDetail.api_base_url}/site' \\\n-H 'Authorization: Bearer {api_key}'`}> - ```bash {{ title: 'cURL' }} - curl -X GET '${props.appDetail.api_base_url}/site' \ - -H 'Authorization: Bearer {api_key}' - ``` - - </CodeGroup> - - <CodeGroup title="Response"> - ```json {{ title: 'Response' }} - { - "title": "My App", - "icon_type": "emoji", - "icon": "馃槃", - "icon_background": "#FFEAD5", - "icon_url": null, - "description": "This is my app.", - "copyright": "all rights reserved", - "privacy_policy": "", - "custom_disclaimer": "All generated by AI", - "default_language": "en-US", - "show_workflow_steps": false, - } - ``` - </CodeGroup> - </Col> -</Row> -___ -- Gitblit v1.8.0