Go CLI: update list supported models (#15845)

### What problem does this PR solve?

Now list supported models will show more info.

```
RAGFlow(api/default)> list supported models from 'gitee' 'test';
+-----------+------------+-------------+----------------------------------------------------------+---------------------------------------------+
| dimension | max_tokens | model_types | name                                                     | thinking                                    |
+-----------+------------+-------------+----------------------------------------------------------+---------------------------------------------+
|           |            |             | Wan2.7                                                   |                                             |
|           |            |             | HappyHorse-1.0                                           |                                             |
|           |            |             | Qwen3.6-27B@Qwen                                         |                                             |
|           |            |             | Qwen3.6-35B-A3B@Qwen                                     |                                             |
|           | 1048576    | [chat]      | DeepSeek-V4-Flash@deepseek-ai                            | map[clear_thinking:true default_value:true] |
|           | 1048576    | [chat]      | DeepSeek-V4-Pro@deepseek-ai                              | map[clear_thinking:true default_value:true] |
+-----------+------------+-------------+----------------------------------------------------------+---------------------------------------------+
```

### Type of change

- [x] New Feature (non-breaking change which adds functionality)

Signed-off-by: Jin Hai <haijin.chn@gmail.com>
This commit is contained in:
Jin Hai
2026-06-09 19:01:00 +08:00
committed by GitHub
parent f0efa63bf2
commit 719ce15c95
68 changed files with 357 additions and 258 deletions
+3 -3
View File
@@ -444,7 +444,7 @@ func (o *OpenAIModel) Embed(modelName *string, texts []string, apiConfig *APICon
}
// ListModels returns the list of model ids visible to the API key.
func (o *OpenAIModel) ListModels(apiConfig *APIConfig) ([]string, error) {
func (o *OpenAIModel) ListModels(apiConfig *APIConfig) ([]ListModelResponse, error) {
if err := o.baseModel.APIConfigCheck(apiConfig); err != nil {
return nil, err
}
@@ -493,7 +493,7 @@ func (o *OpenAIModel) ListModels(apiConfig *APIConfig) ([]string, error) {
return nil, fmt.Errorf("invalid models list format")
}
models := make([]string, 0)
models := make([]ListModelResponse, 0)
for _, model := range data {
modelMap, ok := model.(map[string]interface{})
if !ok {
@@ -503,7 +503,7 @@ func (o *OpenAIModel) ListModels(apiConfig *APIConfig) ([]string, error) {
if !ok {
continue
}
models = append(models, modelName)
models = append(models, ListModelResponse{Name: modelName})
}
return models, nil