掌上百科 - PDAWIKI

 找回密码
 免费注册

QQ登录

只需一步,快速开始

查看: 786|回复: 4

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

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

    [LV.1]初来乍到

    发表于 2025-3-27 09:25:02 | 显示全部楼层 |阅读模式
    给 GoldenDict 编写了一个简单的外部程序,使用 LLM API 进行查词。
    6 a8 h1 T: M/ T9 f
    0 o) H7 B7 l& }6 Q1 v可以对接兼容 OpenAI 的平台。输出格式我直接参考的朗文。
    + ?5 l. `, ^# g1 G! e- s
      m! C1 w) P4 F7 L5 x8 }, `7 s项目地址:https://github.com/gitsang/goldendict-llm6 l( D/ Z. C0 {8 p9 y

    / ?$ |8 b7 Q2 T
    4 o  V4 @( ?$ u% s1 |% o& t+ O$ c( T6 O! ~% w/ r
    用 Golang 写的,直接下载 EXE,不用装各种依赖。
    + p4 y/ B7 ^2 D' r) |, r! k
    / z, ^  \0 `% o5 L目前就非常粗暴的让 LLM 自己去识别格式,所以输出可能会慢一点,我会慢慢优化 Prompt,欢迎 PR、Fork 或提交 Issue
  • TA的每日心情

    2025-5-9 09:36
  • 签到天数: 482 天

    [LV.9]以坛为家II

    发表于 2025-3-28 11:14:40 | 显示全部楼层
    试了一下,错误信息:- Q1 s0 `: W6 Q2 p/ r# V
    4 f$ S) e! P5 ]% |  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 编辑 % ]7 e" i* C/ [9 O7 T- G- ^* @9 t" x: ~
    edin 发表于 2025-3-28 11:14
    $ Z# F! [6 k. z7 [试了一下,错误信息:. V- c7 Q4 `0 F- B2 Q

    " A  g& ^& M' c; A  J, ?* N查询错误:程序返回,退出代码为 2. panic: adapter siliconflow not found gorouti ...
    ( D" H( \8 D" w2 l( i* s+ _
    " A9 z9 i) l  t! I
    adapter siliconflow not found 看起来是因为配置不对,你可以把你的配置文件和命令行文本也贴上来。(注意隐藏自己的 Token)$ W+ d) Z) _; H& O* a# I
    3 p% f, L0 L  |1 i$ v! c
    我猜你的配置可能是这样的:
    3 v% {9 x' W5 h! |1 K/ k$ x$ e+ i0 p5 e! Z  p7 F
    1. adapter: siliconflow ( p* @- y# e+ n; I$ c. z
    2. / @1 A! N* y5 |  q. o
    3. adapters:! x5 c% z! E. p
    4.   openai:
      3 M8 h0 Y; b7 w8 R/ V# U
    5.     url: "https://api.openai.com/v1/chat/completions"+ V% h& V0 d) K) U# P* J/ p" x' ]
    6.     token: "your-api-key-here"' b3 }$ b6 J- C: f" S. w
    7.     model: "gpt-3.5-turbo"
      . s0 c  p/ n, ]3 Y% ?) C
    复制代码

    7 j( [5 D2 B. s) D+ O$ u1 P* g9 m) `: h3 g3 h+ P8 f
    你需要改成这样:adapters 里面也要配置你填的 adapter 名称" P" ^% r0 Z( h, r

      B) F5 j: }. Z2 j
    1. adapter: siliconflow   R$ s% t0 i: E! x% N  r; r

    2. - ?; m9 W! A) |9 I
    3. adapters:; H" p" v3 n$ f; p) g; m/ U* o- K% [3 f
    4.   siliconflow:
      1 N( K0 [5 }9 {3 H
    5.     url: "https://api.openai.com/v1/chat/completions"
      1 V" Q4 Z: |& ~8 c- S
    6.     token: "your-api-key-here"
      + n# K3 y! u3 U" x( S+ q
    7.     model: "gpt-3.5-turbo"
      5 Z3 y, f( E5 o4 O+ @
    复制代码
    / @0 k; K# @' ~/ `+ X2 X& M# A: ^
  • TA的每日心情
    擦汗
    前天 13:35
  • 签到天数: 558 天

    [LV.9]以坛为家II

    发表于 2025-3-29 21:40:52 | 显示全部楼层
    牛就一个字
  • TA的每日心情

    2025-5-9 09:36
  • 签到天数: 482 天

    [LV.9]以坛为家II

    发表于 2025-4-1 10:02:54 | 显示全部楼层
    gm1203869957 发表于 2025-3-28 15:453 M3 z" |. B) L
    adapter siliconflow not found 看起来是因为配置不对,你可以把你的配置文件和命令行文本也贴上来。(注 ...

    6 P/ U* _! ~3 @* F- l) g谢谢指导,成功了!
    您需要登录后才可以回帖 登录 | 免费注册

    本版积分规则

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

    GMT+8, 2025-6-16 15:52 , Processed in 0.022453 second(s), 27 queries .

    Powered by Discuz! X3.4

    © 2001-2023 Discuz! Team.

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