Skip to content

Commit

Permalink
chore: improve conversation list and rename docs (langgenius#11187)
Browse files Browse the repository at this point in the history
  • Loading branch information
hjlarry authored Nov 29, 2024
1 parent 2d6865d commit e576d32
Show file tree
Hide file tree
Showing 6 changed files with 109 additions and 74 deletions.
29 changes: 17 additions & 12 deletions web/app/components/develop/template/template_advanced_chat.en.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -648,16 +648,13 @@ Chat applications support session persistence, allowing previous chat history to
Should be uniquely defined by the developer within the application.
</Property>
<Property name='last_id' type='string' key='last_id'>
The ID of the last record on the current page, default is null.
(Optional) The ID of the last record on the current page, default is null.
</Property>
<Property name='limit' type='int' key='limit'>
How many records to return in one request, default is the most recent 20 entries.
</Property>
<Property name='pinned' type='bool' key='pinned'>
Return only pinned conversations as `true`, only non-pinned as `false`
(Optional) How many records to return in one request, default is the most recent 20 entries. Maximum 100, minimum 1.
</Property>
<Property name='sort_by' type='string' key='sort_by'>
Sorting Field (Optional), Default: -updated_at (sorted in descending order by update time)
(Optional) Sorting Field, Default: -updated_at (sorted in descending order by update time)
- Available Values: created_at, -created_at, updated_at, -updated_at
- The symbol before the field represents the order or reverse, "-" represents reverse order.
</Property>
Expand All @@ -668,8 +665,10 @@ Chat applications support session persistence, allowing previous chat history to
- `id` (string) Conversation ID
- `name` (string) Conversation name, by default, is generated by LLM.
- `inputs` (array[object]) User input parameters.
- `status` (string) Conversation status
- `introduction` (string) Introduction
- `created_at` (timestamp) Creation timestamp, e.g., 1705395332
- `updated_at` (timestamp) Update timestamp, e.g., 1705395332
- `has_more` (bool)
- `limit` (int) Number of entries returned, if input exceeds system limit, system limit number is returned

Expand Down Expand Up @@ -699,7 +698,8 @@ Chat applications support session persistence, allowing previous chat history to
"myName": "Lucy"
},
"status": "normal",
"created_at": 1679667915
"created_at": 1679667915,
"updated_at": 1679667915
},
{
"id": "hSIhXBhNe8X1d8Et"
Expand Down Expand Up @@ -781,10 +781,10 @@ Chat applications support session persistence, allowing previous chat history to

<Properties>
<Property name='name' type='string' key='name'>
The name of the conversation. This parameter can be omitted if `auto_generate` is set to `true`.
(Optional) The name of the conversation. This parameter can be omitted if `auto_generate` is set to `true`.
</Property>
<Property name='auto_generate' type='bool' key='auto_generate'>
Automatically generate the title, default is `false`
(Optional) Automatically generate the title, default is `false`
</Property>
<Property name='user' type='string' key='user'>
The user identifier, defined by the developer, must ensure uniqueness within the application.
Expand All @@ -794,20 +794,23 @@ Chat applications support session persistence, allowing previous chat history to
### Response
- `id` (string) Conversation ID
- `name` (string) Conversation name
- `inputs` array[object] User input parameters.
- `inputs` array[object] User input parameters
- `status` (string) Conversation status
- `introduction` (string) Introduction
- `created_at` (timestamp) Creation timestamp, e.g., 1705395332
- `updated_at` (timestamp) Update timestamp, e.g., 1705395332
</Col>
<Col sticky>

<CodeGroup title="Request" tag="POST" label="/conversations/:conversation_id/name" targetCode={`curl -X POST '${props.appDetail.api_base_url}/conversations/:conversation_id/name' \\\n--header 'Authorization: Bearer {api_key}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{ \n "name": "", \n "user": "abc-123"\n}'`}>
<CodeGroup title="Request" tag="POST" label="/conversations/:conversation_id/name" targetCode={`curl -X POST '${props.appDetail.api_base_url}/conversations/:conversation_id/name' \\\n--header 'Authorization: Bearer {api_key}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{ \n "name": "", \n "auto_generate": true, \n "user": "abc-123"\n}'`}>

```bash {{ title: 'cURL' }}
curl -X POST '${props.appDetail.api_base_url}/conversations/{conversation_id}/name' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {api_key}' \
--data-raw '{
"name": "",
"auto_generate": true,
"user": "abc-123"
}'
```
Expand All @@ -820,8 +823,10 @@ Chat applications support session persistence, allowing previous chat history to
"id": "cd78daf6-f9e4-4463-9ff2-54257230a0ce",
"name": "Chat vs AI",
"inputs": {},
"status": "normal",
"introduction": "",
"created_at": 1705569238
"created_at": 1705569238,
"updated_at": 1705569238
}
```
</CodeGroup>
Expand Down
28 changes: 16 additions & 12 deletions web/app/components/develop/template/template_advanced_chat.ja.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -648,16 +648,13 @@ import { Row, Col, Properties, Property, Heading, SubProperty, Paragraph } from
アプリケーション内で開発者によって一意に定義されるべきです。
</Property>
<Property name='last_id' type='string' key='last_id'>
現在のページの最後の記録のID、デフォルトはnullです。
(Optional)現在のページの最後の記録のID、デフォルトはnullです。
</Property>
<Property name='limit' type='int' key='limit'>
1回のリクエストで返す記録の数、デフォルトは最新の20件です。
</Property>
<Property name='pinned' type='bool' key='pinned'>
ピン留めされた会話のみを`true`として返し、非ピン留めを`false`として返します
(Optional)1回のリクエストで返す記録の数、デフォルトは最新の20件です。最大100、最小1。
</Property>
<Property name='sort_by' type='string' key='sort_by'>
ソートフィールド(オプション)、デフォルト:-updated_at(更新時間で降順にソート)
(Optional)ソートフィールド、デフォルト:-updated_at(更新時間で降順にソート)
- 利用可能な値:created_at, -created_at, updated_at, -updated_at
- フィールドの前の記号は順序または逆順を表し、"-"は逆順を表します。
</Property>
Expand All @@ -670,6 +667,7 @@ import { Row, Col, Properties, Property, Heading, SubProperty, Paragraph } from
- `inputs` (array[object]) ユーザー入力パラメータ。
- `introduction` (string) 紹介
- `created_at` (timestamp) 作成タイムスタンプ、例:1705395332
- `updated_at` (timestamp) 更新タイムスタンプ、例:1705395332
- `has_more` (bool)
- `limit` (int) 返されたエントリ数、入力がシステム制限を超える場合、システム制限数が返されます

Expand Down Expand Up @@ -699,7 +697,8 @@ import { Row, Col, Properties, Property, Heading, SubProperty, Paragraph } from
"myName": "Lucy"
},
"status": "normal",
"created_at": 1679667915
"created_at": 1679667915,
"updated_at": 1679667915
},
{
"id": "hSIhXBhNe8X1d8Et"
Expand Down Expand Up @@ -781,10 +780,10 @@ import { Row, Col, Properties, Property, Heading, SubProperty, Paragraph } from

<Properties>
<Property name='name' type='string' key='name'>
会話の名前。`auto_generate``true`に設定されている場合、このパラメータは省略できます。
(Optional)会話の名前。`auto_generate``true`に設定されている場合、このパラメータは省略できます。
</Property>
<Property name='auto_generate' type='bool' key='auto_generate'>
タイトルを自動生成、デフォルトは`false`
(Optional)タイトルを自動生成、デフォルトは`false`
</Property>
<Property name='user' type='string' key='user'>
ユーザー識別子、開発者によって定義され、アプリケーション内で一意であることを保証しなければなりません。
Expand All @@ -794,20 +793,23 @@ import { Row, Col, Properties, Property, Heading, SubProperty, Paragraph } from
### 応答
- `id` (string) 会話ID
- `name` (string) 会話名
- `inputs` array[object] ユーザー入力パラメータ。
- `inputs` array[object] ユーザー入力パラメータ
- `status` (string) 会話状態
- `introduction` (string) 紹介
- `created_at` (timestamp) 作成タイムスタンプ、例:1705395332
- `updated_at` (timestamp) 更新タイムスタンプ、例:1705395332
</Col>
<Col sticky>

<CodeGroup title="リクエスト" tag="POST" label="/conversations/:conversation_id/name" targetCode={`curl -X POST '${props.appDetail.api_base_url}/conversations/:conversation_id/name' \\\n--header 'Authorization: Bearer {api_key}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{ \n "name": "", \n "user": "abc-123"\n}'`}>
<CodeGroup title="リクエスト" tag="POST" label="/conversations/:conversation_id/name" targetCode={`curl -X POST '${props.appDetail.api_base_url}/conversations/:conversation_id/name' \\\n--header 'Authorization: Bearer {api_key}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{ \n "name": "", \n "auto_generate": true, \n "user": "abc-123"\n}'`}>

```bash {{ title: 'cURL' }}
curl -X POST '${props.appDetail.api_base_url}/conversations/{conversation_id}/name' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {api_key}' \
--data-raw '{
"name": "",
"auto_generate": true,
"user": "abc-123"
}'
```
Expand All @@ -820,8 +822,10 @@ import { Row, Col, Properties, Property, Heading, SubProperty, Paragraph } from
"id": "cd78daf6-f9e4-4463-9ff2-54257230a0ce",
"name": "チャット vs AI",
"inputs": {},
"status": "normal",
"introduction": "",
"created_at": 1705569238
"created_at": 1705569238,
"updated_at": 1705569238
}
```
</CodeGroup>
Expand Down
35 changes: 22 additions & 13 deletions web/app/components/develop/template/template_advanced_chat.zh.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -683,16 +683,13 @@ import { Row, Col, Properties, Property, Heading, SubProperty } from '../md.tsx'
用户标识,由开发者定义规则,需保证用户标识在应用内唯一。
</Property>
<Property name='last_id' type='string' key='last_id'>
当前页最后面一条记录的 ID,默认 null
(选填)当前页最后面一条记录的 ID,默认 null
</Property>
<Property name='limit' type='int' key='limit'>
一次请求返回多少条记录
</Property>
<Property name='pinned' type='bool' key='pinned'>
只返回置顶 true,只返回非置顶 false
(选填)一次请求返回多少条记录,默认 20 条,最大 100 条,最小 1 条。
</Property>
<Property name='sort_by' type='string' key='sort_by'>
排序字段(选题),默认 -updated_at(按更新时间倒序排列)
(选填)排序字段,默认 -updated_at(按更新时间倒序排列)
- 可选值:created_at, -created_at, updated_at, -updated_at
- 字段前面的符号代表顺序或倒序,-代表倒序
</Property>
Expand All @@ -703,8 +700,10 @@ import { Row, Col, Properties, Property, Heading, SubProperty } from '../md.tsx'
- `id` (string) 会话 ID
- `name` (string) 会话名称,默认由大语言模型生成。
- `inputs` (array[object]) 用户输入参数。
- `status` (string) 会话状态
- `introduction` (string) 开场白
- `created_at` (timestamp) 创建时间
- `updated_at` (timestamp) 更新时间
- `has_more` (bool)
- `limit` (int) 返回条数,若传入超过系统限制,返回系统限制数量

Expand Down Expand Up @@ -734,7 +733,8 @@ import { Row, Col, Properties, Property, Heading, SubProperty } from '../md.tsx'
"myName": "Lucy"
},
"status": "normal",
"created_at": 1679667915
"created_at": 1679667915,
"updated_at": 1679667915
},
{
"id": "hSIhXBhNe8X1d8Et"
Expand Down Expand Up @@ -817,10 +817,10 @@ import { Row, Col, Properties, Property, Heading, SubProperty } from '../md.tsx'

<Properties>
<Property name='name' type='string' key='name'>
名称,若 `auto_generate``true` 时,该参数可不传。
(选填)名称,若 `auto_generate``true` 时,该参数可不传。
</Property>
<Property name='auto_generate' type='string' key='auto_generate'>
自动生成标题,默认 false。
<Property name='auto_generate' type='bool' key='auto_generate'>
(选填)自动生成标题,默认 false。
</Property>
<Property name='user' type='string' key='user'>
用户标识,由开发者定义规则,需保证用户标识在应用内唯一。
Expand All @@ -830,20 +830,23 @@ import { Row, Col, Properties, Property, Heading, SubProperty } from '../md.tsx'
### Response
- `id` (string) 会话 ID
- `name` (string) 会话名称
- `inputs` array[object] 用户输入参数。
- `inputs` array[object] 用户输入参数
- `status` (string) 会话状态
- `introduction` (string) 开场白
- `created_at` (timestamp) 创建时间
- `updated_at` (timestamp) 更新时间
</Col>
<Col sticky>

<CodeGroup title="Request" tag="POST" label="/conversations/:conversation_id/name" targetCode={`curl -X POST '${props.appDetail.api_base_url}/conversations/:conversation_id/name' \\\n--header 'Authorization: Bearer {api_key}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{ \n "name": "", \n "user": "abc-123"\n}'`}>
<CodeGroup title="Request" tag="POST" label="/conversations/:conversation_id/name" targetCode={`curl -X POST '${props.appDetail.api_base_url}/conversations/:conversation_id/name' \\\n--header 'Authorization: Bearer {api_key}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{ \n "name": "", \n "auto_generate": true, \n "user": "abc-123"\n}'`}>

```bash {{ title: 'cURL' }}
curl -X POST '${props.appDetail.api_base_url}/conversations/{conversation_id}/name' \
--header 'Authorization: Bearer {api_key}' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "",
"auto_generate": true,
"user": "abc-123"
}'
```
Expand All @@ -853,7 +856,13 @@ import { Row, Col, Properties, Property, Heading, SubProperty } from '../md.tsx'
<CodeGroup title="Response">
```json {{ title: 'Response' }}
{
"result": "success"
"id": "34d511d5-56de-4f16-a997-57b379508443",
"name": "hello",
"inputs": {},
"status": "normal",
"introduction": "",
"created_at": 1732731141,
"updated_at": 1732734510
}
```
</CodeGroup>
Expand Down
Loading

0 comments on commit e576d32

Please sign in to comment.