fix: 优化负利润分析和缓存处理逻辑

This commit is contained in:
renzhiyuan 2026-01-19 10:16:37 +08:00
parent de6783c66e
commit bb1cfed160
1 changed files with 7 additions and 5 deletions

View File

@ -8,6 +8,7 @@ import (
"net/url"
"os"
"sync"
"time"
"github.com/ollama/ollama/api"
)
@ -43,11 +44,12 @@ func (c *Client) ToolSelect(ctx context.Context, messages []api.Message, tools [
// 构建聊天请求
req := &api.ChatRequest{
Model: c.config.Model,
Messages: messages,
Stream: new(bool), // 设置为false不使用流式响应
Think: &api.ThinkValue{Value: false},
Tools: tools,
Model: c.config.Model,
Messages: messages,
Stream: new(bool), // 设置为false不使用流式响应
Think: &api.ThinkValue{Value: false},
Tools: tools,
KeepAlive: &api.Duration{Duration: 24 * time.Hour},
}
err = c.client.Chat(ctx, req, func(resp api.ChatResponse) error {
res = resp