fix: output 2 lines when list-supported models (#16015)

### What problem does this PR solve?

```
RAGFlow(api/default)> list supported models from 'longcat' 'test'
+-----------+------------+---------------+------------+-------------+-----------------------------+----------+
| dimension | dimensions | max_dimension | max_tokens | model_types | name                        | thinking |
+-----------+------------+---------------+------------+-------------+-----------------------------+----------+
|           |            |               |            |             | LongCat-2.0-Preview@LongCat |          |
|           |            |               |            |             | LongCat-2.0-Preview@LongCat |          |
+-----------+------------+---------------+------------+-------------+-----------------------------+----------+

# Fixed:

RAGFlow(api/default)> list supported models from 'longcat' 'test'
+------------+---------------+------------+-------------+-----------------------------+----------+
| dimensions | max_dimension | max_tokens | model_types | name                        | thinking |
+------------+---------------+------------+-------------+-----------------------------+----------+
|            |               |            |             | LongCat-2.0-Preview@LongCat |          |
+------------+---------------+------------+-------------+-----------------------------+----------+
```

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
Haruko386
2026-06-15 15:26:35 +08:00
committed by GitHub
parent cafd8a1125
commit 0480dee83f

View File

@@ -275,17 +275,6 @@ func (m *ModelProviderService) ListSupportedModels(providerName, instanceName, u
"model_types": model.ModelTypes,
"thinking": model.Thinking,
})
modelData := map[string]interface{}{
"name": model.Name,
"dimension": model.MaxDimension,
"max_tokens": model.MaxTokens,
"model_types": model.ModelTypes,
"thinking": model.Thinking,
}
if len(model.Dimensions) > 0 {
modelData["dimensions"] = model.Dimensions
}
result = append(result, modelData)
}
return result, nil
}