更新consul部分

This commit is contained in:
Cold
2026-01-09 17:57:14 +08:00
committed by 张斌
parent 865cae5e9a
commit 9b900c1159
3 changed files with 79 additions and 24 deletions

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{}