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.
This commit is contained in:
@@ -368,13 +368,8 @@ func (c *RemoteAPIChat) chatWithRawHTTP(ctx context.Context, endpoint string, cu
|
|||||||
httpReq.Header.Set("Authorization", "Bearer "+c.apiKey)
|
httpReq.Header.Set("Authorization", "Bearer "+c.apiKey)
|
||||||
}
|
}
|
||||||
|
|
||||||
// print headers
|
logger.Infof(ctx, "[LLM Request] Remote HTTP, endpoint=%s, model=%s",
|
||||||
headers, err := json.Marshal(httpReq.Header)
|
endpoint, c.modelName)
|
||||||
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))
|
|
||||||
|
|
||||||
resp, err := rawHTTPClient.Do(httpReq)
|
resp, err := rawHTTPClient.Do(httpReq)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user