掌上百科 - PDAWIKI

 找回密码
 免费注册

QQ登录

只需一步,快速开始

查看: 632|回复: 4

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

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

    [LV.1]初来乍到

    发表于 2025-3-27 09:25:02 | 显示全部楼层 |阅读模式
    给 GoldenDict 编写了一个简单的外部程序,使用 LLM API 进行查词。# o- R6 h" k2 T

    ! M" [+ p# Q) N7 _8 g! h# t/ x7 H可以对接兼容 OpenAI 的平台。输出格式我直接参考的朗文。. }" f- ^8 [# r& Y6 |: J7 T6 r$ [- e7 q

    8 \5 Y! ~2 ~. P项目地址:https://github.com/gitsang/goldendict-llm
    ( h) h1 V' J6 u* E" ^
    3 e- G7 A; N& o  ^  n. v* `8 `7 g( r$ ?  v2 @, R3 r- ]0 s) r
    $ e2 t) t; z8 O) R
    用 Golang 写的,直接下载 EXE,不用装各种依赖。
    9 K' y+ b5 i1 r1 q7 T( q- |# B$ d  i4 B& O1 |  k
    目前就非常粗暴的让 LLM 自己去识别格式,所以输出可能会慢一点,我会慢慢优化 Prompt,欢迎 PR、Fork 或提交 Issue
  • TA的每日心情
    奋斗
    2025-4-7 15:19
  • 签到天数: 481 天

    [LV.9]以坛为家II

    发表于 2025-3-28 11:14:40 | 显示全部楼层
    试了一下,错误信息:
    # {1 N- [, k8 w' l; u' S& n4 s6 s  C2 u/ K! \
    查询错误:程序返回,退出代码为 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 编辑
    + F9 ^6 M5 s$ T3 V6 d; d" C
    edin 发表于 2025-3-28 11:14: @' R( M7 k$ S" E3 A3 ?* N( y
    试了一下,错误信息:7 I& X7 ^! r* F1 q. S

    5 @% ]# [0 G: ]( x, ?+ s  [查询错误:程序返回,退出代码为 2. panic: adapter siliconflow not found gorouti ...

    7 k  j' P8 w1 Z# {7 E* h! D: F
    3 e/ l8 b3 \+ P8 W) x' E1 oadapter siliconflow not found 看起来是因为配置不对,你可以把你的配置文件和命令行文本也贴上来。(注意隐藏自己的 Token)
    ( T% w1 @, Q4 \' S, _
    - V0 K* R: ~. P+ Q" B/ C6 r! r- @我猜你的配置可能是这样的:
    2 b1 k' \- ~. D9 U
    1 w0 T1 E9 U, U: J
    1. adapter: siliconflow $ V4 g, Y& i$ w' K! t

    2. & i; ~8 |( G. g" I
    3. adapters:
      6 k  l; P5 t0 z1 |$ X
    4.   openai:! r9 U' r+ p0 g# B
    5.     url: "https://api.openai.com/v1/chat/completions"7 o; a- x' V8 i: V
    6.     token: "your-api-key-here") N* w4 m9 C2 {, Y/ T
    7.     model: "gpt-3.5-turbo") ^" }; ?4 {5 a- c
    复制代码
    & `  Z8 S5 |1 V9 I/ X2 z
    ) m2 C$ P" q: i9 X; P/ y- H0 Y( [
    你需要改成这样:adapters 里面也要配置你填的 adapter 名称9 u7 W1 n3 I# R( C
    / e: N2 z, H0 I& I; B* P/ S
    1. adapter: siliconflow
      & Z& f+ U- t% U3 `& o4 h7 I0 ]) {

    2.   Q5 N: B! ~* g
    3. adapters:( }0 z8 [: Y3 f
    4.   siliconflow:( i. c+ \& w+ {
    5.     url: "https://api.openai.com/v1/chat/completions"
      : e" j, [- N! m, T
    6.     token: "your-api-key-here"
      9 t0 j- \& G- w7 U% _/ N% G
    7.     model: "gpt-3.5-turbo"
      2 `) ?8 N0 O# o+ G5 A' ~
    复制代码
    $ K2 ?; i! \, f* O/ u: v
  • TA的每日心情
    奋斗
    前天 20:28
  • 签到天数: 551 天

    [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
    ) @6 {$ h3 Q3 c- ~+ p+ s2 A* padapter siliconflow not found 看起来是因为配置不对,你可以把你的配置文件和命令行文本也贴上来。(注 ...

    - f, ]# R  P+ X谢谢指导,成功了!
    您需要登录后才可以回帖 登录 | 免费注册

    本版积分规则

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

    GMT+8, 2025-5-2 02:59 , Processed in 0.022606 second(s), 27 queries .

    Powered by Discuz! X3.4

    © 2001-2023 Discuz! Team.

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