feat: allow chat model bind a fixed api key

This commit is contained in:
RockYang
2024-04-12 17:09:22 +08:00
parent 4991e50e16
commit 170b41441b
22 changed files with 183 additions and 84 deletions

View File

@@ -47,7 +47,7 @@ func (h *ChatHandler) sendBaiduMessage(
promptCreatedAt := time.Now() // 记录提问时间
start := time.Now()
var apiKey = model.ApiKey{}
response, err := h.doRequest(ctx, req, session.Model.Platform, &apiKey)
response, err := h.doRequest(ctx, req, session, &apiKey)
logger.Info("HTTP请求完成耗时", time.Now().Sub(start))
if err != nil {
if strings.Contains(err.Error(), "context canceled") {