GoldenDict 大语言模型词典
给 GoldenDict 编写了一个简单的外部程序,使用 LLM API 进行查词。可以对接兼容 OpenAI 的平台。输出格式我直接参考的朗文。
项目地址:https://github.com/gitsang/goldendict-llm
https://github.com/gitsang/goldendict-llm/raw/main/resources/preview.png
用 Golang 写的,直接下载 EXE,不用装各种依赖。
目前就非常粗暴的让 LLM 自己去识别格式,所以输出可能会慢一点,我会慢慢优化 Prompt,欢迎 PR、Fork 或提交 Issue 试了一下,错误信息:
查询错误:程序返回,退出代码为 2. panic: adapter siliconflow not found goroutine 1 : main.run() D:/Application/GoldenDict/plugins/goldendict-llm/main.go:134 +0xaee main.init.0.func1(0xc00015e700?, {0xc000163380?, 0x4?, 0x1029486?}) D:/Application/GoldenDict/plugins/goldendict-llm/main.go:61 +0x65 github.com/spf13/cobra.(*Command).execute(0x1454720, {0xc000074110, 0x3, 0x3}) D:/Users/yl2356/go/pkg/mod/github.com/spf13/[email protected]/command.go:1019 +0xa7b github.com/spf13/cobra.(*Command).ExecuteC(0x1454720) D:/Users/yl2356/go/pkg/mod/github.com/spf13/[email protected]/command.go:1148 +0x40c github.com/spf13/cobra.(*Command).Execute(...) D:/Users/yl2356/go/pkg/mod/github.com/spf13/[email protected]/command.go:1071 main.main() D:/Application/GoldenDict/plugins/goldendict-llm/main.go:200 +0x1a 本帖最后由 gm1203869957 于 2025-3-28 15:50 编辑
edin 发表于 2025-3-28 11:14
试了一下,错误信息:
查询错误:程序返回,退出代码为 2. panic: adapter siliconflow not found gorouti ...
adapter siliconflow not found 看起来是因为配置不对,你可以把你的配置文件和命令行文本也贴上来。(注意隐藏自己的 Token)
我猜你的配置可能是这样的:
adapter: siliconflow
adapters:
openai:
url: "https://api.openai.com/v1/chat/completions"
token: "your-api-key-here"
model: "gpt-3.5-turbo"
你需要改成这样:adapters 里面也要配置你填的 adapter 名称
adapter: siliconflow
adapters:
siliconflow:
url: "https://api.openai.com/v1/chat/completions"
token: "your-api-key-here"
model: "gpt-3.5-turbo"
牛就一个字 gm1203869957 发表于 2025-3-28 15:45
adapter siliconflow not found 看起来是因为配置不对,你可以把你的配置文件和命令行文本也贴上来。(注 ...
谢谢指导,成功了!
页:
[1]