更新consul部分

This commit is contained in:
Cold
2026-03-12 08:51:25 +08:00
committed by admin
parent 865cae5e9a
commit 9b900c1159
3 changed files with 79 additions and 24 deletions
+6 -2
View File
@@ -162,8 +162,12 @@ func (c *Client) UploadDocumentFromText(ctx context.Context, datasetId, content,
filename = "document.txt"
}
// 构造URL
url := c.BaseURL + "/api/v1/datasets/" + datasetId + "/documents"
// 构造URL(使用负载均衡)
endpoint := c.getNextEndpoint()
if endpoint == "" {
return "", gerror.New("RAGFlow endpoints not configured")
}
url := endpoint + "/api/v1/datasets/" + datasetId + "/documents"
// 创建multipart writer
body := &bytes.Buffer{}