Update kimi.go

This commit is contained in:
公明 2025-02-27 10:10:33 +08:00 committed by GitHub
parent d71acbfe57
commit bc9d7971ee
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -6,6 +6,7 @@ import (
"errors" "errors"
"fmt" "fmt"
"net/http" "net/http"
"yuequanScan/config"
) )
// 定义请求参数结构体 // 定义请求参数结构体
@ -40,7 +41,7 @@ func Kimi(url, respA, respB string) (string, error) {
Messages: []MessageKimi{ Messages: []MessageKimi{
{ {
Role: "system", Role: "system",
Content: prompt, Content: config.Prompt,
}, },
{ {
Role: "user", Role: "user",
@ -63,7 +64,7 @@ func Kimi(url, respA, respB string) (string, error) {
fmt.Println("创建请求失败:", err) fmt.Println("创建请求失败:", err)
return "", err return "", err
} }
req.Header.Set("Authorization", fmt.Sprintf("Bearer %s", apiKeyKimi)) req.Header.Set("Authorization", fmt.Sprintf("Bearer %s", config.GetConfig().APIKeys.Kimi))
req.Header.Set("Content-Type", "application/json") req.Header.Set("Content-Type", "application/json")
// 发送请求 // 发送请求