掌上百科 - PDAWIKI

 找回密码
 免费注册

QQ登录

只需一步,快速开始

查看: 442|回复: 4

[专有词库] GoldenDict 大语言模型词典

[复制链接]
  • TA的每日心情
    奋斗
    2025-3-27 09:18
  • 签到天数: 1 天

    [LV.1]初来乍到

    发表于 2025-3-27 09:25:02 | 显示全部楼层 |阅读模式
    给 GoldenDict 编写了一个简单的外部程序,使用 LLM API 进行查词。( I) _8 H! N% c8 G& E6 i+ \! d
    2 a. X- H9 R) ?1 ^5 Y2 U! z. ~
    可以对接兼容 OpenAI 的平台。输出格式我直接参考的朗文。! l" i% n# i3 s( `# G4 t

    9 v( w; S& r" R/ X$ j6 S6 v1 O项目地址:https://github.com/gitsang/goldendict-llm% C4 I5 d9 u8 F; w
    7 x5 q: w7 w' Y: x% A

    ! x' Y! [* V0 K  h& ~1 C' }' c. y6 a" _4 w) K
    用 Golang 写的,直接下载 EXE,不用装各种依赖。. O& b4 y$ F' C% p8 |/ {
    + c9 W. U- k& ~% j
    目前就非常粗暴的让 LLM 自己去识别格式,所以输出可能会慢一点,我会慢慢优化 Prompt,欢迎 PR、Fork 或提交 Issue
  • TA的每日心情
    奋斗
    3 天前
  • 签到天数: 481 天

    [LV.9]以坛为家II

    发表于 2025-3-28 11:14:40 | 显示全部楼层
    试了一下,错误信息:
    1 \7 n8 @* C: ^" b# }# {1 ?7 t4 B- S3 V
    查询错误:程序返回,退出代码为 2. panic: adapter siliconflow not found goroutine 1 [running]: 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
  • TA的每日心情
    奋斗
    2025-3-27 09:18
  • 签到天数: 1 天

    [LV.1]初来乍到

     楼主| 发表于 2025-3-28 15:45:59 | 显示全部楼层
    本帖最后由 gm1203869957 于 2025-3-28 15:50 编辑 : i  o  w# M/ h6 m2 o  F' g
    edin 发表于 2025-3-28 11:14
    # G% f4 N. q9 @' ]6 P试了一下,错误信息:2 P8 O0 @1 ~1 F+ ?8 o& e& _

    1 \/ G: ~; y+ ^$ G7 H4 m6 n查询错误:程序返回,退出代码为 2. panic: adapter siliconflow not found gorouti ...
    / z3 c! k9 R0 u6 _

    ; L5 W% N- r3 K' A: B$ yadapter siliconflow not found 看起来是因为配置不对,你可以把你的配置文件和命令行文本也贴上来。(注意隐藏自己的 Token)
    4 ~. x8 b& k; w2 m6 L1 ~7 b) A$ R, D/ ^, C7 ]$ {. u2 P! R
    我猜你的配置可能是这样的:
    . A. z) m9 z+ f3 z6 ^1 I/ h- |& p+ \# s- @8 e5 X- r
    1. adapter: siliconflow ( {3 h+ _+ A; }0 }9 K" r" N
    2. - O% h- o9 ]% X4 G6 u
    3. adapters:8 |5 b- Z' i$ ]; Y( j, D) g
    4.   openai:
      8 T9 G, V$ E: H$ a8 _' g/ J! G
    5.     url: "https://api.openai.com/v1/chat/completions"
      ' b0 B( M% J0 W0 W
    6.     token: "your-api-key-here"4 @0 F0 ^  |% N  n2 y
    7.     model: "gpt-3.5-turbo"7 }2 _& e8 Q1 ]) u% T: \
    复制代码
    : j" C9 \3 z5 O! @) F1 E

    / \& x4 w/ s( l) }" F你需要改成这样:adapters 里面也要配置你填的 adapter 名称& O1 I, e" ^  v7 H5 G  B8 o
    5 L; A6 ~; y% z* y' Y) t
    1. adapter: siliconflow ' \  h# U6 J3 i
    2. 1 a8 E- m- o) ~6 d4 W
    3. adapters:
      1 b4 m- M( R3 f! U# e" ~
    4.   siliconflow:" V) ^& l1 z* [0 A7 H0 X7 ^/ V4 B
    5.     url: "https://api.openai.com/v1/chat/completions"
      ) Y0 x# |! H% I; x
    6.     token: "your-api-key-here"
      ' z+ ~; g$ a. w( B$ c; @
    7.     model: "gpt-3.5-turbo"$ b7 B! U: }5 l! H* D0 ?% ^0 \
    复制代码
    4 {( |/ y$ c- Q
  • TA的每日心情
    擦汗
    3 天前
  • 签到天数: 548 天

    [LV.9]以坛为家II

    发表于 2025-3-29 21:40:52 | 显示全部楼层
    牛就一个字
  • TA的每日心情
    奋斗
    3 天前
  • 签到天数: 481 天

    [LV.9]以坛为家II

    发表于 2025-4-1 10:02:54 | 显示全部楼层
    gm1203869957 发表于 2025-3-28 15:45
    * f1 }1 M% w% P. O# cadapter siliconflow not found 看起来是因为配置不对,你可以把你的配置文件和命令行文本也贴上来。(注 ...

    : [/ t' ~' n6 d# H$ E谢谢指导,成功了!
    您需要登录后才可以回帖 登录 | 免费注册

    本版积分规则

    小黑屋|手机版|Archiver|PDAWIKI |网站地图

    GMT+8, 2025-4-10 21:37 , Processed in 0.021868 second(s), 25 queries .

    Powered by Discuz! X3.4

    © 2001-2023 Discuz! Team.

    快速回复 返回顶部 返回列表