fix(llm-validation): accept stepfun multimodal models and return 422 on capability mismatch
This commit is contained in:
@@ -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=(
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user