# Dify 中文客服回复草稿 / Support reply draft

参考 **Dify 1.17.1 / DSL 0.7.0**，官方 `langgenius/openai_api_compatible` 模型插件 **0.0.68** 源码。`support-workflow.yml` 用 JSON 语法表达 YAML，Dify 的 YAML loader 可以读取此语法；本次用 PyYAML 6.0.3 离线读取，并核对 Start → LLM → End 变量连接。未在 Dify UI 导入、运行或配置真实供应商。

## 必须先手动配置供应商

1. 工作区管理员在 **Integrations → Model Provider**（旧界面为设置 → 模型供应商）安装发布者 **langgenius** 的 **OpenAI-API-compatible** 模型插件。核对安装版本；此包不自动安装插件。源码参考 0.0.68，其他版本需要重新检查字段。
2. 添加一个 **LLM**，Model Name 为 `glm-5.3`，自己的 Key 仅输入供应商凭据界面；API Base URL / `endpoint_url` 为 `https://api.apizt.com/v1`，Completion mode 为 **Chat**。不要追加 `/chat/completions`。保存/验证可能发模型请求并计费。
3. Context size 先设 **4096**、最大 token 上限先设 **512**，这是本模板的保守测试预算，不能作为型号最大规格。先关闭 Vision、Function Call、Web Search；确切字段对照 `provider-settings.json`。API 权限、网关上下文/输出限制仍需自己核对。
4. 在 Studio 选择 **Import DSL**，导入 `support-workflow.yml`，创建新应用。`dependencies: []` 是有意设置：插件及凭据通过以上步骤手动准备，文件不会安装供应商、导入 Key 或调用作者账户。
5. 打开 **生成回复草稿** 节点，重新选中自己刚添加的 provider 与模型。DSL 的 provider 引用为 `langgenius/openai_api_compatible/openai_api_compatible`；如插件/工作区标识不同，以当前 UI 重新选择并保存，不能只看导入成功提示。
6. 在测试界面输入脱敏问题，例如「退款申请提交三天，想查询进度」，手动运行一次。检查最终 `draft`、运行记录、模型、实际请求次数及账户账单，再决定正式使用。

没有知识库、Agent、工具、消息发送或退款节点。LLM 节点关闭重试、记忆、图片与结构化输出，但插件验证与内部 transport 的请求/重试不受此 DSL 统一控制。插件能力选项也不证明网关支持相应功能。回复长度和不承诺退款是提示词要求，并非硬性安全边界；正式使用前人工检查。测试模式可能保存输入和回复日志，先核对工作区保留策略。

## English

First, an administrator must manually install the official **langgenius OpenAI-API-compatible model provider** and add an LLM in Chat mode. Enter your key only in the provider credential UI, set the model to `glm-5.3` and the endpoint prefix to `https://api.apizt.com/v1`. Provider validation may call a model and incur charges. The included `provider-settings.json` is a manual field guide, not a credentials import file.

Import `support-workflow.yml` as a new application, reselect your installed provider/model in the LLM node, then test one redacted question. The DSL contains no credentials or automatic plugin dependencies. It is a plain-text Start → LLM → End workflow that produces a human-reviewed reply draft. No business action is executed. Node retries are disabled; plugin/transport behavior must be checked separately. JSON is valid YAML syntax and was parsed offline with PyYAML 6.0.3. Target Dify 1.17.1 / DSL 0.7.0 / provider source 0.0.68; actual Dify import, provider setup and model execution are untested.

[Dify app import/export](https://docs.dify.ai/en/use-dify/workspace/app-management) · [Model providers](https://docs.dify.ai/en/use-dify/workspace/model-providers) · [Official plugin](https://marketplace.dify.ai/plugin/langgenius/openai_api_compatible) · [Source/version record](../docs/ecosystem-integrations.md)
