fix: unable to chat after set model (#16195)

### What problem does this PR solve?

```
fixed:

RAGFlow(api/default)> use model 'minimax-m2.5@test@minimax'
SUCCESS

RAGFlow(api/default)> chat message 'who r u'
Answer: Hey! I'm MiniMax-M2.5, an AI assistant here to help you with questions, tasks, or whatever you need. What can I do for you?
Time: 1.727263

```

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
Haruko386
2026-06-22 18:14:58 +08:00
committed by GitHub
parent b777e50291
commit 02cc1d6438
3 changed files with 41 additions and 13 deletions

View File

@@ -2830,12 +2830,14 @@ optionsLoop:
}
cmd := NewCommand("chat_to_model")
if common.IsCompositeModelName(modelNameOrID) {
cmd.Params["composite_model_name"] = modelNameOrID
} else if common.IsUUID(modelNameOrID) {
cmd.Params["model_id"] = modelNameOrID
} else {
return nil, fmt.Errorf("invalid format of model name or ID: %s", modelNameOrID)
if modelNameOrID != "" {
if common.IsCompositeModelName(modelNameOrID) {
cmd.Params["composite_model_name"] = modelNameOrID
} else if common.IsUUID(modelNameOrID) {
cmd.Params["model_id"] = modelNameOrID
} else {
return nil, fmt.Errorf("invalid format of model name or ID: %s", modelNameOrID)
}
}
cmd.Params["messages"] = messages
cmd.Params["images"] = images