mirror of
https://github.com/langgenius/dify-docs.git
synced 2026-03-27 13:28:32 +07:00
* fix redirect language code prefixes * rename: cn -> zh, jp -> ja * remove hardcoded ja / zh references * remove hardcoded 'english' references * renamed variable names and dict keys to language agnostic names * fix: add missing language helper methods to PRAnalyzer - Add get_language_directory() method - Initialize source_language and target_languages from config - Fixes AttributeError when generating mixed PR errors 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * test: kitchen sink workflow validation v2 This PR validates the translation workflow after config-driven refactoring: Changes: - Add new test file: test-workflow-validation.mdx - Modify existing file: introduction.mdx - Update docs.json navigation Tests: - New file translation (add workflow) - Existing file translation (update workflow) - Navigation sync across languages - Config-driven language codes (zh/ja instead of cn/jp) - Source language abstraction (no hardcoded "English") Expected workflow behavior: 1. Detect changes in en/ directory 2. Translate new file to zh and ja 3. Update modified file translations 4. Sync docs.json for all language sections 5. Commit translated files automatically 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * fix: update workflow paths to use zh/ja instead of cn/jp Aligns workflow trigger paths with the zh/ja language directory rename. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * Revert "fix: update workflow paths to use zh/ja instead of cn/jp" This reverts commit9587b7cc5d. * Revert "test: kitchen sink workflow validation v2" This reverts commit4abdd69fd2. * fix: update workflow paths in doc analyze workflow to use zh/ja instead of cn/jp * Refactor/language codes (#240) * test: kitchen sink workflow validation v2 This PR validates the translation workflow after config-driven refactoring: Changes: - Add new test file: test-workflow-validation.mdx - Modify existing file: introduction.mdx - Update docs.json navigation Tests: - New file translation (add workflow) - Existing file translation (update workflow) - Navigation sync across languages - Config-driven language codes (zh/ja instead of cn/jp) - Source language abstraction (no hardcoded "English") Expected workflow behavior: 1. Detect changes in en/ directory 2. Translate new file to zh and ja 3. Update modified file translations 4. Sync docs.json for all language sections 5. Commit translated files automatically 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * fix: update workflow paths to use zh/ja instead of cn/jp Aligns workflow trigger paths with the zh/ja language directory rename. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * Revert "fix: update workflow paths to use zh/ja instead of cn/jp" This reverts commit9587b7cc5d. * Revert "test: kitchen sink workflow validation v2" This reverts commit4abdd69fd2. * fix: update workflow paths in doc analyze workflow to use zh/ja instead of cn/jp --------- Co-authored-by: Claude <noreply@anthropic.com> * fix: update workflow files to use 'source' instead of 'english' After refactoring the PR analyzer to use 'source' for source language PRs (instead of hardcoded 'english'), the workflow files need to match. Changes: - sync_docs_analyze.yml: pr_type == 'source' (was 'english') - sync_docs_update.yml: PR_TYPE != 'source' check - Updated all comments from "English" to "source language" - Updated all pr_type values in JSON from "english" to "source" This ensures the workflows trigger correctly with the refactored config-driven language system. Related: language code refactoring (cn/jp → zh/ja) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * Fix/workflow source language references (#245) * test: kitchen sink workflow validation v2 This PR validates the translation workflow after config-driven refactoring: Changes: - Add new test file: test-workflow-validation.mdx - Modify existing file: introduction.mdx - Update docs.json navigation Tests: - New file translation (add workflow) - Existing file translation (update workflow) - Navigation sync across languages - Config-driven language codes (zh/ja instead of cn/jp) - Source language abstraction (no hardcoded "English") Expected workflow behavior: 1. Detect changes in en/ directory 2. Translate new file to zh and ja 3. Update modified file translations 4. Sync docs.json for all language sections 5. Commit translated files automatically 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * fix: update workflow paths to use zh/ja instead of cn/jp Aligns workflow trigger paths with the zh/ja language directory rename. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * Revert "fix: update workflow paths to use zh/ja instead of cn/jp" This reverts commit9587b7cc5d. * Revert "test: kitchen sink workflow validation v2" This reverts commit4abdd69fd2. * fix: update workflow paths in doc analyze workflow to use zh/ja instead of cn/jp * fix: update workflow files to use 'source' instead of 'english' After refactoring the PR analyzer to use 'source' for source language PRs (instead of hardcoded 'english'), the workflow files need to match. Changes: - sync_docs_analyze.yml: pr_type == 'source' (was 'english') - sync_docs_update.yml: PR_TYPE != 'source' check - Updated all comments from "English" to "source language" - Updated all pr_type values in JSON from "english" to "source" This ensures the workflows trigger correctly with the refactored config-driven language system. Related: language code refactoring (cn/jp → zh/ja) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> --------- Co-authored-by: Claude <noreply@anthropic.com> * fix * fix docs.json language codes * rename previous version docs: cn -> zh, jp -> ja * rm duplicate redirect entires --------- Co-authored-by: Claude <noreply@anthropic.com>
83 lines
3.4 KiB
Plaintext
83 lines
3.4 KiB
Plaintext
---
|
||
title: "参数提取器"
|
||
icon: "crop-simple"
|
||
---
|
||
|
||
<Note> ⚠️ 本文档由 AI 自动翻译。如有任何不准确之处,请参考[英文原版](/en/use-dify/nodes/parameter-extractor)。</Note>
|
||
|
||
|
||
参数提取器节点使用大型语言模型智能将非结构化文本转换为结构化数据。它弥合了自然语言输入与工具、API和其他工作流节点所需的结构化参数之间的差距。
|
||
|
||
## 配置
|
||
|
||
### 输入和模型选择
|
||
|
||
选择包含要提取参数的文本的**输入变量**。这通常来自用户输入、大型语言模型响应或其他工作流节点。
|
||
|
||
选择具有强大结构化输出能力的**模型**。参数提取器依赖于大型语言模型理解上下文并生成结构化JSON响应的能力。
|
||
|
||
### 参数定义
|
||
|
||
通过指定以下内容来定义要提取的参数:
|
||
|
||
- **参数名称** - 将出现在输出JSON中的键
|
||
- **数据类型** - 字符串、数字、布尔值、数组或对象
|
||
- **描述** - 帮助大型语言模型了解要提取的内容
|
||
- **必需状态** - 参数是否必须存在
|
||
|
||
你可以手动定义参数或**从现有工具快速导入**以匹配下游节点的参数要求。
|
||
|
||
### 提取指令
|
||
|
||
编写清晰的指令,描述要提取什么信息以及如何格式化。在指令中提供示例可以提高复杂参数的提取准确性和一致性。
|
||
|
||
<Frame caption="Arxiv论文检索的参数提取">
|
||
<img src="https://assets-docs.dify.ai/dify-enterprise-mintlify/en/guides/workflow/node/a8bae4106a015c76ebb0a165f2409458.png" alt="Arxiv Paper Retrieval Tool" />
|
||
</Frame>
|
||
|
||
## 高级配置
|
||
|
||
### 推理模式
|
||
|
||
根据你的模型能力选择两种提取方法之一:
|
||
|
||
**函数调用/工具调用**使用模型的结构化输出功能进行可靠的参数提取,具有强类型合规性。
|
||
|
||
**基于提示词的方法**依赖纯提示词技术,适用于可能不支持函数调用的模型或基于提示词的提取表现更好的情况。
|
||
|
||
### 记忆
|
||
|
||
启用记忆功能以在提取参数时包含对话历史。这有助于大型语言模型在交互式对话中理解上下文,并提高对话工作流的提取准确性。
|
||
|
||
## 输出变量
|
||
|
||
该节点提供提取的参数和内置状态变量:
|
||
|
||
**提取的参数**作为与你的参数定义匹配的单个变量出现,可供下游节点使用。
|
||
|
||
**内置变量**包括状态信息:
|
||
- `__is_success` - 提取成功状态(成功为1,失败为0)
|
||
- `__reason` - 提取失败时的错误描述
|
||
|
||
<Frame caption="数据格式转换示例">
|
||
<img src="https://assets-docs.dify.ai/dify-enterprise-mintlify/en/guides/workflow/node/71d8e48d842342668f92e6dd84fc03c1.png" alt="Data format conversion workflow" />
|
||
</Frame>
|
||
|
||
## 常见用例
|
||
|
||
**工具参数准备**从自然语言中提取特定参数,用于需要结构化输入的工作流工具。
|
||
|
||
**数据格式转换**将文本转换为其他节点所需的格式,例如将列表转换为数为外部服务的HTTP请求构建数据,处理从用户意图到API兼容参数的转换。
|
||
|
||
**表单数据处理**从自由格式的用户输入中提取结构化信息,用于数据库存储或进一步处理。
|
||
|
||
## 最佳实践
|
||
|
||
**清晰的参数描述**有助于大型语言模型准确理解要提取的信息及其格式。
|
||
|
||
**在指令中提供示例**以提高提取准确性,特别是对于复杂或特定领域的参数。
|
||
|
||
**使用适当的数据类型**以确保提取的参数符合下游节点的要求。
|
||
|
||
**处理提取失败**通过检查`__is_success`变量并在提取失败时提供后备逻辑。
|