fix(llm-validation): accept stepfun multimodal models and return 422 on capability mismatch

This commit is contained in:
2026-02-24 16:00:23 +03:00
parent 4fd9d6b6d5
commit 5f6e9c0cc0
5 changed files with 37 additions and 8 deletions

View File

@@ -1239,7 +1239,7 @@ async def _dispatch_intent(
)
provider = LLMProviderService(db).get_provider(provider_id)
provider_model = provider.default_model if provider else ""
if not is_multimodal_model(provider_model):
if not is_multimodal_model(provider_model, provider.provider_type if provider else None):
raise HTTPException(
status_code=422,
detail=(

View File

@@ -83,9 +83,13 @@ async def create_task(
db_provider = llm_service.get_provider(provider_id)
if not db_provider:
raise ValueError(f"LLM Provider {provider_id} not found")
if request.plugin_id == "llm_dashboard_validation" and not is_multimodal_model(db_provider.default_model):
raise ValueError(
"Selected provider model is not multimodal for dashboard validation"
if request.plugin_id == "llm_dashboard_validation" and not is_multimodal_model(
db_provider.default_model,
db_provider.provider_type,
):
raise HTTPException(
status_code=status.HTTP_422_UNPROCESSABLE_ENTITY,
detail="Selected provider model is not multimodal for dashboard validation",
)
finally:
db.close()