به‌روزرسانی: پشتیبانی پویا از مدل‌های جدید و قالب‌بندی خودکار عناوین کاتالوگ ارائه‌دهنده

This commit is contained in:
mjalmoudy94
2026-10-13 08:35:09 +00:00
parent 5a64ebf560
commit f21abf53ee
4 changed files with 26 additions and 7 deletions
+23 -4
View File
@@ -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]
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@agy/web",
"version": "0.1.2",
"version": "0.1.3",
"private": true,
"description": "Smart Organization frontend — Next.js App Router, RTL, dark-first.",
"scripts": {
+1 -1
View File
@@ -12,7 +12,7 @@
* "the app is on the wrong version" bug into a failing test, which is the
* whole point of keeping them separate.
*/
export const APP_VERSION = "0.1.2";
export const APP_VERSION = "0.1.3";
/** What the footer pill renders — ``v`` prefix keeps it unambiguous in the UI. */
export const APP_VERSION_LABEL = `v${APP_VERSION}`;