diff --git a/.gitignore b/.gitignore index 2666aab..96107ec 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ data.db test.json +*.exe + config.toml -*.exe \ No newline at end of file diff --git a/config example.toml b/config example.toml index fc3a200..13f6038 100644 --- a/config example.toml +++ b/config example.toml @@ -1,8 +1,7 @@ -[Server] APIURL = "0.0.0.0:5580" POSTURL = "http://0.0.0.0:5700" -[Group] + AllowGroup = [] AllowUser = [] AllowRole = [] diff --git a/workers/ai.go b/workers/ai.go index 4abacac..45dbf9c 100644 --- a/workers/ai.go +++ b/workers/ai.go @@ -65,7 +65,13 @@ func (a *AI) GetMsg() string { if len(choices) > 0 { msg = "支持的模型列表:\n" for _, choice := range choices { - msg = msg + choice.(map[string]interface{})["id"].(string) + "\n" + models := choice.(map[string]interface{})["id"].(string) + if models == MODEL { + msg = msg + models + "\t ✔\n" + } else { + msg = msg + models + "\n" + } + } } else { msg = "没查到支持模型列表" @@ -85,12 +91,14 @@ func (a *AI) GetMsg() string { } // println("PROMPT:", PROMPT) requestBody := map[string]interface{}{ - "model": MODEL, + "model": MODEL, + "stream": false, "messages": []map[string]string{{ "role": "system", "content": PROMPT, }, {"role": "user", "content": ask}}, + "max_tokens": 75, "temperature": 0.7, } request := gorequest.New()