feat(workflow): add edge-tool routing and realtime runtime
This commit is contained in:
@@ -37,6 +37,14 @@ def _validate_workflow(body: AssistantUpsert) -> None:
|
||||
return
|
||||
body.graph = normalize_graph(body.graph or {})
|
||||
errors = validate_graph(body.graph)
|
||||
settings = body.graph.get("settings") or {}
|
||||
graph_runtime_mode = str(settings.get("runtimeMode") or "pipeline")
|
||||
if graph_runtime_mode != body.runtime_mode:
|
||||
errors.append("工作流全局运行模式与 Assistant runtimeMode 不一致")
|
||||
graph_realtime_id = str(settings.get("defaultRealtimeResourceId") or "")
|
||||
bound_realtime_id = str(body.model_resource_ids.get("Realtime") or "")
|
||||
if graph_realtime_id != bound_realtime_id:
|
||||
errors.append("工作流 Realtime 模型与 Assistant Realtime 绑定不一致")
|
||||
declared_variables = set(body.dynamic_variable_definitions)
|
||||
for node in body.graph.get("nodes") or []:
|
||||
node_id = str(node.get("id") or "")
|
||||
@@ -80,6 +88,7 @@ async def _validate_workflow_references(
|
||||
resource_expectations: dict[str, str] = {}
|
||||
vision_resource_ids: set[str] = set()
|
||||
for key, capability in (
|
||||
("defaultRealtimeResourceId", "Realtime"),
|
||||
("defaultLlmResourceId", "LLM"),
|
||||
("defaultAsrResourceId", "ASR"),
|
||||
("defaultTtsResourceId", "TTS"),
|
||||
|
||||
Reference in New Issue
Block a user