Go: refactor embedding interface (#14757)

### What problem does this PR solve?

Provide embedding index according to the input text

### Type of change

- [x] Refactoring

---------

Signed-off-by: Jin Hai <haijin.chn@gmail.com>
This commit is contained in:
Jin Hai
2026-05-11 14:45:30 +08:00
committed by GitHub
parent 5ef7f50eef
commit c55e23e7e2
28 changed files with 443 additions and 567 deletions

View File

@@ -1838,7 +1838,7 @@ func (c *RAGFlowClient) EmbedUserText(cmd *Command) (ResponseIf, error) {
if resp.StatusCode != 200 {
return nil, fmt.Errorf("failed to embed text: HTTP %d, body: %s", resp.StatusCode, string(resp.Body))
}
var result CommonResponse
var result EmbeddingsResponse
if err = json.Unmarshal(resp.Body, &result); err != nil {
return nil, fmt.Errorf("embed text failed: invalid JSON (%w)", err)
}