Go: update chat URL (#14453)

### What problem does this PR solve?

Update the URL to: /api/v1/chat/completions

### Type of change

- [x] Refactoring

Signed-off-by: Jin Hai <haijin.chn@gmail.com>
This commit is contained in:
Jin Hai
2026-04-29 11:45:06 +08:00
committed by GitHub
parent 3b7a6eaa6c
commit b493a33316
3 changed files with 34 additions and 24 deletions

View File

@@ -1483,13 +1483,15 @@ func (c *RAGFlowClient) ChatToModel(cmd *Command) (ResponseIf, error) {
effort := cmd.Params["effort"].(string)
verbosity := cmd.Params["verbosity"].(string)
url := fmt.Sprintf("/providers/%s/instances/%s/models", providerName, instanceName)
url := fmt.Sprintf("/chat/completions")
payload := map[string]interface{}{
"model_name": modelName,
"message": message,
"stream": stream, // use stream API
"thinking": thinking,
"provider_name": providerName,
"instance_name": instanceName,
"model_name": modelName,
"message": message,
"stream": stream, // use stream API
"thinking": thinking,
}
if thinking {