Skip to content

plugin-deepseek — DeepSeek LLM 服务

包名: @aalis/plugin-deepseek
源码: packages/plugin-deepseek/src/index.ts

概述

DeepSeek API 的 LLMService 适配器,支持流式输出、工具调用和思考模式。

插件声明

typescript
meta.name = '@aalis/plugin-deepseek'
meta.provides = ['llm']
meta.inject = {} // 无依赖

配置

字段类型默认值说明
apiKeystringAPI 密钥(必填,secret)
baseUrlstringhttps://api.deepseek.comAPI 基地址
modelselectdeepseek-chat模型名(动态选项来源: llm)
temperaturenumber0.7采样温度
maxTokensnumber8192最大生成 token 数
contextLengthnumber131072模型上下文窗口大小
maxToolIterationsnumber10工具调用最大迭代次数
strictToolCallsbooleanfalse启用 strict 模式工具调用
capabilitiesmultiselect声明能力: chat / tool_calling / streaming / thinking

特性

  • 思考模式: 当 capabilities 含 thinking 时自动启用,请求体附加 thinking: { type: 'enabled', budget_tokens },思考内容通过 reasoningContent 返回
  • Strict 工具调用: 启用后工具参数 schema 添加 strict: true
  • SSE 流式解析: chatStream() 解析 SSE 事件流,累积 tool_calls delta
  • 动态模型列表: listModels() 从 API 获取可用模型供 WebUI 下拉选择