From 4f60fe7bc68f84e636d769862b57d951a273d87e Mon Sep 17 00:00:00 2001 From: Masahiro Yamaguchi Date: Sun, 16 Jun 2024 17:45:51 -0700 Subject: [PATCH] Fixed wrong /text-to-audio curl example (#5286) --- .../components/develop/template/template.en.mdx | 15 ++++++++++----- .../components/develop/template/template.zh.mdx | 15 ++++++++++----- .../template/template_advanced_chat.en.mdx | 14 +++++++++----- .../template/template_advanced_chat.zh.mdx | 15 ++++++++++----- 4 files changed, 39 insertions(+), 20 deletions(-) mode change 100644 => 100755 web/app/components/develop/template/template.en.mdx mode change 100644 => 100755 web/app/components/develop/template/template.zh.mdx mode change 100644 => 100755 web/app/components/develop/template/template_advanced_chat.zh.mdx diff --git a/web/app/components/develop/template/template.en.mdx b/web/app/components/develop/template/template.en.mdx old mode 100644 new mode 100755 index 41e80f6c77..27ee1b4877 --- a/web/app/components/develop/template/template.en.mdx +++ b/web/app/components/develop/template/template.en.mdx @@ -515,14 +515,19 @@ The text generation application offers non-session support and is ideal for tran - + ```bash {{ title: 'cURL' }} - curl --location --request POST '${props.appDetail.api_base_url}/text-to-audio' \ - --header 'Authorization: Bearer ENTER-YOUR-SECRET-KEY' \ - --form 'file=Hello Dify;user=abc-123;streaming=false' + curl -o text-to-audio.mp3 -X POST '${props.appDetail.api_base_url}/text-to-audio' \ + --header 'Authorization: Bearer {api_key}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "text": "Hello Dify", + "user": "abc-123", + "streaming": false + }' ``` - + diff --git a/web/app/components/develop/template/template.zh.mdx b/web/app/components/develop/template/template.zh.mdx old mode 100644 new mode 100755 index 1d0d6a2988..f89df5b326 --- a/web/app/components/develop/template/template.zh.mdx +++ b/web/app/components/develop/template/template.zh.mdx @@ -476,14 +476,19 @@ import { Row, Col, Properties, Property, Heading, SubProperty } from '../md.tsx' - + ```bash {{ title: 'cURL' }} - curl --location --request POST '${props.appDetail.api_base_url}/text-to-audio' \ - --header 'Authorization: Bearer ENTER-YOUR-SECRET-KEY' \ - --form 'file=你好Dify;user=abc-123;streaming=false' + curl -o text-to-audio.mp3 -X POST '${props.appDetail.api_base_url}/text-to-audio' \ + --header 'Authorization: Bearer {api_key}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "text": "你好Dify", + "user": "abc-123", + "streaming": false + }' ``` - + diff --git a/web/app/components/develop/template/template_advanced_chat.en.mdx b/web/app/components/develop/template/template_advanced_chat.en.mdx index 006134e45e..e5b0785129 100644 --- a/web/app/components/develop/template/template_advanced_chat.en.mdx +++ b/web/app/components/develop/template/template_advanced_chat.en.mdx @@ -880,14 +880,18 @@ Chat applications support session persistence, allowing previous chat history to - + ```bash {{ title: 'cURL' }} - curl --location --request POST '${props.appDetail.api_base_url}/text-to-audio' \ - --header 'Authorization: Bearer ENTER-YOUR-SECRET-KEY' \ - --form 'file=Hello Dify;user=abc-123;streaming=false' + curl -o text-to-audio.mp3 -X POST '${props.appDetail.api_base_url}/text-to-audio' \ + --header 'Authorization: Bearer {api_key}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "text": "Hello Dify", + "user": "abc-123", + "streaming": false + }' ``` - diff --git a/web/app/components/develop/template/template_advanced_chat.zh.mdx b/web/app/components/develop/template/template_advanced_chat.zh.mdx old mode 100644 new mode 100755 index 4c57f2abaa..59a87652b6 --- a/web/app/components/develop/template/template_advanced_chat.zh.mdx +++ b/web/app/components/develop/template/template_advanced_chat.zh.mdx @@ -911,14 +911,19 @@ import { Row, Col, Properties, Property, Heading, SubProperty } from '../md.tsx' - + ```bash {{ title: 'cURL' }} - curl --location --request POST '${props.appDetail.api_base_url}/text-to-audio' \ - --header 'Authorization: Bearer ENTER-YOUR-SECRET-KEY' \ - --form 'file=你好Dify;user=abc-123;streaming=false' + curl -o text-to-audio.mp3 -X POST '${props.appDetail.api_base_url}/text-to-audio' \ + --header 'Authorization: Bearer {api_key}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "text": "你好Dify", + "user": "abc-123", + "streaming": false + }' ``` - +