This commit is contained in:
Cold
2026-01-17 17:58:13 +08:00
committed by 张斌
parent 138b81640c
commit 02e75e57da
5 changed files with 49 additions and 15 deletions

View File

@@ -149,7 +149,7 @@ func (c *Client) request(ctx context.Context, method, path string, body interfac
g.Log().Infof(ctx, "RAGFlow请求体: %s", bodyJSON)
}
// 创建新的HTTP客户端实例避免共享状态
// 使用common/http包
var headers = make(map[string]string)
headers["Authorization"] = "Bearer " + c.APIKey
headers["Content-Type"] = "application/json"
@@ -161,7 +161,6 @@ func (c *Client) request(ctx context.Context, method, path string, body interfac
case "PUT":
err = http.Put(ctx, fullURL, headers, result, body)
case "DELETE":
if body != nil {
err = http.Delete(ctx, fullURL, headers, result, body)
} else {

View File

@@ -157,9 +157,6 @@ func (c *Client) ListDatasets(ctx context.Context, req *ListDatasetsReq) (*ListD
return nil, err
}
// 添加调试日志
g.Log().Infof(ctx, "ListDatasets原始响应: code=%d, total=%d, data_len=%d", res.Code, res.Total, len(res.Data))
if res.Code != 0 {
return nil, gerror.Newf("list datasets failed: code=%d", res.Code)
}

View File

@@ -208,7 +208,6 @@ func (c *Client) UploadDocumentFromText(ctx context.Context, datasetId, content,
}
respBody := resp.ReadAll()
g.Log().Debugf(ctx, "RAGFlow上传文档响应: %s", string(respBody))
if err := json.Unmarshal(respBody, &response); err != nil {
g.Log().Errorf(ctx, "解析RAGFlow响应失败: %v, 原始响应: %s", err, string(respBody))