بهروزرسانی: پشتیبانی پویا از مدلهای جدید و قالببندی خودکار عناوین کاتالوگ ارائهدهنده
This commit is contained in:
@@ -107,9 +107,8 @@ EFFORT_THINKING_BUDGETS: dict[str, int] = {
|
||||
#: a model that does not support it — that is a hard 400 from the backend.
|
||||
_THINKING_MARKERS: tuple[str, ...] = (
|
||||
"thinking",
|
||||
"gemini-3",
|
||||
"gemini-2.5-pro",
|
||||
"gemini-2.5-flash",
|
||||
"tiered",
|
||||
"gemini-",
|
||||
)
|
||||
|
||||
|
||||
@@ -698,7 +697,11 @@ class AgyModelAdapter:
|
||||
if model_id.startswith("tab_") or model_id.startswith("chat_"):
|
||||
continue
|
||||
|
||||
display_name = str(details.get("displayName") or model_id)
|
||||
raw_dn = details.get("displayName")
|
||||
if raw_dn and str(raw_dn).strip():
|
||||
display_name = str(raw_dn).strip()
|
||||
else:
|
||||
display_name = cls._format_model_name(model_id)
|
||||
supports_images = bool(details.get("supportsImages"))
|
||||
supports_thinking = bool(details.get("supportsThinking"))
|
||||
if not supports_thinking and _supports_thinking(model_id):
|
||||
@@ -719,6 +722,22 @@ class AgyModelAdapter:
|
||||
)
|
||||
return items
|
||||
|
||||
@classmethod
|
||||
def _format_model_name(cls, model_id: str) -> str:
|
||||
"""Dynamic fallback formatter for models without a displayName from agy."""
|
||||
parts = model_id.split("-")
|
||||
words: list[str] = []
|
||||
for p in parts:
|
||||
if p == "tiered":
|
||||
words.append("(Tiered)")
|
||||
elif p in ("agent", "thinking", "image", "preview"):
|
||||
words.append(f"({p.title()})")
|
||||
elif p.isdigit() or any(c.isdigit() for c in p):
|
||||
words.append(p)
|
||||
else:
|
||||
words.append(p.title())
|
||||
return " ".join(words)
|
||||
|
||||
@classmethod
|
||||
def _supported_efforts_for(
|
||||
cls, model_id: str, details: dict[str, Any]
|
||||
|
||||
Reference in New Issue
Block a user