diff --git a/en/cloud/use-dify/nodes/llm.mdx b/en/cloud/use-dify/nodes/llm.mdx index 4aad97893..9ea1ce32b 100644 --- a/en/cloud/use-dify/nodes/llm.mdx +++ b/en/cloud/use-dify/nodes/llm.mdx @@ -100,8 +100,8 @@ For **File Processing**, add file variables to prompts for multimodal models. GP ### Vision Configuration When processing images, you can control the detail level: -- **High detail** - Better accuracy for complex images but uses more tokens -- **Low detail** - Faster processing with fewer tokens for simple images +- **High** - Better accuracy for complex images but uses more tokens +- **Low** - Faster processing with fewer tokens for simple images The default variable selector for vision is `userinput.files` which automatically picks up files from the User Input node. diff --git a/en/self-host/use-dify/nodes/llm.mdx b/en/self-host/use-dify/nodes/llm.mdx index 9274c1dc9..5d8b155fc 100644 --- a/en/self-host/use-dify/nodes/llm.mdx +++ b/en/self-host/use-dify/nodes/llm.mdx @@ -109,8 +109,8 @@ For **File Processing**, add file variables to prompts for multimodal models. GP ### Vision Configuration When processing images, you can control the detail level: -- **High detail** - Better accuracy for complex images but uses more tokens -- **Low detail** - Faster processing with fewer tokens for simple images +- **High** - Better accuracy for complex images but uses more tokens +- **Low** - Faster processing with fewer tokens for simple images The default variable selector for vision is `userinput.files` which automatically picks up files from the User Input node. diff --git a/ja/cloud/use-dify/nodes/llm.mdx b/ja/cloud/use-dify/nodes/llm.mdx index 682826f10..fb855be7d 100644 --- a/ja/cloud/use-dify/nodes/llm.mdx +++ b/ja/cloud/use-dify/nodes/llm.mdx @@ -103,8 +103,8 @@ User: {{user_input}} ### ビジョン機能設定 画像を処理する際、詳細レベルを制御できます: -- **高詳細** - 複雑な画像でより良い精度を提供しますが、より多くのトークンを使用します -- **低詳細** - シンプルな画像でより少ないトークンでより高速な処理 +- **高** - 複雑な画像でより良い精度を提供しますが、より多くのトークンを使用します +- **低** - シンプルな画像でより少ないトークンでより高速な処理 ビジョン機能のデフォルト変数セレクターは`userinput.files`で、ユーザー入力ノードからファイルを自動的に取得します。 diff --git a/ja/self-host/use-dify/nodes/llm.mdx b/ja/self-host/use-dify/nodes/llm.mdx index e5e9e6346..5fd6375ed 100644 --- a/ja/self-host/use-dify/nodes/llm.mdx +++ b/ja/self-host/use-dify/nodes/llm.mdx @@ -111,8 +111,8 @@ User: {{user_input}} ### ビジョン機能設定 画像を処理する際、詳細レベルを制御できます: -- **高詳細** - 複雑な画像でより良い精度を提供しますが、より多くのトークンを使用します -- **低詳細** - シンプルな画像でより少ないトークンでより高速な処理 +- **高** - 複雑な画像でより良い精度を提供しますが、より多くのトークンを使用します +- **低** - シンプルな画像でより少ないトークンでより高速な処理 ビジョン機能のデフォルト変数セレクターは`userinput.files`で、ユーザー入力ノードからファイルを自動的に取得します。 diff --git a/zh/api-reference/openapi_service.json b/zh/api-reference/openapi_service.json index 1a9031dac..17a6e3589 100644 --- a/zh/api-reference/openapi_service.json +++ b/zh/api-reference/openapi_service.json @@ -3042,7 +3042,7 @@ "/workflows/logs": { "get": { "summary": "获取工作流日志", - "description": "**适用于**:Chatflow、Workflow。\n\n列出过往的工作流运行,支持可选筛选。每条记录是运行级摘要(状态、Token 用量、步数和耗时),而非逐节点的执行日志。\n\n如需跟踪某次运行的节点级事件,请改用流式方式:\n\n- **自行发起的运行**:以流式模式调用 [执行工作流](/zh/api-reference/workflow-runs/run-workflow),运行执行时会发送 `node_started` 和 `node_finished` 事件。\n- **已在进行中的运行**:调用 [流式获取工作流事件](/zh/api-reference/workflow-runs/stream-workflow-events) 并附带 `include_state_snapshot=true`,先重放各已执行节点的状态,再流式发送其余事件。\n\n已结束运行的节点级日志无法通过服务 API 获取。", + "description": "**适用于**:Chatflow、Workflow。\n\n列出过往的工作流运行,支持可选筛选。每条记录是运行级摘要(状态、token 用量、步数和耗时),而非逐节点的执行日志。\n\n如需跟踪某次运行的节点级事件,请改用流式方式:\n\n- **自行发起的运行**:以流式模式调用 [执行工作流](/zh/api-reference/workflow-runs/run-workflow),运行执行时会发送 `node_started` 和 `node_finished` 事件。\n- **已在进行中的运行**:调用 [流式获取工作流事件](/zh/api-reference/workflow-runs/stream-workflow-events) 并附带 `include_state_snapshot=true`,先重放各已执行节点的状态,再流式发送其余事件。\n\n已结束运行的节点级日志无法通过服务 API 获取。", "operationId": "getWorkflowLogsCn", "tags": [ "工作流运行" @@ -5614,12 +5614,12 @@ }, "max_tokens": { "type": "integer", - "description": "每个分段的最大令牌数。" + "description": "每个分段的最大 token 数。" }, "chunk_overlap": { "type": "integer", "default": 0, - "description": "分段之间的令牌重叠数。" + "description": "分段之间的 token 重叠数。" } } } @@ -6421,7 +6421,7 @@ }, "tokens": { "type": "integer", - "description": "文档中的令牌数。" + "description": "文档中的 token 数。" }, "indexing_status": { "type": "string", @@ -7454,12 +7454,12 @@ }, "max_tokens": { "type": "integer", - "description": "每个分段的最大令牌数。" + "description": "每个分段的最大 token 数。" }, "chunk_overlap": { "type": "integer", "default": 0, - "description": "分段之间的令牌重叠数。" + "description": "分段之间的 token 重叠数。" } } } @@ -10250,7 +10250,7 @@ }, "tokens": { "type": "integer", - "description": "分段内容的令牌数。" + "description": "分段内容的 token 数。" }, "keywords": { "type": "array", @@ -13750,50 +13750,50 @@ "properties": { "prompt_tokens": { "type": "integer", - "description": "提示词中的令牌数。" + "description": "提示词中的 token 数。" }, "prompt_unit_price": { "type": "string", "format": "decimal", - "description": "每个提示词令牌的单价。" + "description": "每个提示词 token 的单价。" }, "prompt_price_unit": { "type": "string", "format": "decimal", - "description": "提示词令牌的价格单位。" + "description": "提示词 token 的价格单位。" }, "prompt_price": { "type": "string", "format": "decimal", - "description": "提示词令牌的总价。" + "description": "提示词 token 的总价。" }, "completion_tokens": { "type": "integer", - "description": "补全内容中的令牌数。" + "description": "补全内容中的 token 数。" }, "completion_unit_price": { "type": "string", "format": "decimal", - "description": "每个补全令牌的单价。" + "description": "每个补全 token 的单价。" }, "completion_price_unit": { "type": "string", "format": "decimal", - "description": "补全令牌的价格单位。" + "description": "补全 token 的价格单位。" }, "completion_price": { "type": "string", "format": "decimal", - "description": "补全令牌的总价。" + "description": "补全 token 的总价。" }, "total_tokens": { "type": "integer", - "description": "使用的令牌总数。" + "description": "使用的 token 总数。" }, "total_price": { "type": "string", "format": "decimal", - "description": "所有令牌的总价。" + "description": "所有 token 的总价。" }, "currency": { "type": "string", @@ -15326,7 +15326,7 @@ }, "total_tokens": { "type": "integer", - "description": "消耗的总令牌数。" + "description": "消耗的总 token 数。" }, "total_steps": { "type": "integer", @@ -15518,7 +15518,7 @@ "type": "object", "nullable": true, "additionalProperties": true, - "description": "执行元数据(例如令牌用量、模型信息)。在简化 API 响应中可能为 `null`。" + "description": "执行元数据(例如 token 用量、模型信息)。在简化 API 响应中可能为 `null`。" }, "created_at": { "type": "integer", @@ -15847,7 +15847,7 @@ }, "total_tokens": { "type": "integer", - "description": "所有迭代中消耗的令牌总数。" + "description": "所有迭代中消耗的 token 总数。" }, "created_at": { "type": "integer", @@ -16044,7 +16044,7 @@ }, "total_tokens": { "type": "integer", - "description": "所有循环迭代中消耗的令牌总数。" + "description": "所有循环迭代中消耗的 token 总数。" }, "created_at": { "type": "integer", @@ -16244,7 +16244,7 @@ }, "total_tokens": { "type": "integer", - "description": "消耗的总令牌数。" + "description": "消耗的总 token 数。" }, "total_steps": { "type": "integer", @@ -16512,7 +16512,7 @@ }, "total_tokens": { "type": "integer", - "description": "消耗的总令牌数。" + "description": "消耗的总 token 数。" }, "created_at": { "type": "integer", @@ -16644,7 +16644,7 @@ }, "total_tokens": { "type": "integer", - "description": "消耗的总令牌数。" + "description": "消耗的总 token 数。" }, "total_steps": { "type": "integer", @@ -17262,7 +17262,7 @@ }, "total_tokens": { "type": "integer", - "description": "所有节点消耗的总令牌数。" + "description": "所有节点消耗的总 token 数。" }, "total_steps": { "type": "integer", @@ -17540,12 +17540,12 @@ "execution_metadata": { "type": "object", "nullable": true, - "description": "执行元数据,包含令牌用量。", + "description": "执行元数据,包含 token 用量。", "properties": { "total_tokens": { "type": "integer", "nullable": true, - "description": "该节点消耗的总令牌数。" + "description": "该节点消耗的总 token 数。" }, "total_price": { "type": "number", @@ -17896,7 +17896,7 @@ "execution_metadata": { "type": "object", "additionalProperties": true, - "description": "执行元数据,包含令牌用量。" + "description": "执行元数据,包含 token 用量。" }, "finished_at": { "type": "integer", @@ -18088,7 +18088,7 @@ "execution_metadata": { "type": "object", "additionalProperties": true, - "description": "执行元数据,包含令牌用量。" + "description": "执行元数据,包含 token 用量。" }, "finished_at": { "type": "integer", @@ -18279,7 +18279,7 @@ }, "total_tokens": { "type": "integer", - "description": "消耗的总令牌数。" + "description": "消耗的总 token 数。" }, "total_steps": { "type": "integer", @@ -19211,7 +19211,7 @@ }, "tokens": { "type": "integer", - "description": "文档中的令牌总数。" + "description": "文档中的 token 总数。" }, "indexing_status": { "type": "string", @@ -19325,7 +19325,7 @@ }, "tokens": { "type": "integer", - "description": "分段内容的令牌数。" + "description": "分段内容的 token 数。" }, "keywords": { "type": "array", diff --git a/zh/cli/authenticate.mdx b/zh/cli/authenticate.mdx index 9190b0184..b4b854bf9 100644 --- a/zh/cli/authenticate.mdx +++ b/zh/cli/authenticate.mdx @@ -1,6 +1,6 @@ --- title: 认证 -description: 从 CLI 登录你的 Dify 主机,了解 token 的存储位置,并管理你的会话 +description: 从 CLI 登录你的 Dify 主机,了解令牌的存储位置,并管理你的会话 --- > 本文档由 AI 自动翻译。如有任何不准确之处,请参考 [英文原版](/en/cli/authenticate)。 @@ -58,7 +58,7 @@ description: 从 CLI 登录你的 Dify 主机,了解 token 的存储位置, 如果某条命令以 `auth_expired`(退出码 4)失败,说明服务器已使你的会话过期或将其吊销。 -重新运行 `difyctl auth login`。无需先登出,新的登录会刷新已存储的 token。 +重新运行 `difyctl auth login`。无需先登出,新的登录会刷新已存储的令牌。 ## 查看当前登录身份 @@ -92,15 +92,15 @@ difyctl auth logout ✓ Logged out of cloud.dify.ai ``` -这会吊销服务器上的会话,并从你的机器上删除 token 和会话记录。即便服务器端的吊销失败,本地凭据仍会被清除。 +这会吊销服务器上的会话,并从你的机器上删除令牌和会话记录。即便服务器端的吊销失败,本地凭据仍会被清除。 -## Token 的存储位置 +## 令牌的存储位置 -登录后会存储一个 OAuth bearer token,可通过 `dfoa_` 前缀识别。它代表你本人:你的账户在工作空间中能做什么,这个 token 在 CLI 中就能做什么。 +登录后会存储一个 OAuth Bearer 令牌,可通过 `dfoa_` 前缀识别。它代表你本人:你的账户在工作空间中能做什么,这个令牌在 CLI 中就能做什么。 -只要操作系统提供凭据存储,`difyctl` 就会把 token 存入其中:macOS 上是 Keychain,Windows 上是 Credential Manager,Linux 上是 Secret Service。如果没有可用的凭据存储,则回退到 `difyctl` 配置目录下一个权限为 `0600` 的 `tokens.yml` 文件。 +只要操作系统提供凭据存储,`difyctl` 就会把令牌存入其中:macOS 上是 Keychain,Windows 上是 Credential Manager,Linux 上是 Secret Service。如果没有可用的凭据存储,则回退到 `difyctl` 配置目录下一个权限为 `0600` 的 `tokens.yml` 文件。 -`difyctl` 在你登录时选定存储位置,此后整个会话都使用它。会话元数据(主机、账户、工作空间)与 token 一同保存在 `hosts.yml` 中。 +`difyctl` 在你登录时选定存储位置,此后整个会话都使用它。会话元数据(主机、账户、工作空间)与令牌一同保存在 `hosts.yml` 中。 配置目录在 macOS 和 Linux 上是 `~/.config/difyctl`(Linux 遵循 `XDG_CONFIG_HOME`),在 Windows 上是 `%APPDATA%\difyctl`。设置 [`DIFY_CONFIG_DIR`](/zh/cli/reference/environment-variables) 可覆盖此路径。 diff --git a/zh/cli/integrate-agents/auth-for-agent-deployments.mdx b/zh/cli/integrate-agents/auth-for-agent-deployments.mdx index 044bea56e..3a6c23ed8 100644 --- a/zh/cli/integrate-agents/auth-for-agent-deployments.mdx +++ b/zh/cli/integrate-agents/auth-for-agent-deployments.mdx @@ -40,9 +40,9 @@ difyctl auth whoami - 使用无界面的 Linux 服务器或容器。在没有钥匙串时,`difyctl` 会把 token 保存到 [配置目录](/zh/cli/authenticate#token-的存储位置) 下的 `tokens.yml`,使整个目录可移植。 + 使用无界面的 Linux 服务器或容器。在没有钥匙串时,`difyctl` 会把令牌保存到 [配置目录](/zh/cli/authenticate#令牌的存储位置) 下的 `tokens.yml`,使整个目录可移植。 - 复制之前,先确认配置目录(默认为 `~/.config/difyctl`)中存在 `tokens.yml`。如果文件缺失,说明 token 已被钥匙串捕获,且无法导出;请在目标机器上直接通过 [方式一:在目标机器上登录](#方式一:在目标机器上登录) 登录。 + 复制之前,先确认配置目录(默认为 `~/.config/difyctl`)中存在 `tokens.yml`。如果文件缺失,说明令牌已被钥匙串捕获,且无法导出;请在目标机器上直接通过 [方式一:在目标机器上登录](#方式一:在目标机器上登录) 登录。 复制后,用 [`DIFY_CONFIG_DIR`](/zh/cli/reference/environment-variables) 让 `difyctl` 指向该目录。对于容器,应在运行时挂载该目录,而不是把它打包进镜像: diff --git a/zh/cli/quick-start.mdx b/zh/cli/quick-start.mdx index 2fcb5a4d3..e12bc28df 100644 --- a/zh/cli/quick-start.mdx +++ b/zh/cli/quick-start.mdx @@ -93,5 +93,5 @@ Daily Report 7f3e9a2b-1c4d-4e8f-9a0b-2d5c8e1f4a7b workflow 2026-06-05T22:41:0 ## 后续步骤 - **开箱即用的日常命令**:[常见任务](/zh/cli/common-tasks) -- **token 存储位置与会话机制**:[认证](/zh/cli/authenticate) +- **令牌存储位置与会话机制**:[认证](/zh/cli/authenticate) - **`difyctl` 的其余全部能力**:[命令索引](/zh/cli/reference/command-index) diff --git a/zh/cli/reference/apps.mdx b/zh/cli/reference/apps.mdx index 494dc8090..aa83e6af6 100644 --- a/zh/cli/reference/apps.mdx +++ b/zh/cli/reference/apps.mdx @@ -36,7 +36,7 @@ difyctl get app [app-id] [flags] | `--page ` | integer | `1` | 页码。 | | `--limit ` | integer | `20` | 每页数量,1 到 200。该标志优先,其次是 [`DIFY_LIMIT`](/zh/cli/reference/environment-variables)。 | | `--workspace ` Cloud | string | 当前活跃工作空间 | 仅本次调用针对另一个工作空间运行。



`difyctl` 如何解析工作空间,参见 [difyctl 如何选择工作空间](/zh/cli/reference/workspaces#difyctl-如何选择工作空间)。 | -| `-A, --all-workspaces` Cloud | boolean | `false` | 列出你的 token 可见的所有工作空间中的应用。 | +| `-A, --all-workspaces` Cloud | boolean | `false` | 列出你的令牌可见的所有工作空间中的应用。 | | `-o ` | string | 无 | 输出格式:`json`、`yaml`、`name` 或 `wide`。省略该标志则输出默认表格。 | ### 示例 @@ -343,7 +343,7 @@ difyctl resume app --workflow-run-id [flags] ### 参数 - ``:必填。来自暂停载荷的 `app_id`。 -- ``:必填。来自暂停载荷的 `form_token`。Token 仅可使用一次,因此用已消费的 token 恢复会返回错误。 +- ``:必填。来自暂停载荷的 `form_token`。令牌仅可使用一次,因此用已消费的令牌恢复会返回错误。 ### 标志 @@ -393,14 +393,14 @@ difyctl resume app 7f3e9a2b-1c4d-4e8f-9a0b-2d5c8e1f4a7b k3J9mQ2xWv8pL5nR7tY4bA - ✓ workflow finished ``` -恢复后的工作流可能在后续的人工介入节点再次暂停。届时你会得到一个新的暂停载荷,并用新 token 再次恢复。 +恢复后的工作流可能在后续的人工介入节点再次暂停。届时你会得到一个新的暂停载荷,并用新令牌再次恢复。 ### 退出码 | 退出码 | 含义 | |:---|:---| | `0` | 成功,包括运行在后续节点再次暂停 | -| `1` | 错误,包括 token 已被消费,或在有多个操作的表单上省略了 `--action` | +| `1` | 错误,包括令牌已被消费,或在有多个操作的表单上省略了 `--action` | | `2` | 用法错误 | | `4` | 认证失败 | | `7` | 触发限流(HTTP 429) | diff --git a/zh/cli/reference/auth-and-contexts.mdx b/zh/cli/reference/auth-and-contexts.mdx index 0e9cb29df..f31a78b98 100644 --- a/zh/cli/reference/auth-and-contexts.mdx +++ b/zh/cli/reference/auth-and-contexts.mdx @@ -5,7 +5,7 @@ description: 登录、管理会话,并在已保存的主机和账户之间切 > 本文档由 AI 自动翻译。如有任何不准确之处,请参考 [英文原版](/en/cli/reference/auth-and-contexts)。 -`difyctl` 可同时保持对多个 Dify 主机和账户的登录状态。每一对主机和账户构成一个上下文:其元数据保存在 [配置目录](/zh/cli/reference/environment-variables) 下的 `hosts.yml` 中,其 bearer token 则保存在操作系统的凭据存储中(并以受保护文件作为回退方案)。 +`difyctl` 可同时保持对多个 Dify 主机和账户的登录状态。每一对主机和账户构成一个上下文:其元数据保存在 [配置目录](/zh/cli/reference/environment-variables) 下的 `hosts.yml` 中,其 Bearer 令牌则保存在操作系统的凭据存储中(并以受保护文件作为回退方案)。 每项任务对应一条命令: @@ -67,7 +67,7 @@ difyctl auth login --no-browser `Workspace:` 这一行是你的默认工作空间。 -每次登录还会注册一个服务端会话,标签为 `difyctl on `。运行 [`auth devices list`](#列出活跃会话) 可查看你的所有会话。登录到一个已登录的主机,会刷新该上下文中存储的 token。 +每次登录还会注册一个服务端会话,标签为 `difyctl on `。运行 [`auth devices list`](#列出活跃会话) 可查看你的所有会话。登录到一个已登录的主机,会刷新该上下文中存储的令牌。 ### 退出码 @@ -88,7 +88,7 @@ difyctl auth login --no-browser difyctl auth whoami [flags] ``` -`auth whoami` 打印当前上下文所属的身份。它读取存储的上下文,不会联系服务器,因此回答的是「当前活跃的是哪个身份」,而不是「token 是否仍然有效」。即使会话已在服务端过期,它也会以 `0` 退出。 +`auth whoami` 打印当前上下文所属的身份。它读取存储的上下文,不会联系服务器,因此回答的是「当前活跃的是哪个身份」,而不是「令牌是否仍然有效」。即使会话已在服务端过期,它也会以 `0` 退出。 ### 标志 @@ -197,11 +197,11 @@ dify.internal.acme.com you@acme.com (Your Name) difyctl auth logout ``` -`auth logout` 会在服务端撤销当前上下文的会话,然后从本机删除其 token 和 `hosts.yml` 条目。其他已保存的上下文不受影响。 +`auth logout` 会在服务端撤销当前上下文的会话,然后从本机删除其令牌和 `hosts.yml` 条目。其他已保存的上下文不受影响。 本地清理始终会执行。如果服务端撤销失败,`difyctl` 会在 stderr 打印一条警告,并照常清除你的凭据。 -token 存放在操作系统钥匙串中、而退出登录时又无法读取(已锁定,或没有桌面会话)时也是如此:跳过撤销,本地清理仍会执行。 +令牌存放在操作系统钥匙串中、而退出登录时又无法读取(已锁定,或没有桌面会话)时也是如此:跳过撤销,本地清理仍会执行。 ### 标志 @@ -296,7 +296,7 @@ difyctl use account --email teammate-bot@company.com ✓ Active account on cloud.dify.ai is now teammate-bot@company.com ``` -如果某邮箱未存储在当前主机上,则会以用法错误失败,并列出已知的账户。如果某账户已存储的 token 不复存在(已撤销,或被 [会话撤销](#撤销会话) 清除),则会以未登录错误失败,并提示你重新登录。 +如果某邮箱未存储在当前主机上,则会以用法错误失败,并列出已知的账户。如果某账户已存储的令牌不复存在(已撤销,或被 [会话撤销](#撤销会话) 清除),则会以未登录错误失败,并提示你重新登录。 ### 退出码 diff --git a/zh/cli/reference/global-flags.mdx b/zh/cli/reference/global-flags.mdx index 463803cf3..7c4394645 100644 --- a/zh/cli/reference/global-flags.mdx +++ b/zh/cli/reference/global-flags.mdx @@ -32,7 +32,7 @@ description: 在 difyctl 命令中使用这些标志,控制输出格式、详 ## 详细模式 -`-v` 会在 stderr 上增加详细的 HTTP 日志,并在错误输出中包含 `raw_response` 字段(即原始服务端响应,其中的 bearer token 已脱敏)。 +`-v` 会在 stderr 上增加详细的 HTTP 日志,并在错误输出中包含 `raw_response` 字段(即原始服务端响应,其中的 Bearer 令牌已脱敏)。 当请求失败、而常规错误信息无法说明原因时使用它。 diff --git a/zh/cli/reference/output-formats-and-exit-codes.mdx b/zh/cli/reference/output-formats-and-exit-codes.mdx index 8a85148f6..69609f8d2 100644 --- a/zh/cli/reference/output-formats-and-exit-codes.mdx +++ b/zh/cli/reference/output-formats-and-exit-codes.mdx @@ -68,7 +68,7 @@ hint: run 'difyctl auth login' | `hint` | 已知时 | 最快的修复方式,通常是可直接复制粘贴的命令。 | | `http_status` | HTTP 失败时 | 失败请求的状态码。 | | `method`、`url` | HTTP 失败时 | 失败的那个请求。 | -| `raw_response` | 仅在 `-v` 下 | 服务器原始响应体,bearer token 已脱敏。 | +| `raw_response` | 仅在 `-v` 下 | 服务器原始响应体,Bearer 令牌已脱敏。 | | `server` | HTTP 失败且响应为 Dify 标准错误体时 | 服务器自身的错误:`code`、`message`、`status`,以及可选的 `hint` 和 `details`。



顶层 `code` 仍为 CLI 稳定的传输层错误码;`server.code` 携带服务器更细粒度的原因。 | 各错误码的含义及修复方法,详见 [故障排查](/zh/cli/troubleshooting)。 diff --git a/zh/cli/troubleshooting.mdx b/zh/cli/troubleshooting.mdx index c2dd66645..e595b5cfa 100644 --- a/zh/cli/troubleshooting.mdx +++ b/zh/cli/troubleshooting.mdx @@ -76,7 +76,7 @@ difyctl auth login ### 应用未找到(HTTP 404) -指定的应用 ID 不存在,或当前 token 无权访问。表现为 `server_4xx_other`,HTTP 状态码为 404。 +指定的应用 ID 不存在,或当前令牌无权访问。表现为 `server_4xx_other`,HTTP 状态码为 404。 1. 列出有权访问的应用: diff --git a/zh/cloud/use-dify/knowledge/create-knowledge/import-text-data/sync-from-notion.mdx b/zh/cloud/use-dify/knowledge/create-knowledge/import-text-data/sync-from-notion.mdx index 644316513..478d58e59 100644 --- a/zh/cloud/use-dify/knowledge/create-knowledge/import-text-data/sync-from-notion.mdx +++ b/zh/cloud/use-dify/knowledge/create-knowledge/import-text-data/sync-from-notion.mdx @@ -41,7 +41,7 @@ Notion 通过 Dify 预置的集成连接。完成一次工作空间授权即可 ### 同步 Notion 数据 -如果你的 Notion 内容有更新,可以在知识库的 **文档列表页** 中点击对应内容页的 **同步** 按钮进行数据同步。同步文档涉及嵌入过程,因此将消耗嵌入模型的 Tokens。 +如果你的 Notion 内容有更新,可以在知识库的 **文档列表页** 中点击对应内容页的 **同步** 按钮进行数据同步。同步文档涉及嵌入过程,因此将消耗嵌入模型的 token。 ![同步 Notion 内容](https://assets-docs.dify.ai/2024/12/af7cabd98c3aac392819d9041cc408de.png) diff --git a/zh/cloud/use-dify/knowledge/create-knowledge/setting-indexing-methods.mdx b/zh/cloud/use-dify/knowledge/create-knowledge/setting-indexing-methods.mdx index cb75f1049..59f402da6 100644 --- a/zh/cloud/use-dify/knowledge/create-knowledge/setting-indexing-methods.mdx +++ b/zh/cloud/use-dify/knowledge/create-knowledge/setting-indexing-methods.mdx @@ -43,7 +43,7 @@ sidebarTitle: 设置索引与检索 - 在经济模式下,每个区块内使用 10 个关键词进行检索,降低了准确度但无需消耗 Token。对于检索到的区块,仅提供倒排索引方式选择最相关的区块。 + 在经济模式下,每个区块内使用 10 个关键词进行检索,降低了准确度但无需消耗 token。对于检索到的区块,仅提供倒排索引方式选择最相关的区块。 如果经济型索引方式的效果不符合预期,可以在知识库设置页中升级为高质量索引方式。 @@ -92,7 +92,7 @@ Dify 的知识库支持这两种检索方式。具体可用的检索选项取决 若选择的嵌入模型为多模态,需同样选择多模态 Rerank 模型(带有 **Vision** 图标)。否则,检索到的图片将在重排序和检索结果中被排除。 -> 开启该功能后,将消耗 Rerank 模型的 Token。详情请参考对应模型的价格说明。 +> 开启该功能后,将消耗 Rerank 模型的 token。详情请参考对应模型的价格说明。 **TopK**:用于确定检索与用户问题相似度最高的文本分段数量。系统同时会根据选用模型上下文窗口大小动态调整分段数量。默认值为 **3**,数值越高,预期被召回的文本分段数量越多。 @@ -114,7 +114,7 @@ Dify 的知识库支持这两种检索方式。具体可用的检索选项取决 若选择的嵌入模型为多模态,需同样选择多模态 Rerank 模型(带有 **Vision** 图标)。否则,检索到的图片将在重排序和检索结果中被排除。 -> 开启该功能后,将消耗 Rerank 模型的 Token。详情请参考对应模型的价格说明。 +> 开启该功能后,将消耗 Rerank 模型的 token。详情请参考对应模型的价格说明。 **TopK**:用于确定检索与用户问题相似度最高的文本分段数量。系统同时会根据选用模型上下文窗口大小动态调整分段数量。默认值为 **3**,数值越高,预期被召回的文本分段数量越多。 @@ -153,7 +153,7 @@ Dify 的知识库支持这两种检索方式。具体可用的检索选项取决 若选择的嵌入模型为多模态,需同样选择多模态 Rerank 模型(带有 **Vision** 图标)。否则,检索到的图片将在重排序和检索结果中被排除。 - > 开启该功能后,将消耗 Rerank 模型的 Token。详情请参考对应模型的价格说明。 + > 开启该功能后,将消耗 Rerank 模型的 token。详情请参考对应模型的价格说明。 **"权重设置"** 和 **"Rerank 模型"** 设置支持以下选项: diff --git a/zh/cloud/use-dify/monitor/analysis.mdx b/zh/cloud/use-dify/monitor/analysis.mdx index 6b0de7a01..62176bbdd 100644 --- a/zh/cloud/use-dify/monitor/analysis.mdx +++ b/zh/cloud/use-dify/monitor/analysis.mdx @@ -14,6 +14,6 @@ description: "通过 Dify 内置的分析仪表盘监控性能、成本和用户 **Total Messages**:对话量 **Active Users**:有意义互动的用户(多于一次的交互) **Average User Interactions**:每次会话的参与深度 -**Token Usage**:资源消耗和成本 +**费用消耗**:资源消耗和成本 使用时间选择器查看不同时间段的趋势。点击 **"Tracing app performance"** 以连接外部可观察性平台,如 Langfuse 或 LangSmith,以获得更深入的分析。 diff --git a/zh/cloud/use-dify/monitor/integrations/integrate-aliyun.mdx b/zh/cloud/use-dify/monitor/integrations/integrate-aliyun.mdx index 699ae6b43..b8a970461 100644 --- a/zh/cloud/use-dify/monitor/integrations/integrate-aliyun.mdx +++ b/zh/cloud/use-dify/monitor/integrations/integrate-aliyun.mdx @@ -117,9 +117,9 @@ title: 集成阿里云云监控 * message\_data - 消息数据 * user\_session\_id - 用户的 session\_id * conversation\_model - 对话模式 -* message\_tokens - 消息中的令牌数 -* answer\_tokens - 回答中的令牌数 -* total\_tokens - 消息和回答中的总令牌数 +* message\_tokens - 消息中的 token 数 +* answer\_tokens - 回答中的 token 数 +* total\_tokens - 消息和回答中的总 token 数 * error - 错误信息 * inputs - 输入数据 * outputs - 输出数据 diff --git a/zh/cloud/use-dify/monitor/integrations/integrate-arize.mdx b/zh/cloud/use-dify/monitor/integrations/integrate-arize.mdx index 32541482a..1ab589242 100644 --- a/zh/cloud/use-dify/monitor/integrations/integrate-arize.mdx +++ b/zh/cloud/use-dify/monitor/integrations/integrate-arize.mdx @@ -76,7 +76,7 @@ title: 集成 Arize - elapsed_time - 当前运行所用时间 - status - 运行状态 - version - 工作流版本 -- total_tokens - 当前运行使用的总令牌数 +- total_tokens - 当前运行使用的总 token 数 - file_list - 处理的文件列表 - triggered_from - 触发当前运行的来源 - workflow_run_inputs - 当前运行的输入数据 @@ -96,7 +96,7 @@ title: 集成 Arize - elapsed_time - 当前运行所用时间 - status - 运行状态 - version - 工作流版本 - - total_tokens - 当前运行使用的总令牌数 + - total_tokens - 当前运行使用的总 token 数 - file_list - 处理的文件列表 - triggered_from - 触发当前运行的来源 @@ -124,9 +124,9 @@ title: 集成 Arize - message_data - 消息数据 - user_session_id - 用户会话 ID - conversation_model - 对话模式 -- message_tokens - 消息中的令牌数 -- answer_tokens - 答案中的令牌数 -- total_tokens - 消息和答案中的总令牌数 +- message_tokens - 消息中的 token 数 +- answer_tokens - 答案中的 token 数 +- total_tokens - 消息和答案中的总 token 数 - error - 错误信息 - inputs - 输入数据 - outputs - 输出数据 @@ -201,7 +201,7 @@ title: 集成 Arize - outputs - 输出内容 - start_time - 开始时间 - end_time - 结束时间 -- total_tokens - 令牌数量 +- total_tokens - Token 数量 - status - 消息状态 - error - 错误信息 - from_account_id - 发送账户的 ID diff --git a/zh/cloud/use-dify/monitor/integrations/integrate-langfuse.mdx b/zh/cloud/use-dify/monitor/integrations/integrate-langfuse.mdx index f61a95759..76a480327 100644 --- a/zh/cloud/use-dify/monitor/integrations/integrate-langfuse.mdx +++ b/zh/cloud/use-dify/monitor/integrations/integrate-langfuse.mdx @@ -156,7 +156,7 @@ Langfuse 是一个开源的大型语言模型工程平台,帮助团队协作 * elapsed\_time - 此运行时的经过时间 * status - 运行时状态 * version - 工作流版本 -* total\_tokens - 此运行时使用的总标记数 +* total\_tokens - 此运行时使用的总 token 数 * file\_list - 处理文件的列表 * triggered\_from - 触发此运行时的来源 * workflow\_run\_inputs - 此工作流的输入 @@ -176,7 +176,7 @@ Langfuse 是一个开源的大型语言模型工程平台,帮助团队协作 * elapsed\_time - 此运行时的经过时间 * status - 操作状态 * version - 工作流版本 - * total\_tokens - 此运行时使用的总标记数 + * total\_tokens - 此运行时使用的总 token 数 * file\_list - 处理文件的列表 * triggered\_from - 触发此运行时的来源 @@ -256,9 +256,9 @@ Langfuse 是一个开源的大型语言模型工程平台,帮助团队协作 * message\_data - 消息数据 * user\_session\_id - 用户会话 ID * conversation\_model - 对话模型 -* message\_tokens - 消息标记数 -* answer\_tokens - 回答标记数 -* total\_tokens - 消息和回答的总标记数 +* message\_tokens - 消息 token 数 +* answer\_tokens - 回答 token 数 +* total\_tokens - 消息和回答的总 token 数 * error - 错误信息 * inputs - 输入数据 * outputs - 输出数据 @@ -404,7 +404,7 @@ Langfuse 是一个开源的大型语言模型工程平台,帮助团队协作 * outputs - 输出数据 * start\_time - 开始时间 * end\_time - 结束时间 -* total\_tokens - 总标记数 +* total\_tokens - 总 token 数 * status - 消息状态 * error - 错误信息 * from\_account\_id - 发送账户 ID diff --git a/zh/cloud/use-dify/monitor/integrations/integrate-langsmith.mdx b/zh/cloud/use-dify/monitor/integrations/integrate-langsmith.mdx index 76c565c81..e031f9346 100644 --- a/zh/cloud/use-dify/monitor/integrations/integrate-langsmith.mdx +++ b/zh/cloud/use-dify/monitor/integrations/integrate-langsmith.mdx @@ -179,9 +179,9 @@ LangSmith [官网介绍](https://www.langchain.com/langsmith) * message\_data - 消息数据 * user\_session\_id - 用户的 session\_id * conversation\_model - 对话模式 -* message\_tokens - 消息中的令牌数 -* answer\_tokens - 回答中的令牌数 -* total\_tokens - 消息和回答中的总令牌数 +* message\_tokens - 消息中的 token 数 +* answer\_tokens - 回答中的 token 数 +* total\_tokens - 消息和回答中的总 token 数 * error - 错误信息 * inputs - 输入数据 * outputs - 输出数据 @@ -259,7 +259,7 @@ LangSmith [官网介绍](https://www.langchain.com/langsmith) * outputs - 输出的内容 * start\_time - 开始时间 * end\_time - 结束时间 -* total\_tokens - 令牌数量 +* total\_tokens - Token 数量 * status - 消息状态 * error - 错误信息 * from\_account\_id - 发送账户的 ID diff --git a/zh/cloud/use-dify/monitor/integrations/integrate-opik.mdx b/zh/cloud/use-dify/monitor/integrations/integrate-opik.mdx index c0d7200ec..b1eda1bf4 100644 --- a/zh/cloud/use-dify/monitor/integrations/integrate-opik.mdx +++ b/zh/cloud/use-dify/monitor/integrations/integrate-opik.mdx @@ -92,7 +92,7 @@ Opik 是一个开源的 LLM 评估平台,用于评估、测试和监控大型 - elapsed_time - 当前运行所用时间 - status - 运行状态 - version - 工作流版本 -- total_tokens - 当前运行使用的总令牌数 +- total_tokens - 当前运行使用的总 token 数 - file_list - 处理的文件列表 - triggered_from - 触发当前运行的来源 - workflow_run_inputs - 当前运行的输入数据 @@ -112,7 +112,7 @@ Opik 是一个开源的 LLM 评估平台,用于评估、测试和监控大型 - elapsed_time - 当前运行所用时间 - status - 运行状态 - version - 工作流版本 - - total_tokens - 当前运行使用的总令牌数 + - total_tokens - 当前运行使用的总 token 数 - file_list - 处理的文件列表 - triggered_from - 触发当前运行的来源 @@ -140,9 +140,9 @@ Opik 是一个开源的 LLM 评估平台,用于评估、测试和监控大型 - message_data - 消息数据 - user_session_id - 用户会话 ID - conversation_model - 对话模式 -- message_tokens - 消息中的令牌数 -- answer_tokens - 答案中的令牌数 -- total_tokens - 消息和答案中的总令牌数 +- message_tokens - 消息中的 token 数 +- answer_tokens - 答案中的 token 数 +- total_tokens - 消息和答案中的总 token 数 - error - 错误信息 - inputs - 输入数据 - outputs - 输出数据 @@ -217,7 +217,7 @@ Opik 是一个开源的 LLM 评估平台,用于评估、测试和监控大型 - outputs - 输出内容 - start_time - 开始时间 - end_time - 结束时间 -- total_tokens - 令牌数量 +- total_tokens - Token 数量 - status - 消息状态 - error - 错误信息 - from_account_id - 发送账户的 ID diff --git a/zh/cloud/use-dify/monitor/integrations/integrate-phoenix.mdx b/zh/cloud/use-dify/monitor/integrations/integrate-phoenix.mdx index 7a14b984b..4113339f0 100644 --- a/zh/cloud/use-dify/monitor/integrations/integrate-phoenix.mdx +++ b/zh/cloud/use-dify/monitor/integrations/integrate-phoenix.mdx @@ -126,7 +126,7 @@ title: 集成 Phoenix - elapsed_time - 当前运行所用时间 - status - 运行状态 - version - 工作流版本 -- total_tokens - 当前运行使用的总令牌数 +- total_tokens - 当前运行使用的总 token 数 - file_list - 处理的文件列表 - triggered_from - 触发当前运行的来源 - workflow_run_inputs - 当前运行的输入数据 @@ -146,7 +146,7 @@ title: 集成 Phoenix - elapsed_time - 当前运行所用时间 - status - 运行状态 - version - 工作流版本 - - total_tokens - 当前运行使用的总令牌数 + - total_tokens - 当前运行使用的总 token 数 - file_list - 处理的文件列表 - triggered_from - 触发当前运行的来源 @@ -174,9 +174,9 @@ title: 集成 Phoenix - message_data - 消息数据 - user_session_id - 用户会话 ID - conversation_model - 对话模式 -- message_tokens - 消息中的令牌数 -- answer_tokens - 答案中的令牌数 -- total_tokens - 消息和答案中的总令牌数 +- message_tokens - 消息中的 token 数 +- answer_tokens - 答案中的 token 数 +- total_tokens - 消息和答案中的总 token 数 - error - 错误信息 - inputs - 输入数据 - outputs - 输出数据 @@ -251,7 +251,7 @@ title: 集成 Phoenix - outputs - 输出内容 - start_time - 开始时间 - end_time - 结束时间 -- total_tokens - 令牌数量 +- total_tokens - Token 数量 - status - 消息状态 - error - 错误信息 - from_account_id - 发送账户的 ID diff --git a/zh/cloud/use-dify/monitor/integrations/integrate-weave.mdx b/zh/cloud/use-dify/monitor/integrations/integrate-weave.mdx index 304323f83..69b76dcbf 100644 --- a/zh/cloud/use-dify/monitor/integrations/integrate-weave.mdx +++ b/zh/cloud/use-dify/monitor/integrations/integrate-weave.mdx @@ -70,7 +70,7 @@ Weights & Biases (W&B) Weave 是一个用于跟踪、实验、评估、部署和 | end_time | end_time | | inputs | inputs | | outputs | outputs | -| 模型令牌消耗 | usage_metadata | +| 模型 token 消耗 | usage_metadata | | metadata | extra | | error | error | | workflow | tags | @@ -86,7 +86,7 @@ Weights & Biases (W&B) Weave 是一个用于跟踪、实验、评估、部署和 * elapsed_time - 当前运行所花费的时间 * status - 运行状态 * version - 工作流版本 -* total_tokens - 当前运行中使用的总令牌数 +* total_tokens - 当前运行中使用的总 token 数 * file_list - 处理的文件列表 * triggered_from - 触发当前运行的来源 * workflow_run_inputs - 当前运行的输入数据 @@ -106,7 +106,7 @@ Weights & Biases (W&B) Weave 是一个用于跟踪、实验、评估、部署和 * elapsed_time - 当前运行所花费的时间 * status - 运行状态 * version - 工作流版本 - * total_tokens - 当前运行中使用的总令牌数 + * total_tokens - 当前运行中使用的总 token 数 * file_list - 处理的文件列表 * triggered_from - 触发当前运行的来源 @@ -123,7 +123,7 @@ Weights & Biases (W&B) Weave 是一个用于跟踪、实验、评估、部署和 | end_time | end_time | | inputs | inputs | | outputs | outputs | -| 模型令牌消耗 | usage_metadata | +| 模型 token 消耗 | usage_metadata | | metadata | extra | | error | error | | "message", conversation_mode | tags | @@ -136,9 +136,9 @@ Weights & Biases (W&B) Weave 是一个用于跟踪、实验、评估、部署和 * message_data - 消息数据 * user_session_id - 用户会话 ID * conversation_model - 对话模式 -* message_tokens - 消息中的令牌数 -* answer_tokens - 回答中的令牌数 -* total_tokens - 消息和回答中的总令牌数 +* message_tokens - 消息中的 token 数 +* answer_tokens - 回答中的 token 数 +* total_tokens - 消息和回答中的总 token 数 * error - 错误信息 * inputs - 输入数据 * outputs - 输出数据 @@ -215,7 +215,7 @@ Weights & Biases (W&B) Weave 是一个用于跟踪、实验、评估、部署和 * outputs - 输出内容 * start_time - 开始时间 * end_time - 结束时间 -* total_tokens - 令牌数 +* total_tokens - Token 数 * status - 消息状态 * error - 错误信息 * from_account_id - 发送账户的 ID diff --git a/zh/cloud/use-dify/nodes/agent.mdx b/zh/cloud/use-dify/nodes/agent.mdx index 79e480235..4733c49b7 100644 --- a/zh/cloud/use-dify/nodes/agent.mdx +++ b/zh/cloud/use-dify/nodes/agent.mdx @@ -71,7 +71,7 @@ Agent 策略定义了你的 Agent 如何思考和行动。选择最适合你的 **最大迭代次数** 设置安全限制以防止无限循环。根据任务复杂性进行配置 - 简单任务需要 3-5 次迭代,而复杂研究可能需要 10-15 次。 -**记忆** 控制 Agent 使用 TokenBufferMemory 记提供更多上下文,但会增加标记成本。这使得对话连续性成为可能,用户可以引用以前的行动。 +**记忆** 控制 Agent 使用 TokenBufferMemory 记提供更多上下文,但会增加 token 成本。这使得对话连续性成为可能,用户可以引用以前的行动。 ### 工具参数自动生成 @@ -113,4 +113,4 @@ Agent 节点提供全面的输出,包括: **详细的指令** 提供关于 Agent 角色、目标以及任何约束或偏好的上下文。 -**记忆管理** 根据你的用例要求平衡上下文保留与标记效率。 +**记忆管理** 根据你的用例要求平衡上下文保留与 token 效率。 diff --git a/zh/cloud/use-dify/nodes/iteration.mdx b/zh/cloud/use-dify/nodes/iteration.mdx index 590bc8d35..ce4355f65 100644 --- a/zh/cloud/use-dify/nodes/iteration.mdx +++ b/zh/cloud/use-dify/nodes/iteration.mdx @@ -141,7 +141,7 @@ title: "迭代" ## 常见用例 -**标记数限制管理** - 当内容超过大型语言模型上下文窗口时,将大文本分解为块进行翻译、摘要或分析。 +**Token 数限制管理** - 当内容超过大型语言模型上下文窗口时,将大文本分解为块进行翻译、摘要或分析。 **批处理** - 高效地对多个项目应用相同操作,例如处理多个文档或 API 调用。 diff --git a/zh/cloud/use-dify/nodes/llm.mdx b/zh/cloud/use-dify/nodes/llm.mdx index 3cb641c40..b53b4cda0 100644 --- a/zh/cloud/use-dify/nodes/llm.mdx +++ b/zh/cloud/use-dify/nodes/llm.mdx @@ -103,8 +103,8 @@ Question: {{user_question}} ### 视觉能力配置 处理图像时,你可以控制细节级别: -- **高细节** - 对复杂图像具有更好的准确性但使用更多令牌 -- **低细节** - 对简单图像进行更快处理,使用较少令牌 +- **高** - 对复杂图像具有更好的准确性但使用更多 token +- **低** - 对简单图像进行更快处理,使用较少 token 视觉能力的默认变量选择器是 `userinput.files`,它会自动从用户输入节点获取文件。 diff --git a/zh/cloud/use-dify/workspace/api-extension/api-extension.mdx b/zh/cloud/use-dify/workspace/api-extension/api-extension.mdx index b2b558947..f29d10d15 100644 --- a/zh/cloud/use-dify/workspace/api-extension/api-extension.mdx +++ b/zh/cloud/use-dify/workspace/api-extension/api-extension.mdx @@ -27,7 +27,7 @@ POST {Your-API-Endpoint} | Header | Value | Desc | | --------------- | ----------------- | --------------------------------------------------------------------- | | `Content-Type` | application/json | 请求内容为 JSON 格式。 | -| `Authorization` | Bearer \{api_key\} | API Key 以 Token 令牌的方式传输,你需要解析该 `api_key` 并确认是否和提供的 API Key 一致,保证接口安全。 | +| `Authorization` | Bearer \{api_key\} | API Key 作为 Bearer 令牌传输,你需要解析该 `api_key` 并确认是否和提供的 API Key 一致,保证接口安全。 | ### Request Body @@ -236,7 +236,7 @@ API 返回为: 2. 下载完成后,进入下载目录,根据下方说明解压压缩包,并执行说明中的初始化脚本。 ```shell unzip /path/to/ngrok.zip - ./ngrok config add-authtoken 你的 Token + ./ngrok config add-authtoken 你的令牌 ``` 3. 查看本地 API 服务的端口: diff --git a/zh/cloud/use-dify/workspace/api-extension/cloudflare-worker.mdx b/zh/cloud/use-dify/workspace/api-extension/cloudflare-worker.mdx index c409cef1f..b53988096 100644 --- a/zh/cloud/use-dify/workspace/api-extension/cloudflare-worker.mdx +++ b/zh/cloud/use-dify/workspace/api-extension/cloudflare-worker.mdx @@ -19,7 +19,7 @@ cp wrangler.toml.example wrangler.toml 打开 `wrangler.toml` 文件,修改 `name` 和 `compatibility_date` 为你的应用名称和兼容日期。 -这里我们需要注意的配置就是 `vars` 里面的 `TOKEN`,在 Dify 添加自定义端点的时候,我们需要填写这个 Token。出于安全考虑,我们建议你使用一个随机的字符串作为 Token,你不应该在源代码中直接写入 Token,而是使用环境变量的方式来传递 Token。所以请不要把 wrangler.toml 提交到你的代码仓库中。 +这里我们需要注意的配置就是 `vars` 里面的 `TOKEN`,在 Dify 添加自定义端点的时候,我们需要填写这个令牌。出于安全考虑,我们建议你使用一个随机的字符串作为令牌,你不应该在源代码中直接写入令牌,而是使用环境变量的方式来传递令牌。所以请不要把 wrangler.toml 提交到你的代码仓库中。 ```toml name = "dify-extension-example" @@ -91,7 +91,7 @@ import { bearerAuth } from "hono/bearer-auth"; }, ``` -我们的 Bearer 校验逻辑在如上代码中,我们使用了 `hono/bearer-auth` 这个包来实现 Bearer 校验。你可以在 `src/index.ts` 中使用 `c.env.TOKEN` 来获取 Token。 +我们的 Bearer 校验逻辑在如上代码中,我们使用了 `hono/bearer-auth` 这个包来实现 Bearer 校验。你可以在 `src/index.ts` 中使用 `c.env.TOKEN` 来获取令牌。 ## 关于参数验证 diff --git a/zh/develop-plugin/features-and-specs/advanced-development/customizable-model.mdx b/zh/develop-plugin/features-and-specs/advanced-development/customizable-model.mdx index 81a106d14..ad5cb51fd 100644 --- a/zh/develop-plugin/features-and-specs/advanced-development/customizable-model.mdx +++ b/zh/develop-plugin/features-and-specs/advanced-development/customizable-model.mdx @@ -179,7 +179,7 @@ def _handle_sync_response(self, **kwargs) -> LLMResult: return LLMResult(**response) ``` -#### 预计算输入 Token +#### 预计算输入 token 如果模型不提供 token 计数接口,返回 `0`: diff --git a/zh/develop-plugin/publishing/standards/contributor-covenant-code-of-conduct.mdx b/zh/develop-plugin/publishing/standards/contributor-covenant-code-of-conduct.mdx index b8db1d3f7..f77209e10 100644 --- a/zh/develop-plugin/publishing/standards/contributor-covenant-code-of-conduct.mdx +++ b/zh/develop-plugin/publishing/standards/contributor-covenant-code-of-conduct.mdx @@ -74,7 +74,7 @@ description: 为了确保 Dify Marketplace 中所有插件的质量,并为 Dif 插件不得包含暴力内容、仇恨言论、歧视或对全球文化、宗教或用户的不尊重。 - **禁止:金融交易** - 插件不得促进任何金融交易、资产转移或支付处理。这包括区块链/加密应用中的令牌或资产所有权转移。 + 插件不得促进任何金融交易、资产转移或支付处理。这包括区块链/加密应用中的代币或资产所有权转移。 - **限制:频繁缺陷的插件** 彻底测试您的插件以避免关键错误。重复提交有缺陷的版本可能导致延迟或处罚。 diff --git a/zh/learn/key-concepts.mdx b/zh/learn/key-concepts.mdx index a65c85ef1..bad4ffb92 100644 --- a/zh/learn/key-concepts.mdx +++ b/zh/learn/key-concepts.mdx @@ -94,7 +94,7 @@ Chatflow 始终以用户输入开始。 **环境变量**:将 API 密钥等机密信息存储在应用本体之外,分享应用的领域特定语言时不会暴露这些信息。环境变量还可存储供多个 LLM 节点共享的模型配置,编辑该变量即可更新所有使用它的节点中的模型。 -**会话变量(仅 Chatflow)**:这些变量是对话特定的,意味着它们在单个对话的多轮 Chatflow 运行中持续存在,因此你可以存储和访问动态信息,如待办事项列表和令牌成本。你可以通过变量分配器节点更新会话变量的值: +**会话变量(仅 Chatflow)**:这些变量是对话特定的,意味着它们在单个对话的多轮 Chatflow 运行中持续存在,因此你可以存储和访问动态信息,如待办事项列表和 token 成本。你可以通过变量分配器节点更新会话变量的值: ![会话变量面板](/images/use-dify/get-started/conversation-variables-panel.png) diff --git a/zh/learn/tutorials/workflow-101/lesson-03.mdx b/zh/learn/tutorials/workflow-101/lesson-03.mdx index 4966ab119..ed3ccfcb2 100644 --- a/zh/learn/tutorials/workflow-101/lesson-03.mdx +++ b/zh/learn/tutorials/workflow-101/lesson-03.mdx @@ -51,7 +51,7 @@ sidebarTitle: "第 3 课:工作流的大脑" 这个数字代表模型的上下文窗口,可以理解为它的 **短期记忆有多强**。 - K 代表千,1048K 就意味着它能一次性处理大约一百万个词(Token)的超长信息,比如读完一本很厚的书,还能记住开头的情节。 + K 代表千,1048K 就意味着它能一次性处理大约一百万个 token 的超长信息,比如读完一本很厚的书,还能记住开头的情节。 包含这个标签的大型语言模型,对于处理长文档、长对话非常有帮助。 diff --git a/zh/learn/tutorials/workflow-101/lesson-04.mdx b/zh/learn/tutorials/workflow-101/lesson-04.mdx index f1b732799..98d3d9ba9 100644 --- a/zh/learn/tutorials/workflow-101/lesson-04.mdx +++ b/zh/learn/tutorials/workflow-101/lesson-04.mdx @@ -65,8 +65,8 @@ sidebarTitle: "第 4 课:小抄" **索引方式** - - **高质量**:会消耗 Token 调用 AI 模型来处理文本,让检索结果更精准。 - - **经济**:不消耗 Token,但会牺牲一定的准确性。 + - **高质量**:会消耗 token 调用 AI 模型来处理文本,让检索结果更精准。 + - **经济**:不消耗 token,但会牺牲一定的准确性。 在处理结构和内容相对简单的文本时,我们可以选择经济模式。 diff --git a/zh/learn/tutorials/workflow-101/lesson-10.mdx b/zh/learn/tutorials/workflow-101/lesson-10.mdx index 84fddf727..7f19f8f2b 100644 --- a/zh/learn/tutorials/workflow-101/lesson-10.mdx +++ b/zh/learn/tutorials/workflow-101/lesson-10.mdx @@ -60,7 +60,7 @@ sidebarTitle: "第 10 课:发布和监控" |:-------------- |:------------------------------------------------------------ | | 全部消息数 | AI 每天的互动总次数,每回答用户一个问题算一条消息。你能了解应用的实用热度。 | | 活跃用户数 | 与 AI 有效互动,即有一问一答以上的唯一用户数。提示词编排和调试的会话不计入。 | -| 费用消耗 | 反映每日该应用请求语言模型的 Tokens 花费,用于成本控制。当曲线出现突然的提升或减少,你需要进行检查。 | +| 费用消耗 | 反映每日该应用请求语言模型的 token 花费,用于成本控制。当曲线出现突然的提升或减少,你需要进行检查。 | | 平均用户调用次数 | 反映每天用户的使用次数。该指标反映了用户粘性。 | ### 放大镜 - 日志(Logs) @@ -72,14 +72,14 @@ sidebarTitle: "第 10 课:发布和监控" - **排查故障 (Debug)**:当用户说*邮件助理用不了了*,你可以通过日志还原案发现场,找到是哪个节点出了问题。 - **优化性能**:查看每个节点的耗时,找出拖慢整个流程的"瓶颈"。 - **理解用户**:看看用户实际输入了什么内容,以此来不断优化你的 Prompt 或知识库。 -- **监控成本**:查看每次运行消耗了多少 Token,控制预算。 +- **监控成本**:查看每次运行消耗了多少 token,控制预算。 | 名称 | 释义 | |:------------ |:--------------------------------- | | 开始时间 | 任务触发的时间 | | 状态 | Success(成功);Failure(失败) | | 运行时间 | 整个流程花了多少时间 | -| TOKENS | 这次运行消耗的 AI 算力(Token 数)| +| TOKENS | 这次运行消耗的 AI 算力(token 数)| | 用户或账户 | 用户 ID | | 触发方式 | 是通过 Web 应用界面运行的,还是通过 API 调用的 | diff --git a/zh/self-host/deploy/configuration/environments.mdx b/zh/self-host/deploy/configuration/environments.mdx index c5607ce72..b1bd28def 100644 --- a/zh/self-host/deploy/configuration/environments.mdx +++ b/zh/self-host/deploy/configuration/environments.mdx @@ -420,7 +420,7 @@ sentinel://:@:/:@:/若只开启 `OPENAPI_ENABLED` 而此项为 `false`,`difyctl login` 会在批准环节收到 503。两者都为 `true` 时 CLI 才可用。 | | `OPENAPI_KNOWN_CLIENT_IDS` | `difyctl` | 允许发起设备流登录的 OAuth 客户端 ID,逗号分隔。
新增 ID 即可接入其他客户端,无需改代码;移除 `difyctl` 会让 CLI 登录报 `unsupported_client`。 | | `OPENAPI_CORS_ALLOW_ORIGINS` | (空) | 允许跨域调用 `/openapi/v1/*` 的浏览器来源,逗号分隔。
为空表示全部拒绝:标准部署下没有影响,CLI 等非浏览器客户端也不受 CORS 限制。 | -| `OPENAPI_RATE_LIMIT_PER_TOKEN` | `60` | 每个 OAuth Bearer Token 在 `/openapi/v1/*` 上的每分钟请求上限,经 Redis 在多副本间共享。
超限返回 429 并附 `Retry-After` 头。设为 `0` 可关闭限流。 | +| `OPENAPI_RATE_LIMIT_PER_TOKEN` | `60` | 每个 OAuth Bearer 令牌在 `/openapi/v1/*` 上的每分钟请求上限,经 Redis 在多副本间共享。
超限返回 429 并附 `Retry-After` 头。设为 `0` 可关闭限流。 | | `DEVICE_FLOW_APPROVE_RATE_LIMIT_PER_HOUR` | `10` | 单个浏览器会话每小时可批准或拒绝的设备流登录次数。
超出后批准请求返回 429,需等待窗口重置。不能设为 `0`。 | ### 文件存储配置 diff --git a/zh/self-host/deploy/troubleshooting/integrations.mdx b/zh/self-host/deploy/troubleshooting/integrations.mdx index 4e84ddafd..2ae51b21f 100644 --- a/zh/self-host/deploy/troubleshooting/integrations.mdx +++ b/zh/self-host/deploy/troubleshooting/integrations.mdx @@ -57,9 +57,9 @@ sudo yum install ffmpeg ffmpeg-devel 3. 将 FFmpeg bin 目录添加到系统 PATH 4. 验证:`ffmpeg -version` -## 模型标记器 +## 模型分词器 -### 无法为 'gpt2' 加载标记器 +### 无法为 'gpt2' 加载分词器 错误: ``` diff --git a/zh/self-host/use-dify/knowledge/create-knowledge/import-text-data/sync-from-notion.mdx b/zh/self-host/use-dify/knowledge/create-knowledge/import-text-data/sync-from-notion.mdx index 8945f968f..7b3dd2a17 100644 --- a/zh/self-host/use-dify/knowledge/create-knowledge/import-text-data/sync-from-notion.mdx +++ b/zh/self-host/use-dify/knowledge/create-knowledge/import-text-data/sync-from-notion.mdx @@ -41,7 +41,7 @@ Dify 知识库支持从 Notion 导入,并支持后续的数据自动同步。 ### 同步 Notion 数据 -如果你的 Notion 内容有更新,可以在知识库的 **文档列表页** 中点击对应内容页的 **同步** 按钮进行数据同步。同步文档涉及嵌入过程,因此将消耗嵌入模型的 Tokens。 +如果你的 Notion 内容有更新,可以在知识库的 **文档列表页** 中点击对应内容页的 **同步** 按钮进行数据同步。同步文档涉及嵌入过程,因此将消耗嵌入模型的 token。 ![同步 Notion 内容](https://assets-docs.dify.ai/2024/12/af7cabd98c3aac392819d9041cc408de.png) diff --git a/zh/self-host/use-dify/knowledge/create-knowledge/setting-indexing-methods.mdx b/zh/self-host/use-dify/knowledge/create-knowledge/setting-indexing-methods.mdx index 06c967e12..9ec82355b 100644 --- a/zh/self-host/use-dify/knowledge/create-knowledge/setting-indexing-methods.mdx +++ b/zh/self-host/use-dify/knowledge/create-knowledge/setting-indexing-methods.mdx @@ -61,7 +61,7 @@ sidebarTitle: 设置索引与检索 - 在经济模式下,每个区块内使用 10 个关键词进行检索,降低了准确度但无需消耗 Token。对于检索到的区块,仅提供倒排索引方式选择最相关的区块。 + 在经济模式下,每个区块内使用 10 个关键词进行检索,降低了准确度但无需消耗 token。对于检索到的区块,仅提供倒排索引方式选择最相关的区块。 如果经济型索引方式的效果不符合预期,可以在知识库设置页中升级为高质量索引方式。 @@ -110,7 +110,7 @@ Dify 的知识库支持这两种检索方式。具体可用的检索选项取决 若选择的嵌入模型为多模态,需同样选择多模态 Rerank 模型(带有 **Vision** 图标)。否则,检索到的图片将在重排序和检索结果中被排除。 -> 开启该功能后,将消耗 Rerank 模型的 Token。详情请参考对应模型的价格说明。 +> 开启该功能后,将消耗 Rerank 模型的 token。详情请参考对应模型的价格说明。 **TopK**:用于确定检索与用户问题相似度最高的文本分段数量。系统同时会根据选用模型上下文窗口大小动态调整分段数量。默认值为 **3**,数值越高,预期被召回的文本分段数量越多。 @@ -132,7 +132,7 @@ Dify 的知识库支持这两种检索方式。具体可用的检索选项取决 若选择的嵌入模型为多模态,需同样选择多模态 Rerank 模型(带有 **Vision** 图标)。否则,检索到的图片将在重排序和检索结果中被排除。 -> 开启该功能后,将消耗 Rerank 模型的 Token。详情请参考对应模型的价格说明。 +> 开启该功能后,将消耗 Rerank 模型的 token。详情请参考对应模型的价格说明。 **TopK**:用于确定检索与用户问题相似度最高的文本分段数量。系统同时会根据选用模型上下文窗口大小动态调整分段数量。默认值为 **3**,数值越高,预期被召回的文本分段数量越多。 @@ -171,7 +171,7 @@ Dify 的知识库支持这两种检索方式。具体可用的检索选项取决 若选择的嵌入模型为多模态,需同样选择多模态 Rerank 模型(带有 **Vision** 图标)。否则,检索到的图片将在重排序和检索结果中被排除。 - > 开启该功能后,将消耗 Rerank 模型的 Token。详情请参考对应模型的价格说明。 + > 开启该功能后,将消耗 Rerank 模型的 token。详情请参考对应模型的价格说明。 **"权重设置"** 和 **"Rerank 模型"** 设置支持以下选项: diff --git a/zh/self-host/use-dify/monitor/analysis.mdx b/zh/self-host/use-dify/monitor/analysis.mdx index c32a7a1ee..e6c13c62f 100644 --- a/zh/self-host/use-dify/monitor/analysis.mdx +++ b/zh/self-host/use-dify/monitor/analysis.mdx @@ -14,6 +14,6 @@ description: "通过 Dify 内置的分析仪表盘监控性能、成本和用户 **Total Messages**:对话量 **Active Users**:有意义互动的用户(多于一次的交互) **Average User Interactions**:每次会话的参与深度 -**Token Usage**:资源消耗和成本 +**费用消耗**:资源消耗和成本 使用时间选择器查看不同时间段的趋势。点击 **"Tracing app performance"** 以连接外部可观察性平台,如 Langfuse 或 LangSmith,以获得更深入的分析。 diff --git a/zh/self-host/use-dify/monitor/integrations/integrate-aliyun.mdx b/zh/self-host/use-dify/monitor/integrations/integrate-aliyun.mdx index 9637d6078..82f04d6da 100644 --- a/zh/self-host/use-dify/monitor/integrations/integrate-aliyun.mdx +++ b/zh/self-host/use-dify/monitor/integrations/integrate-aliyun.mdx @@ -121,9 +121,9 @@ title: 集成阿里云云监控 * message\_data - 消息数据 * user\_session\_id - 用户的 session\_id * conversation\_model - 对话模式 -* message\_tokens - 消息中的令牌数 -* answer\_tokens - 回答中的令牌数 -* total\_tokens - 消息和回答中的总令牌数 +* message\_tokens - 消息中的 token 数 +* answer\_tokens - 回答中的 token 数 +* total\_tokens - 消息和回答中的总 token 数 * error - 错误信息 * inputs - 输入数据 * outputs - 输出数据 diff --git a/zh/self-host/use-dify/monitor/integrations/integrate-arize.mdx b/zh/self-host/use-dify/monitor/integrations/integrate-arize.mdx index fe741d9b6..dc7852db2 100644 --- a/zh/self-host/use-dify/monitor/integrations/integrate-arize.mdx +++ b/zh/self-host/use-dify/monitor/integrations/integrate-arize.mdx @@ -76,7 +76,7 @@ title: 集成 Arize - elapsed_time - 当前运行所用时间 - status - 运行状态 - version - 工作流版本 -- total_tokens - 当前运行使用的总令牌数 +- total_tokens - 当前运行使用的总 token 数 - file_list - 处理的文件列表 - triggered_from - 触发当前运行的来源 - workflow_run_inputs - 当前运行的输入数据 @@ -96,7 +96,7 @@ title: 集成 Arize - elapsed_time - 当前运行所用时间 - status - 运行状态 - version - 工作流版本 - - total_tokens - 当前运行使用的总令牌数 + - total_tokens - 当前运行使用的总 token 数 - file_list - 处理的文件列表 - triggered_from - 触发当前运行的来源 @@ -124,9 +124,9 @@ title: 集成 Arize - message_data - 消息数据 - user_session_id - 用户会话 ID - conversation_model - 对话模式 -- message_tokens - 消息中的令牌数 -- answer_tokens - 答案中的令牌数 -- total_tokens - 消息和答案中的总令牌数 +- message_tokens - 消息中的 token 数 +- answer_tokens - 答案中的 token 数 +- total_tokens - 消息和答案中的总 token 数 - error - 错误信息 - inputs - 输入数据 - outputs - 输出数据 @@ -201,7 +201,7 @@ title: 集成 Arize - outputs - 输出内容 - start_time - 开始时间 - end_time - 结束时间 -- total_tokens - 令牌数量 +- total_tokens - Token 数量 - status - 消息状态 - error - 错误信息 - from_account_id - 发送账户的 ID diff --git a/zh/self-host/use-dify/monitor/integrations/integrate-langfuse.mdx b/zh/self-host/use-dify/monitor/integrations/integrate-langfuse.mdx index 8298dca1a..587559e4c 100644 --- a/zh/self-host/use-dify/monitor/integrations/integrate-langfuse.mdx +++ b/zh/self-host/use-dify/monitor/integrations/integrate-langfuse.mdx @@ -156,7 +156,7 @@ Langfuse 是一个开源的大型语言模型工程平台,帮助团队协作 * elapsed\_time - 此运行时的经过时间 * status - 运行时状态 * version - 工作流版本 -* total\_tokens - 此运行时使用的总标记数 +* total\_tokens - 此运行时使用的总 token 数 * file\_list - 处理文件的列表 * triggered\_from - 触发此运行时的来源 * workflow\_run\_inputs - 此工作流的输入 @@ -176,7 +176,7 @@ Langfuse 是一个开源的大型语言模型工程平台,帮助团队协作 * elapsed\_time - 此运行时的经过时间 * status - 操作状态 * version - 工作流版本 - * total\_tokens - 此运行时使用的总标记数 + * total\_tokens - 此运行时使用的总 token 数 * file\_list - 处理文件的列表 * triggered\_from - 触发此运行时的来源 @@ -256,9 +256,9 @@ Langfuse 是一个开源的大型语言模型工程平台,帮助团队协作 * message\_data - 消息数据 * user\_session\_id - 用户会话 ID * conversation\_model - 对话模型 -* message\_tokens - 消息标记数 -* answer\_tokens - 回答标记数 -* total\_tokens - 消息和回答的总标记数 +* message\_tokens - 消息 token 数 +* answer\_tokens - 回答 token 数 +* total\_tokens - 消息和回答的总 token 数 * error - 错误信息 * inputs - 输入数据 * outputs - 输出数据 @@ -404,7 +404,7 @@ Langfuse 是一个开源的大型语言模型工程平台,帮助团队协作 * outputs - 输出数据 * start\_time - 开始时间 * end\_time - 结束时间 -* total\_tokens - 总标记数 +* total\_tokens - 总 token 数 * status - 消息状态 * error - 错误信息 * from\_account\_id - 发送账户 ID diff --git a/zh/self-host/use-dify/monitor/integrations/integrate-langsmith.mdx b/zh/self-host/use-dify/monitor/integrations/integrate-langsmith.mdx index e08caad52..d8e72c9a0 100644 --- a/zh/self-host/use-dify/monitor/integrations/integrate-langsmith.mdx +++ b/zh/self-host/use-dify/monitor/integrations/integrate-langsmith.mdx @@ -179,9 +179,9 @@ LangSmith [官网介绍](https://www.langchain.com/langsmith) * message\_data - 消息数据 * user\_session\_id - 用户的 session\_id * conversation\_model - 对话模式 -* message\_tokens - 消息中的令牌数 -* answer\_tokens - 回答中的令牌数 -* total\_tokens - 消息和回答中的总令牌数 +* message\_tokens - 消息中的 token 数 +* answer\_tokens - 回答中的 token 数 +* total\_tokens - 消息和回答中的总 token 数 * error - 错误信息 * inputs - 输入数据 * outputs - 输出数据 @@ -259,7 +259,7 @@ LangSmith [官网介绍](https://www.langchain.com/langsmith) * outputs - 输出的内容 * start\_time - 开始时间 * end\_time - 结束时间 -* total\_tokens - 令牌数量 +* total\_tokens - Token 数量 * status - 消息状态 * error - 错误信息 * from\_account\_id - 发送账户的 ID diff --git a/zh/self-host/use-dify/monitor/integrations/integrate-opik.mdx b/zh/self-host/use-dify/monitor/integrations/integrate-opik.mdx index 4dcc96c94..e7cbca8f7 100644 --- a/zh/self-host/use-dify/monitor/integrations/integrate-opik.mdx +++ b/zh/self-host/use-dify/monitor/integrations/integrate-opik.mdx @@ -92,7 +92,7 @@ Opik 是一个开源的 LLM 评估平台,用于评估、测试和监控大型 - elapsed_time - 当前运行所用时间 - status - 运行状态 - version - 工作流版本 -- total_tokens - 当前运行使用的总令牌数 +- total_tokens - 当前运行使用的总 token 数 - file_list - 处理的文件列表 - triggered_from - 触发当前运行的来源 - workflow_run_inputs - 当前运行的输入数据 @@ -112,7 +112,7 @@ Opik 是一个开源的 LLM 评估平台,用于评估、测试和监控大型 - elapsed_time - 当前运行所用时间 - status - 运行状态 - version - 工作流版本 - - total_tokens - 当前运行使用的总令牌数 + - total_tokens - 当前运行使用的总 token 数 - file_list - 处理的文件列表 - triggered_from - 触发当前运行的来源 @@ -140,9 +140,9 @@ Opik 是一个开源的 LLM 评估平台,用于评估、测试和监控大型 - message_data - 消息数据 - user_session_id - 用户会话 ID - conversation_model - 对话模式 -- message_tokens - 消息中的令牌数 -- answer_tokens - 答案中的令牌数 -- total_tokens - 消息和答案中的总令牌数 +- message_tokens - 消息中的 token 数 +- answer_tokens - 答案中的 token 数 +- total_tokens - 消息和答案中的总 token 数 - error - 错误信息 - inputs - 输入数据 - outputs - 输出数据 @@ -217,7 +217,7 @@ Opik 是一个开源的 LLM 评估平台,用于评估、测试和监控大型 - outputs - 输出内容 - start_time - 开始时间 - end_time - 结束时间 -- total_tokens - 令牌数量 +- total_tokens - Token 数量 - status - 消息状态 - error - 错误信息 - from_account_id - 发送账户的 ID diff --git a/zh/self-host/use-dify/monitor/integrations/integrate-phoenix.mdx b/zh/self-host/use-dify/monitor/integrations/integrate-phoenix.mdx index 80eaaa9b1..e253b4db6 100644 --- a/zh/self-host/use-dify/monitor/integrations/integrate-phoenix.mdx +++ b/zh/self-host/use-dify/monitor/integrations/integrate-phoenix.mdx @@ -126,7 +126,7 @@ title: 集成 Phoenix - elapsed_time - 当前运行所用时间 - status - 运行状态 - version - 工作流版本 -- total_tokens - 当前运行使用的总令牌数 +- total_tokens - 当前运行使用的总 token 数 - file_list - 处理的文件列表 - triggered_from - 触发当前运行的来源 - workflow_run_inputs - 当前运行的输入数据 @@ -146,7 +146,7 @@ title: 集成 Phoenix - elapsed_time - 当前运行所用时间 - status - 运行状态 - version - 工作流版本 - - total_tokens - 当前运行使用的总令牌数 + - total_tokens - 当前运行使用的总 token 数 - file_list - 处理的文件列表 - triggered_from - 触发当前运行的来源 @@ -174,9 +174,9 @@ title: 集成 Phoenix - message_data - 消息数据 - user_session_id - 用户会话 ID - conversation_model - 对话模式 -- message_tokens - 消息中的令牌数 -- answer_tokens - 答案中的令牌数 -- total_tokens - 消息和答案中的总令牌数 +- message_tokens - 消息中的 token 数 +- answer_tokens - 答案中的 token 数 +- total_tokens - 消息和答案中的总 token 数 - error - 错误信息 - inputs - 输入数据 - outputs - 输出数据 @@ -251,7 +251,7 @@ title: 集成 Phoenix - outputs - 输出内容 - start_time - 开始时间 - end_time - 结束时间 -- total_tokens - 令牌数量 +- total_tokens - Token 数量 - status - 消息状态 - error - 错误信息 - from_account_id - 发送账户的 ID diff --git a/zh/self-host/use-dify/monitor/integrations/integrate-weave.mdx b/zh/self-host/use-dify/monitor/integrations/integrate-weave.mdx index a5e9af02e..0447dee72 100644 --- a/zh/self-host/use-dify/monitor/integrations/integrate-weave.mdx +++ b/zh/self-host/use-dify/monitor/integrations/integrate-weave.mdx @@ -74,7 +74,7 @@ Weights & Biases (W&B) Weave 是一个用于跟踪、实验、评估、部署和 | end_time | end_time | | inputs | inputs | | outputs | outputs | -| 模型令牌消耗 | usage_metadata | +| 模型 token 消耗 | usage_metadata | | metadata | extra | | error | error | | workflow | tags | @@ -90,7 +90,7 @@ Weights & Biases (W&B) Weave 是一个用于跟踪、实验、评估、部署和 * elapsed_time - 当前运行所花费的时间 * status - 运行状态 * version - 工作流版本 -* total_tokens - 当前运行中使用的总令牌数 +* total_tokens - 当前运行中使用的总 token 数 * file_list - 处理的文件列表 * triggered_from - 触发当前运行的来源 * workflow_run_inputs - 当前运行的输入数据 @@ -110,7 +110,7 @@ Weights & Biases (W&B) Weave 是一个用于跟踪、实验、评估、部署和 * elapsed_time - 当前运行所花费的时间 * status - 运行状态 * version - 工作流版本 - * total_tokens - 当前运行中使用的总令牌数 + * total_tokens - 当前运行中使用的总 token 数 * file_list - 处理的文件列表 * triggered_from - 触发当前运行的来源 @@ -127,7 +127,7 @@ Weights & Biases (W&B) Weave 是一个用于跟踪、实验、评估、部署和 | end_time | end_time | | inputs | inputs | | outputs | outputs | -| 模型令牌消耗 | usage_metadata | +| 模型 token 消耗 | usage_metadata | | metadata | extra | | error | error | | "message", conversation_mode | tags | @@ -140,9 +140,9 @@ Weights & Biases (W&B) Weave 是一个用于跟踪、实验、评估、部署和 * message_data - 消息数据 * user_session_id - 用户会话 ID * conversation_model - 对话模式 -* message_tokens - 消息中的令牌数 -* answer_tokens - 回答中的令牌数 -* total_tokens - 消息和回答中的总令牌数 +* message_tokens - 消息中的 token 数 +* answer_tokens - 回答中的 token 数 +* total_tokens - 消息和回答中的总 token 数 * error - 错误信息 * inputs - 输入数据 * outputs - 输出数据 @@ -219,7 +219,7 @@ Weights & Biases (W&B) Weave 是一个用于跟踪、实验、评估、部署和 * outputs - 输出内容 * start_time - 开始时间 * end_time - 结束时间 -* total_tokens - 令牌数 +* total_tokens - Token 数 * status - 消息状态 * error - 错误信息 * from_account_id - 发送账户的 ID diff --git a/zh/self-host/use-dify/nodes/agent.mdx b/zh/self-host/use-dify/nodes/agent.mdx index ff660614f..4f336a9a4 100644 --- a/zh/self-host/use-dify/nodes/agent.mdx +++ b/zh/self-host/use-dify/nodes/agent.mdx @@ -115,7 +115,7 @@ description: 将 Agent 作为工作流中的一步运行,通过推理和调用 **详细的指令** 提供关于 Agent 角色、目标以及任何约束或偏好的上下文。 - **记忆管理** 根据你的用例要求平衡上下文保留与标记效率。 + **记忆管理** 根据你的用例要求平衡上下文保留与 token 效率。 diff --git a/zh/self-host/use-dify/nodes/iteration.mdx b/zh/self-host/use-dify/nodes/iteration.mdx index ea6729645..eb7a7a0e2 100644 --- a/zh/self-host/use-dify/nodes/iteration.mdx +++ b/zh/self-host/use-dify/nodes/iteration.mdx @@ -141,7 +141,7 @@ title: "迭代" ## 常见用例 -**标记数限制管理** - 当内容超过大型语言模型上下文窗口时,将大文本分解为块进行翻译、摘要或分析。 +**Token 数限制管理** - 当内容超过大型语言模型上下文窗口时,将大文本分解为块进行翻译、摘要或分析。 **批处理** - 高效地对多个项目应用相同操作,例如处理多个文档或 API 调用。 diff --git a/zh/self-host/use-dify/nodes/llm.mdx b/zh/self-host/use-dify/nodes/llm.mdx index 94df2fe38..f0688c895 100644 --- a/zh/self-host/use-dify/nodes/llm.mdx +++ b/zh/self-host/use-dify/nodes/llm.mdx @@ -111,8 +111,8 @@ Question: {{user_question}} ### 视觉能力配置 处理图像时,你可以控制细节级别: -- **高细节** - 对复杂图像具有更好的准确性但使用更多令牌 -- **低细节** - 对简单图像进行更快处理,使用较少令牌 +- **高** - 对复杂图像具有更好的准确性但使用更多 token +- **低** - 对简单图像进行更快处理,使用较少 token 视觉能力的默认变量选择器是 `userinput.files`,它会自动从用户输入节点获取文件。 diff --git a/zh/self-host/use-dify/workspace/api-extension/api-extension.mdx b/zh/self-host/use-dify/workspace/api-extension/api-extension.mdx index 883805c71..28fa44fc0 100644 --- a/zh/self-host/use-dify/workspace/api-extension/api-extension.mdx +++ b/zh/self-host/use-dify/workspace/api-extension/api-extension.mdx @@ -27,7 +27,7 @@ POST {Your-API-Endpoint} | Header | Value | Desc | | --------------- | ----------------- | --------------------------------------------------------------------- | | `Content-Type` | application/json | 请求内容为 JSON 格式。 | -| `Authorization` | Bearer \{api_key\} | API Key 以 Token 令牌的方式传输,你需要解析该 `api_key` 并确认是否和提供的 API Key 一致,保证接口安全。 | +| `Authorization` | Bearer \{api_key\} | API Key 作为 Bearer 令牌传输,你需要解析该 `api_key` 并确认是否和提供的 API Key 一致,保证接口安全。 | ### Request Body @@ -236,7 +236,7 @@ API 返回为: 2. 下载完成后,进入下载目录,根据下方说明解压压缩包,并执行说明中的初始化脚本。 ```shell unzip /path/to/ngrok.zip - ./ngrok config add-authtoken 你的 Token + ./ngrok config add-authtoken 你的令牌 ``` 3. 查看本地 API 服务的端口: diff --git a/zh/self-host/use-dify/workspace/api-extension/cloudflare-worker.mdx b/zh/self-host/use-dify/workspace/api-extension/cloudflare-worker.mdx index 6440f51b5..463262f50 100644 --- a/zh/self-host/use-dify/workspace/api-extension/cloudflare-worker.mdx +++ b/zh/self-host/use-dify/workspace/api-extension/cloudflare-worker.mdx @@ -19,7 +19,7 @@ cp wrangler.toml.example wrangler.toml 打开 `wrangler.toml` 文件,修改 `name` 和 `compatibility_date` 为你的应用名称和兼容日期。 -这里我们需要注意的配置就是 `vars` 里面的 `TOKEN`,在 Dify 添加自定义端点的时候,我们需要填写这个 Token。出于安全考虑,我们建议你使用一个随机的字符串作为 Token,你不应该在源代码中直接写入 Token,而是使用环境变量的方式来传递 Token。所以请不要把 wrangler.toml 提交到你的代码仓库中。 +这里我们需要注意的配置就是 `vars` 里面的 `TOKEN`,在 Dify 添加自定义端点的时候,我们需要填写这个令牌。出于安全考虑,我们建议你使用一个随机的字符串作为令牌,你不应该在源代码中直接写入令牌,而是使用环境变量的方式来传递令牌。所以请不要把 wrangler.toml 提交到你的代码仓库中。 ```toml name = "dify-extension-example" @@ -91,7 +91,7 @@ import { bearerAuth } from "hono/bearer-auth"; }, ``` -我们的 Bearer 校验逻辑在如上代码中,我们使用了 `hono/bearer-auth` 这个包来实现 Bearer 校验。你可以在 `src/index.ts` 中使用 `c.env.TOKEN` 来获取 Token。 +我们的 Bearer 校验逻辑在如上代码中,我们使用了 `hono/bearer-auth` 这个包来实现 Bearer 校验。你可以在 `src/index.ts` 中使用 `c.env.TOKEN` 来获取令牌。 ## 关于参数验证