From 9f916181db2726de2e47a011315fabf7119d76c5 Mon Sep 17 00:00:00 2001 From: wizardchen Date: Thu, 23 Apr 2026 11:22:44 +0800 Subject: [PATCH] refactor: Simplify logging in RemoteAPIChat HTTP requests - Removed header printing from the chatWithRawHTTP method to streamline logging. - Updated log message to focus on endpoint and model name, enhancing clarity while reducing verbosity. --- internal/models/chat/remote_api.go | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/internal/models/chat/remote_api.go b/internal/models/chat/remote_api.go index 88a0ee30..7f4be400 100644 --- a/internal/models/chat/remote_api.go +++ b/internal/models/chat/remote_api.go @@ -368,13 +368,8 @@ func (c *RemoteAPIChat) chatWithRawHTTP(ctx context.Context, endpoint string, cu httpReq.Header.Set("Authorization", "Bearer "+c.apiKey) } - // print headers - headers, err := json.Marshal(httpReq.Header) - if err != nil { - return nil, fmt.Errorf("marshal headers: %w", err) - } - logger.Infof(ctx, "[LLM Request] Remote HTTP, endpoint=%s, model=%s, headers: %s", - endpoint, c.modelName, string(headers)) + logger.Infof(ctx, "[LLM Request] Remote HTTP, endpoint=%s, model=%s", + endpoint, c.modelName) resp, err := rawHTTPClient.Do(httpReq) if err != nil {