feat: refactor LLM api request code, get API URL from ApiKey object

This commit is contained in:
RockYang
2024-01-04 14:51:33 +08:00
parent d1950acd01
commit a06a81a415
13 changed files with 59 additions and 53 deletions

View File

@@ -46,7 +46,7 @@ func (h *ChatHandler) sendBaiduMessage(
ws *types.WsClient) error {
promptCreatedAt := time.Now() // 记录提问时间
start := time.Now()
var apiKey = userVo.ChatConfig.ApiKeys[session.Model.Platform]
var apiKey = model.ApiKey{}
response, err := h.doRequest(ctx, req, session.Model.Platform, &apiKey)
logger.Info("HTTP请求完成耗时", time.Now().Sub(start))
if err != nil {