Update qianwen.go

This commit is contained in:
公明 authored and GitHub committed 2025-02-27 10:11:12 +08:00
1 parent bc9d7971ee
commit f13caf2b61
1 file changed
+3 -2
+3 -2
View File
@@ -7,6 +7,7 @@ import (
"io"
"net/http"
"time"
"yuequanScan/config"
)
// 通义千问API配置
@@ -55,7 +56,7 @@ func Qianwen(url, respA, respB string) (string, error) {
Messages: []Message{
{
Role: "system",
Content: prompt,
Content: config.Prompt,
},
{
Role: "user",
@@ -80,7 +81,7 @@ func Qianwen(url, respA, respB string) (string, error) {
// 设置请求头
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Authorization", "Bearer "+apiKeyQianwen)
req.Header.Set("Authorization", "Bearer "+config.GetConfig().APIKeys.Qianwen)
req.Header.Set("X-DashScope-Request-ID", fmt.Sprintf("%d", time.Now().UnixNano()))
req.Header.Set("X-DashScope-SSEService", "simple")