尧图建网站 尧图建网站 YAOTU WEB BUILD 免费咨询
ARTICLE DETAIL

资讯详情

深耕网站建设与建站编程的一线实战洞察。

deepseek harness插件开发

deepseek harness插件开发 这个月 deepseek harness 发布了, 做个简单插件熟悉了解一下写了个简单的代码直接参考即可源码链接说明看了下dsh 的源码是用pnpm 的monorepo,一切皆插件, 大部分的功能都是在 packages 下面作为插件加进来的, 自己写插件的话可以参考这里面的代码了. 插件也是要用 ts 来写如果python要使用的话, 可以用其python sdk 来引用扩展阅读官方插件开发文档:https://deepseek-harness.github.io/deepseek-harness/develop/basic/publishharness 一切皆插件的https://github.com/cordiverse/paperdsh 的安装要先安装一下dshnpm install --global deepseek-ai/dsh --registryhttps://registry.npmmirror.com npm uninstall --global deepseek-ai/dsh # 卸载 dsh web # 启动 dsh plugin --profile web list # 查看插件 dsh plugin --profile web add . # 从源码安装插件, dsh plugin --profile web remove xxx # 删除某插件 dsh --profile web --dump-config # 查看一下插件的开发插件开发直接参考官网文档这个即可,还是比较简单的https://deepseek-harness.github.io/deepseek-harness/develop/basic/需要的入口文件是:cordis.patch.yml- insert: - id: xxxx name: xxxxxpackage.json{ name: dsh-docs-to-html-tool, version: 0.1.2, type: module, main: index.ts, files: [ index.ts, tool-logger.ts, lib/convert.ts, cordis.patch.yml ], dsh: { bundle: { patch: ./cordis.patch.yml } }, peerDependencies: { deepseek-ai/dsh-tools: 0.1.0-rc.6, deepseek-ai/dsh-llm: 0.1.0-rc.6 }, dependencies: { mammoth: ^1.12.1 }, devDependencies: { types/node: ^26.3.0 } }index.tsimport type { Context } from deepseek-ai/cordis import { defineTool } from deepseek-ai/dsh-tools import { CallId } from deepseek-ai/dsh-llm export const name xxxx export const inject [tools] export function apply(ctx: Context) { ....index.ts 中的name 应该和 cordis.patch.yml 中的 id一样package.json中的name应该和 cordis.patch.yml 中的 name一样如果从其它源码中下载,记得要先npm install, 不然可能会有 code: ‘ERR_MODULE_NOT_FOUND’ 之类的错误 , 在dsh web 开户时, plugin 的add 不会抛错
返回列表