From e576d32fb6232f141a02669100f2dfe17d8c8d5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9D=9E=E6=B3=95=E6=93=8D=E4=BD=9C?= Date: Fri, 29 Nov 2024 09:22:08 +0800 Subject: [PATCH] chore: improve conversation list and rename docs (#11187) --- .../template/template_advanced_chat.en.mdx | 29 ++++++++------- .../template/template_advanced_chat.ja.mdx | 28 ++++++++------- .../template/template_advanced_chat.zh.mdx | 35 ++++++++++++------- .../develop/template/template_chat.en.mdx | 29 ++++++++------- .../develop/template/template_chat.ja.mdx | 27 +++++++------- .../develop/template/template_chat.zh.mdx | 35 ++++++++++++------- 6 files changed, 109 insertions(+), 74 deletions(-) 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 7d64caa7693bf8..c47a166271579f 100644 --- a/web/app/components/develop/template/template_advanced_chat.en.mdx +++ b/web/app/components/develop/template/template_advanced_chat.en.mdx @@ -648,16 +648,13 @@ Chat applications support session persistence, allowing previous chat history to Should be uniquely defined by the developer within the application. - 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. - How many records to return in one request, default is the most recent 20 entries. - - - 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. - 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. @@ -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 @@ -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" @@ -781,10 +781,10 @@ Chat applications support session persistence, allowing previous chat history to - 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`. - Automatically generate the title, default is `false` + (Optional) Automatically generate the title, default is `false` The user identifier, defined by the developer, must ensure uniqueness within the application. @@ -794,13 +794,15 @@ 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 - + ```bash {{ title: 'cURL' }} curl -X POST '${props.appDetail.api_base_url}/conversations/{conversation_id}/name' \ @@ -808,6 +810,7 @@ Chat applications support session persistence, allowing previous chat history to --header 'Authorization: Bearer {api_key}' \ --data-raw '{ "name": "", + "auto_generate": true, "user": "abc-123" }' ``` @@ -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 } ``` diff --git a/web/app/components/develop/template/template_advanced_chat.ja.mdx b/web/app/components/develop/template/template_advanced_chat.ja.mdx index b4c252e19a8a02..4cfb5f8236fd7a 100644 --- a/web/app/components/develop/template/template_advanced_chat.ja.mdx +++ b/web/app/components/develop/template/template_advanced_chat.ja.mdx @@ -648,16 +648,13 @@ import { Row, Col, Properties, Property, Heading, SubProperty, Paragraph } from アプリケーション内で開発者によって一意に定義されるべきです。 - 現在のページの最後の記録のID、デフォルトはnullです。 + (Optional)現在のページの最後の記録のID、デフォルトはnullです。 - 1回のリクエストで返す記録の数、デフォルトは最新の20件です。 - - - ピン留めされた会話のみを`true`として返し、非ピン留めを`false`として返します + (Optional)1回のリクエストで返す記録の数、デフォルトは最新の20件です。最大100、最小1。 - ソートフィールド(オプション)、デフォルト:-updated_at(更新時間で降順にソート) + (Optional)ソートフィールド、デフォルト:-updated_at(更新時間で降順にソート) - 利用可能な値:created_at, -created_at, updated_at, -updated_at - フィールドの前の記号は順序または逆順を表し、"-"は逆順を表します。 @@ -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) 返されたエントリ数、入力がシステム制限を超える場合、システム制限数が返されます @@ -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" @@ -781,10 +780,10 @@ import { Row, Col, Properties, Property, Heading, SubProperty, Paragraph } from - 会話の名前。`auto_generate`が`true`に設定されている場合、このパラメータは省略できます。 + (Optional)会話の名前。`auto_generate`が`true`に設定されている場合、このパラメータは省略できます。 - タイトルを自動生成、デフォルトは`false` + (Optional)タイトルを自動生成、デフォルトは`false` ユーザー識別子、開発者によって定義され、アプリケーション内で一意であることを保証しなければなりません。 @@ -794,13 +793,15 @@ 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 - + ```bash {{ title: 'cURL' }} curl -X POST '${props.appDetail.api_base_url}/conversations/{conversation_id}/name' \ @@ -808,6 +809,7 @@ import { Row, Col, Properties, Property, Heading, SubProperty, Paragraph } from --header 'Authorization: Bearer {api_key}' \ --data-raw '{ "name": "", + "auto_generate": true, "user": "abc-123" }' ``` @@ -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 } ``` diff --git a/web/app/components/develop/template/template_advanced_chat.zh.mdx b/web/app/components/develop/template/template_advanced_chat.zh.mdx index f3ddd6933c9a70..a7a9400215a9f2 100755 --- a/web/app/components/develop/template/template_advanced_chat.zh.mdx +++ b/web/app/components/develop/template/template_advanced_chat.zh.mdx @@ -683,16 +683,13 @@ import { Row, Col, Properties, Property, Heading, SubProperty } from '../md.tsx' 用户标识,由开发者定义规则,需保证用户标识在应用内唯一。 - 当前页最后面一条记录的 ID,默认 null + (选填)当前页最后面一条记录的 ID,默认 null - 一次请求返回多少条记录 - - - 只返回置顶 true,只返回非置顶 false + (选填)一次请求返回多少条记录,默认 20 条,最大 100 条,最小 1 条。 - 排序字段(选题),默认 -updated_at(按更新时间倒序排列) + (选填)排序字段,默认 -updated_at(按更新时间倒序排列) - 可选值:created_at, -created_at, updated_at, -updated_at - 字段前面的符号代表顺序或倒序,-代表倒序 @@ -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) 返回条数,若传入超过系统限制,返回系统限制数量 @@ -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" @@ -817,10 +817,10 @@ import { Row, Col, Properties, Property, Heading, SubProperty } from '../md.tsx' - 名称,若 `auto_generate` 为 `true` 时,该参数可不传。 + (选填)名称,若 `auto_generate` 为 `true` 时,该参数可不传。 - - 自动生成标题,默认 false。 + + (选填)自动生成标题,默认 false。 用户标识,由开发者定义规则,需保证用户标识在应用内唯一。 @@ -830,13 +830,15 @@ 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) 更新时间 - + ```bash {{ title: 'cURL' }} curl -X POST '${props.appDetail.api_base_url}/conversations/{conversation_id}/name' \ @@ -844,6 +846,7 @@ import { Row, Col, Properties, Property, Heading, SubProperty } from '../md.tsx' --header 'Content-Type: application/json' \ --data-raw '{ "name": "", + "auto_generate": true, "user": "abc-123" }' ``` @@ -853,7 +856,13 @@ import { Row, Col, Properties, Property, Heading, SubProperty } from '../md.tsx' ```json {{ title: 'Response' }} { - "result": "success" + "id": "34d511d5-56de-4f16-a997-57b379508443", + "name": "hello", + "inputs": {}, + "status": "normal", + "introduction": "", + "created_at": 1732731141, + "updated_at": 1732734510 } ``` diff --git a/web/app/components/develop/template/template_chat.en.mdx b/web/app/components/develop/template/template_chat.en.mdx index ac8ee9d6571a2a..72fa99dd57809a 100644 --- a/web/app/components/develop/template/template_chat.en.mdx +++ b/web/app/components/develop/template/template_chat.en.mdx @@ -682,16 +682,13 @@ Chat applications support session persistence, allowing previous chat history to Should be uniquely defined by the developer within the application. - 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. - How many records to return in one request, default is the most recent 20 entries. - - - 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. - 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. @@ -702,8 +699,10 @@ Chat applications support session persistence, allowing previous chat history to - `id` (string) Conversation ID - `name` (string) Conversation name, by default, is a snippet of the first question asked by the user in the conversation. - `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 @@ -733,7 +732,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" @@ -815,10 +815,10 @@ Chat applications support session persistence, allowing previous chat history to - 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`. - Automatically generate the title, default is `false` + (Optional) Automatically generate the title, default is `false` The user identifier, defined by the developer, must ensure uniqueness within the application. @@ -828,13 +828,15 @@ 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 - + ```bash {{ title: 'cURL' }} curl -X POST '${props.appDetail.api_base_url}/conversations/{conversation_id}/name' \ @@ -842,6 +844,7 @@ Chat applications support session persistence, allowing previous chat history to --header 'Authorization: Bearer {api_key}' \ --data-raw '{ "name": "", + "auto_generate": true, "user": "abc-123" }' ``` @@ -854,8 +857,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 } ``` diff --git a/web/app/components/develop/template/template_chat.ja.mdx b/web/app/components/develop/template/template_chat.ja.mdx index a962177f0eeda9..493e7ac6a5855c 100644 --- a/web/app/components/develop/template/template_chat.ja.mdx +++ b/web/app/components/develop/template/template_chat.ja.mdx @@ -682,16 +682,13 @@ import { Row, Col, Properties, Property, Heading, SubProperty, Paragraph } from アプリケーション内で開発者によって一意に定義される必要があります。 - 現在のページの最後のレコードのID、デフォルトはnullです。 + (Optional)現在のページの最後のレコードのID、デフォルトはnullです。 - 1回のリクエストで返すレコードの数、デフォルトは最新の20件です。 - - - ピン留めされた会話のみを`true`として返し、ピン留めされていないもののみを`false`として返します + (Optional)1回のリクエストで返すレコードの数、デフォルトは最新の20件です。最大100、最小1。 - ソートフィールド(オプション)、デフォルト:-updated_at(更新時間で降順にソート) + (Optional)ソートフィールド、デフォルト:-updated_at(更新時間で降順にソート) - 利用可能な値:created_at, -created_at, updated_at, -updated_at - フィールドの前の記号は順序または逆順を表し、"-"は逆順を表します。 @@ -704,6 +701,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) 返されたエントリの数、入力がシステム制限を超える場合、システム制限の数を返します @@ -733,7 +731,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" @@ -815,10 +814,10 @@ import { Row, Col, Properties, Property, Heading, SubProperty, Paragraph } from - 会話の名前。このパラメータは、`auto_generate`が`true`に設定されている場合、省略できます。 + (Optional)会話の名前。このパラメータは、`auto_generate`が`true`に設定されている場合、省略できます。 - タイトルを自動生成します。デフォルトは`false`です。 + (Optional)タイトルを自動生成します。デフォルトは`false`です。 ユーザー識別子、開発者によって定義され、アプリケーション内で一意である必要があります。 @@ -828,13 +827,15 @@ 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 - + ```bash {{ title: 'cURL' }} curl -X POST '${props.appDetail.api_base_url}/conversations/{conversation_id}/name' \ @@ -842,6 +843,7 @@ import { Row, Col, Properties, Property, Heading, SubProperty, Paragraph } from --header 'Authorization: Bearer {api_key}' \ --data-raw '{ "name": "", + "auto_generate": true, "user": "abc-123" }' ``` @@ -855,7 +857,8 @@ import { Row, Col, Properties, Property, Heading, SubProperty, Paragraph } from "name": "Chat vs AI", "inputs": {}, "introduction": "", - "created_at": 1705569238 + "created_at": 1705569238, + "updated_at": 1705569238 } ``` diff --git a/web/app/components/develop/template/template_chat.zh.mdx b/web/app/components/develop/template/template_chat.zh.mdx index c786d56980226b..cf946fc86ce46f 100644 --- a/web/app/components/develop/template/template_chat.zh.mdx +++ b/web/app/components/develop/template/template_chat.zh.mdx @@ -697,16 +697,13 @@ import { Row, Col, Properties, Property, Heading, SubProperty } from '../md.tsx' 用户标识,由开发者定义规则,需保证用户标识在应用内唯一。 - 当前页最后面一条记录的 ID,默认 null + (选填)当前页最后面一条记录的 ID,默认 null - 一次请求返回多少条记录 - - - 只返回置顶 true,只返回非置顶 false + (选填)一次请求返回多少条记录,默认 20 条,最大 100 条,最小 1 条。 - 排序字段(选题),默认 -updated_at(按更新时间倒序排列) + (选填)排序字段,默认 -updated_at(按更新时间倒序排列) - 可选值:created_at, -created_at, updated_at, -updated_at - 字段前面的符号代表顺序或倒序,-代表倒序 @@ -717,8 +714,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) 返回条数,若传入超过系统限制,返回系统限制数量 @@ -748,7 +747,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" @@ -831,10 +831,10 @@ import { Row, Col, Properties, Property, Heading, SubProperty } from '../md.tsx' - 名称,若 `auto_generate` 为 `true` 时,该参数可不传。 + (选填)名称,若 `auto_generate` 为 `true` 时,该参数可不传。 - - 自动生成标题,默认 false。 + + (选填)自动生成标题,默认 false。 用户标识,由开发者定义规则,需保证用户标识在应用内唯一。 @@ -844,13 +844,15 @@ 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) 更新时间 - + ```bash {{ title: 'cURL' }} curl -X POST '${props.appDetail.api_base_url}/conversations/{conversation_id}/name' \ @@ -858,6 +860,7 @@ import { Row, Col, Properties, Property, Heading, SubProperty } from '../md.tsx' --header 'Content-Type: application/json' \ --data-raw '{ "name": "", + "auto_generate": true, "user": "abc-123" }' ``` @@ -867,7 +870,13 @@ import { Row, Col, Properties, Property, Heading, SubProperty } from '../md.tsx' ```json {{ title: 'Response' }} { - "result": "success" + "id": "34d511d5-56de-4f16-a997-57b379508443", + "name": "hello", + "inputs": {}, + "status": "normal", + "introduction": "", + "created_at": 1732731141, + "updated_at": 1732734510 } ```