feat: add realtime workflow vision tools
This commit is contained in:
@@ -30,6 +30,19 @@ router = APIRouter(
|
||||
tags=["model-registry"],
|
||||
dependencies=[Depends(require_admin)],
|
||||
)
|
||||
NATIVE_IMAGE_UNSUPPORTED_REALTIME_INTERFACES = frozenset(
|
||||
{"qwen-audio-realtime"}
|
||||
)
|
||||
|
||||
|
||||
def _supports_configurable_image_input(definition: InterfaceDefinition) -> bool:
|
||||
if definition.capability == "LLM":
|
||||
return True
|
||||
return (
|
||||
definition.capability == "Realtime"
|
||||
and definition.interface_type
|
||||
not in NATIVE_IMAGE_UNSUPPORTED_REALTIME_INTERFACES
|
||||
)
|
||||
|
||||
|
||||
def _definition_dict(row: InterfaceDefinition) -> dict:
|
||||
@@ -156,9 +169,11 @@ async def create_model_resource(
|
||||
interface_type=definition.interface_type,
|
||||
values=body.values,
|
||||
secrets=secrets,
|
||||
support_image_input=body.support_image_input
|
||||
if definition.capability == "LLM"
|
||||
else False,
|
||||
support_image_input=(
|
||||
body.support_image_input
|
||||
if _supports_configurable_image_input(definition)
|
||||
else False
|
||||
),
|
||||
enabled=body.enabled,
|
||||
is_default=body.is_default,
|
||||
)
|
||||
@@ -244,7 +259,9 @@ async def update_model_resource(
|
||||
row.values = body.values
|
||||
row.secrets = secrets
|
||||
row.support_image_input = (
|
||||
body.support_image_input if definition.capability == "LLM" else False
|
||||
body.support_image_input
|
||||
if _supports_configurable_image_input(definition)
|
||||
else False
|
||||
)
|
||||
row.enabled = body.enabled
|
||||
row.is_default = body.is_default
|
||||
|
||||
Reference in New Issue
Block a user