掌上百科 - PDAWIKI

 找回密码
 免费注册

QQ登录

只需一步,快速开始

查看: 561|回复: 4

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

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

    [LV.1]初来乍到

    发表于 2025-3-27 09:25:02 | 显示全部楼层 |阅读模式
    给 GoldenDict 编写了一个简单的外部程序,使用 LLM API 进行查词。
    8 I5 Y, o- ~) T: o- o9 k  f; i7 ^, v3 T  N+ u
    可以对接兼容 OpenAI 的平台。输出格式我直接参考的朗文。; |7 a: b% l3 P- s# i9 r
    2 a2 r4 K8 Z2 L; o" G4 l% U
    项目地址:https://github.com/gitsang/goldendict-llm5 D0 Z8 u, Z6 v# H0 S& Q9 e
    , M; @! |1 d6 e" K- u
    6 p6 v$ O- ?/ s1 i+ Y1 c& c, }

    9 B7 }/ a" @8 A3 n5 m用 Golang 写的,直接下载 EXE,不用装各种依赖。8 U2 M& D& a" S# x3 A

    ( E1 R& Z% t- `- d) l+ g" _目前就非常粗暴的让 LLM 自己去识别格式,所以输出可能会慢一点,我会慢慢优化 Prompt,欢迎 PR、Fork 或提交 Issue
  • TA的每日心情
    奋斗
    2025-4-7 15:19
  • 签到天数: 481 天

    [LV.9]以坛为家II

    发表于 2025-3-28 11:14:40 | 显示全部楼层
    试了一下,错误信息:  G& u& i6 U9 z* V; S

      U+ t: b7 d1 w- ]# C# n" y查询错误:程序返回,退出代码为 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 编辑
    2 S( q- @& \* z) ?- \2 V% H6 M
    edin 发表于 2025-3-28 11:14
    6 c4 \$ a8 U4 K. W( ?试了一下,错误信息:- `: S/ O" ?- p7 a
    5 T. k+ K  y0 N8 B! N' f( ~; R
    查询错误:程序返回,退出代码为 2. panic: adapter siliconflow not found gorouti ...
      h) L. B# _. I' w+ E# U
    $ v$ y( l  a3 [7 G
    adapter siliconflow not found 看起来是因为配置不对,你可以把你的配置文件和命令行文本也贴上来。(注意隐藏自己的 Token)' ~: j+ ^; z; \# _& b+ d

    . ?# W" l8 R* ^, s( R, p2 x! ~  |# P我猜你的配置可能是这样的:. d& s9 f! v8 v8 O
    8 K4 h! [( I8 o
    1. adapter: siliconflow . e% i* ?1 {5 p( }' J  Q

    2. " \; c. b7 e1 }. R
    3. adapters:4 X( j: w- C1 m) h
    4.   openai:
      8 m' Q. V, @, R
    5.     url: "https://api.openai.com/v1/chat/completions"! _- U/ [/ L, L
    6.     token: "your-api-key-here"* u! W$ d& s+ {8 b
    7.     model: "gpt-3.5-turbo"
      ) ^. p6 w' N9 b3 D; e: z) e  p! U$ B
    复制代码

    0 K7 H: I/ G/ @- N% @7 A
    ! I! d. y/ J0 N3 \0 g你需要改成这样:adapters 里面也要配置你填的 adapter 名称- x6 {# |7 `$ A) w. t& U+ Z
      J# Z; U$ [7 O4 ]; Z) W
    1. adapter: siliconflow 1 L  V7 m# a, h6 B

    2. ! S" \9 \- s8 {4 ]5 N
    3. adapters:0 o; w! ?$ C4 N  v
    4.   siliconflow:1 W# Y0 ]/ X* Z0 M
    5.     url: "https://api.openai.com/v1/chat/completions"
      ( f* d0 b3 F+ e/ F4 N
    6.     token: "your-api-key-here"
      3 W0 W3 v4 M1 _8 T% l
    7.     model: "gpt-3.5-turbo"
      & C9 `4 h8 b* m- j0 i) `
    复制代码
    / U& |7 s4 r# e: d
  • TA的每日心情
    擦汗
    6 天前
  • 签到天数: 549 天

    [LV.9]以坛为家II

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

    [LV.9]以坛为家II

    发表于 2025-4-1 10:02:54 | 显示全部楼层
    gm1203869957 发表于 2025-3-28 15:45# L6 p! h1 x/ M/ b
    adapter siliconflow not found 看起来是因为配置不对,你可以把你的配置文件和命令行文本也贴上来。(注 ...

    " x) v" C* |+ N+ D谢谢指导,成功了!
    您需要登录后才可以回帖 登录 | 免费注册

    本版积分规则

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

    GMT+8, 2025-4-21 19:38 , Processed in 0.023560 second(s), 27 queries .

    Powered by Discuz! X3.4

    © 2001-2023 Discuz! Team.

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