mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 05:51:15 +02:00
feat(api): clarify default LLM model config selection logic
- Update API documentation to explicitly describe default configuration selection logic - Add fallback behavior in repository to use first config when no default is marked - Clarify difference between `/default` endpoint and `default_config` field - Document that `default_config` is never null when configs list is not empty
This commit is contained in:
1 parent
b06593cf2a
commit
2e4c42fadc
2 files changed
+18
-1
No files matched your search
@@ -496,6 +496,10 @@ class LLMModelConfigsRepository(BaseRepository):
|
||||
if config.is_default and default_config is None:
|
||||
default_config = configs_with_source[-1]
|
||||
|
||||
# Fallback: if no config is marked as default, use the first one
|
||||
if default_config is None and configs_with_source:
|
||||
default_config = configs_with_source[0]
|
||||
|
||||
return {
|
||||
"configs": configs_with_source,
|
||||
"default_config": default_config
|
||||
|
||||
Reference in new issue
Block a user