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:
YueGuobin committed 2026-03-03 22:27:28 +08:00
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