更新
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user