refactor: update model details handling in CLI

- Renamed test function to better reflect its purpose.
- Enhanced model details structure by adding DisplayName and DisplayNameShort fields in buildCLIModelDetails.
- Updated test cases to validate the new fields and ensure correct functionality.
This commit is contained in:
leookun
2026-08-08 15:45:59 +08:00
parent 2393df1cb8
commit 297b56aed0
3 changed files with 15 additions and 91 deletions
+4 -2
View File
@@ -728,8 +728,10 @@ func buildCLIModelDetails(adapters []legacyruntime.ModelAdapterConfig) []map[str
continue
}
models = append(models, map[string]any{
"modelId": channelID,
"displayModelId": channelID,
"modelId": channelID,
"displayModelId": channelID,
"displayName": strings.TrimSpace(adapter.DisplayName),
"displayNameShort": strings.TrimSpace(adapter.DisplayName),
"apiKeyCredentials": map[string]any{
"apiKey": strings.TrimSpace(adapter.APIKey),
"baseUrl": strings.TrimSpace(adapter.BaseURL),