File tree Expand file tree Collapse file tree 2 files changed +34
-0
lines changed
Expand file tree Collapse file tree 2 files changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,8 @@ b站相关API
1010颜文字抽象转写
1111## huggingface
1212huggingface API
13+ ## kimoi
14+ AI匹配kimoi词库
1315## neteasemusic
1416网易云的一些简单功能
1517## novelai
Original file line number Diff line number Diff line change 1+ package kimoi
2+
3+ import (
4+ "bytes"
5+ "encoding/base64"
6+ "encoding/json"
7+ "net/http"
8+
9+ base14 "github.com/fumiama/go-base16384"
10+ )
11+
12+ const key = "暻撈莬穔僿貶稙棯悟澸滰蓱咜唕母屬石褤汴儱榅璕婴㴅"
13+
14+ const api = "https://ninex.azurewebsites.net/api/chat?code="
15+
16+ type Response struct {
17+ Reply string `json:"reply"`
18+ Confidence float64 `json:"confidence"`
19+ }
20+
21+ func Chat (msg string ) (r Response , err error ) {
22+ resp , err := http .Post (
23+ api + base64 .URLEncoding .EncodeToString (base14 .DecodeFromString (key )),
24+ "text/plain" , bytes .NewBufferString (msg ),
25+ )
26+ if err != nil {
27+ return
28+ }
29+ defer resp .Body .Close ()
30+ err = json .NewDecoder (resp .Body ).Decode (& r )
31+ return
32+ }
You can’t perform that action at this time.
0 commit comments