Skip to content

Commit a86f1ec

Browse files
authored
docs: add api docs for /v1/info (#11269)
1 parent 668c1c0 commit a86f1ec

12 files changed

+1008
-481
lines changed

web/app/components/develop/template/template.en.mdx

+98-54
Original file line numberDiff line numberDiff line change
@@ -379,10 +379,107 @@ The text generation application offers non-session support and is ideal for tran
379379

380380
---
381381

382+
<Heading
383+
url='/text-to-audio'
384+
method='POST'
385+
title='Text to Audio'
386+
name='#audio'
387+
/>
388+
<Row>
389+
<Col>
390+
Text to speech.
391+
392+
### Request Body
393+
394+
<Properties>
395+
<Property name='message_id' type='str' key='text'>
396+
For text messages generated by Dify, simply pass the generated message-id directly. The backend will use the message-id to look up the corresponding content and synthesize the voice information directly. If both message_id and text are provided simultaneously, the message_id is given priority.
397+
</Property>
398+
<Property name='text' type='str' key='text'>
399+
Speech generated content。
400+
</Property>
401+
<Property name='user' type='string' key='user'>
402+
The user identifier, defined by the developer, must ensure uniqueness within the app.
403+
</Property>
404+
</Properties>
405+
</Col>
406+
<Col sticky>
407+
408+
<CodeGroup title="Request" tag="POST" label="/text-to-audio" targetCode={`curl -o text-to-audio.mp3 -X POST '${props.appDetail.api_base_url}/text-to-audio' \\\n--header 'Authorization: Bearer {api_key}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n "message_id": "5ad4cb98-f0c7-4085-b384-88c403be6290",\n "text": "Hello Dify",\n "user": "abc-123"\n}'`}>
409+
410+
```bash {{ title: 'cURL' }}
411+
curl -o text-to-audio.mp3 -X POST '${props.appDetail.api_base_url}/text-to-audio' \
412+
--header 'Authorization: Bearer {api_key}' \
413+
--header 'Content-Type: application/json' \
414+
--data-raw '{
415+
"message_id": "5ad4cb98-f0c7-4085-b384-88c403be6290",
416+
"text": "Hello Dify",
417+
"user": "abc-123"
418+
}'
419+
```
420+
421+
</CodeGroup>
422+
423+
<CodeGroup title="headers">
424+
```json {{ title: 'headers' }}
425+
{
426+
"Content-Type": "audio/wav"
427+
}
428+
```
429+
</CodeGroup>
430+
</Col>
431+
</Row>
432+
---
433+
434+
<Heading
435+
url='/info'
436+
method='GET'
437+
title='Get Application Basic Information'
438+
name='#info'
439+
/>
440+
<Row>
441+
<Col>
442+
Used to get basic information about this application
443+
### Query
444+
<Properties>
445+
446+
<Property name='user' type='string' key='user'>
447+
User identifier, defined by the developer's rules, must be unique within the application.
448+
</Property>
449+
</Properties>
450+
### Response
451+
- `name` (string) application name
452+
- `description` (string) application description
453+
- `tags` (array[string]) application tags
454+
</Col>
455+
<Col>
456+
<CodeGroup title="Request" tag="GET" label="/info" targetCode={`curl -X GET '${props.appDetail.api_base_url}/info?user=abc-123' \\\n-H 'Authorization: Bearer {api_key}'`}>
457+
```bash {{ title: 'cURL' }}
458+
curl -X GET '${props.appDetail.api_base_url}/info?user=abc-123' \
459+
-H 'Authorization: Bearer {api_key}'
460+
```
461+
</CodeGroup>
462+
<CodeGroup title="Response">
463+
```json {{ title: 'Response' }}
464+
{
465+
"name": "My App",
466+
"description": "This is my app.",
467+
"tags": [
468+
"tag1",
469+
"tag2"
470+
]
471+
}
472+
```
473+
</CodeGroup>
474+
</Col>
475+
</Row>
476+
477+
---
478+
382479
<Heading
383480
url='/parameters'
384481
method='GET'
385-
title='Get Application Information'
482+
title='Get Application Parameters Information'
386483
name='#parameters'
387484
/>
388485
<Row>
@@ -497,56 +594,3 @@ The text generation application offers non-session support and is ideal for tran
497594
</CodeGroup>
498595
</Col>
499596
</Row>
500-
501-
---
502-
503-
<Heading
504-
url='/text-to-audio'
505-
method='POST'
506-
title='Text to Audio'
507-
name='#audio'
508-
/>
509-
<Row>
510-
<Col>
511-
Text to speech.
512-
513-
### Request Body
514-
515-
<Properties>
516-
<Property name='message_id' type='str' key='text'>
517-
For text messages generated by Dify, simply pass the generated message-id directly. The backend will use the message-id to look up the corresponding content and synthesize the voice information directly. If both message_id and text are provided simultaneously, the message_id is given priority.
518-
</Property>
519-
<Property name='text' type='str' key='text'>
520-
Speech generated content。
521-
</Property>
522-
<Property name='user' type='string' key='user'>
523-
The user identifier, defined by the developer, must ensure uniqueness within the app.
524-
</Property>
525-
</Properties>
526-
</Col>
527-
<Col sticky>
528-
529-
<CodeGroup title="Request" tag="POST" label="/text-to-audio" targetCode={`curl -o text-to-audio.mp3 -X POST '${props.appDetail.api_base_url}/text-to-audio' \\\n--header 'Authorization: Bearer {api_key}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n "message_id": "5ad4cb98-f0c7-4085-b384-88c403be6290",\n "text": "Hello Dify",\n "user": "abc-123"\n}'`}>
530-
531-
```bash {{ title: 'cURL' }}
532-
curl -o text-to-audio.mp3 -X POST '${props.appDetail.api_base_url}/text-to-audio' \
533-
--header 'Authorization: Bearer {api_key}' \
534-
--header 'Content-Type: application/json' \
535-
--data-raw '{
536-
"message_id": "5ad4cb98-f0c7-4085-b384-88c403be6290",
537-
"text": "Hello Dify",
538-
"user": "abc-123"
539-
}'
540-
```
541-
542-
</CodeGroup>
543-
544-
<CodeGroup title="headers">
545-
```json {{ title: 'headers' }}
546-
{
547-
"Content-Type": "audio/wav"
548-
}
549-
```
550-
</CodeGroup>
551-
</Col>
552-
</Row>

web/app/components/develop/template/template.ja.mdx

+97-54
Original file line numberDiff line numberDiff line change
@@ -375,13 +375,109 @@ import { Row, Col, Properties, Property, Heading, SubProperty, Paragraph } from
375375
</CodeGroup>
376376
</Col>
377377
</Row>
378+
---
379+
380+
<Heading
381+
url='/text-to-audio'
382+
method='POST'
383+
title='テキストから音声'
384+
name='#audio'
385+
/>
386+
<Row>
387+
<Col>
388+
テキストを音声に変換します。
389+
390+
### リクエストボディ
391+
392+
<Properties>
393+
<Property name='message_id' type='str' key='text'>
394+
Difyが生成したテキストメッセージの場合、生成されたmessage-idを直接渡すだけです。バックエンドはmessage-idを使用して対応するコンテンツを検索し、音声情報を直接合成します。message_idとtextの両方が同時に提供された場合、message_idが優先されます。
395+
</Property>
396+
<Property name='text' type='str' key='text'>
397+
音声生成コンテンツ。
398+
</Property>
399+
<Property name='user' type='string' key='user'>
400+
開発者が定義したユーザー識別子。アプリ内で一意性を確保する必要があります。
401+
</Property>
402+
</Properties>
403+
</Col>
404+
<Col sticky>
405+
406+
<CodeGroup title="Request" tag="POST" label="/text-to-audio" targetCode={`curl -o text-to-audio.mp3 -X POST '${props.appDetail.api_base_url}/text-to-audio' \\\n--header 'Authorization: Bearer {api_key}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n "message_id": "5ad4cb98-f0c7-4085-b384-88c403be6290",\n "text": "Hello Dify",\n "user": "abc-123"\n}'`}>
407+
408+
```bash {{ title: 'cURL' }}
409+
curl -o text-to-audio.mp3 -X POST '${props.appDetail.api_base_url}/text-to-audio' \
410+
--header 'Authorization: Bearer {api_key}' \
411+
--header 'Content-Type: application/json' \
412+
--data-raw '{
413+
"message_id": "5ad4cb98-f0c7-4085-b384-88c403be6290",
414+
"text": "Hello Dify",
415+
"user": "abc-123"
416+
}'
417+
```
418+
419+
</CodeGroup>
420+
421+
<CodeGroup title="headers">
422+
```json {{ title: 'headers' }}
423+
{
424+
"Content-Type": "audio/wav"
425+
}
426+
```
427+
</CodeGroup>
428+
</Col>
429+
</Row>
430+
---
431+
432+
<Heading
433+
url='/info'
434+
method='GET'
435+
title='アプリケーションの基本情報を取得'
436+
name='#info'
437+
/>
438+
<Row>
439+
<Col>
440+
このアプリケーションの基本情報を取得するために使用されます
441+
### Query
442+
<Properties>
443+
444+
<Property name='user' type='string' key='user'>
445+
ユーザー識別子、開発者のルールによって定義され、アプリケーション内で一意でなければなりません。
446+
</Property>
447+
</Properties>
448+
### Response
449+
- `name` (string) アプリケーションの名前
450+
- `description` (string) アプリケーションの説明
451+
- `tags` (array[string]) アプリケーションのタグ
452+
</Col>
453+
<Col>
454+
<CodeGroup title="Request" tag="GET" label="/info" targetCode={`curl -X GET '${props.appDetail.api_base_url}/info?user=abc-123' \\\n-H 'Authorization: Bearer {api_key}'`}>
455+
```bash {{ title: 'cURL' }}
456+
curl -X GET '${props.appDetail.api_base_url}/info?user=abc-123' \
457+
-H 'Authorization: Bearer {api_key}'
458+
```
459+
</CodeGroup>
460+
<CodeGroup title="Response">
461+
```json {{ title: 'Response' }}
462+
{
463+
"name": "My App",
464+
"description": "This is my app.",
465+
"tags": [
466+
"tag1",
467+
"tag2"
468+
]
469+
}
470+
```
471+
</CodeGroup>
472+
</Col>
473+
</Row>
378474

379475
---
380476

381477
<Heading
382478
url='/parameters'
383479
method='GET'
384-
title='アプリケーション情報の取得'
480+
title='アプリケーションのパラメータ情報を取得'
385481
name='#parameters'
386482
/>
387483
<Row>
@@ -496,56 +592,3 @@ import { Row, Col, Properties, Property, Heading, SubProperty, Paragraph } from
496592
</CodeGroup>
497593
</Col>
498594
</Row>
499-
500-
---
501-
502-
<Heading
503-
url='/text-to-audio'
504-
method='POST'
505-
title='テキストから音声'
506-
name='#audio'
507-
/>
508-
<Row>
509-
<Col>
510-
テキストを音声に変換します。
511-
512-
### リクエストボディ
513-
514-
<Properties>
515-
<Property name='message_id' type='str' key='text'>
516-
Difyが生成したテキストメッセージの場合、生成されたmessage-idを直接渡すだけです。バックエンドはmessage-idを使用して対応するコンテンツを検索し、音声情報を直接合成します。message_idとtextの両方が同時に提供された場合、message_idが優先されます。
517-
</Property>
518-
<Property name='text' type='str' key='text'>
519-
音声生成コンテンツ。
520-
</Property>
521-
<Property name='user' type='string' key='user'>
522-
開発者が定義したユーザー識別子。アプリ内で一意性を確保する必要があります。
523-
</Property>
524-
</Properties>
525-
</Col>
526-
<Col sticky>
527-
528-
<CodeGroup title="Request" tag="POST" label="/text-to-audio" targetCode={`curl -o text-to-audio.mp3 -X POST '${props.appDetail.api_base_url}/text-to-audio' \\\n--header 'Authorization: Bearer {api_key}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n "message_id": "5ad4cb98-f0c7-4085-b384-88c403be6290",\n "text": "Hello Dify",\n "user": "abc-123"\n}'`}>
529-
530-
```bash {{ title: 'cURL' }}
531-
curl -o text-to-audio.mp3 -X POST '${props.appDetail.api_base_url}/text-to-audio' \
532-
--header 'Authorization: Bearer {api_key}' \
533-
--header 'Content-Type: application/json' \
534-
--data-raw '{
535-
"message_id": "5ad4cb98-f0c7-4085-b384-88c403be6290",
536-
"text": "Hello Dify",
537-
"user": "abc-123"
538-
}'
539-
```
540-
541-
</CodeGroup>
542-
543-
<CodeGroup title="headers">
544-
```json {{ title: 'headers' }}
545-
{
546-
"Content-Type": "audio/wav"
547-
}
548-
```
549-
</CodeGroup>
550-
</Col>
551-
</Row>

0 commit comments

Comments
 (0)