feat: organize tools and enable qwen realtime calls
This commit is contained in:
@@ -10,6 +10,7 @@ from services.config_resolver import resolve_runtime_config
|
||||
from services.node_specs import graph_references
|
||||
from services.runtime_variables import prepare_dynamic_config
|
||||
from services.workflow_engine import WorkflowEngine
|
||||
from services.realtime_tool_capabilities import validate_runtime_prompt_tools
|
||||
|
||||
|
||||
async def resolve_assistant_config(
|
||||
@@ -137,6 +138,33 @@ def validate_runtime_requirements(config: AssistantConfig) -> None:
|
||||
("Realtime apiKey", config.realtime_api_key),
|
||||
],
|
||||
)
|
||||
if config.type == "prompt":
|
||||
tool_by_id = {tool.id: tool for tool in config.tools}
|
||||
missing_tool_ids = sorted(
|
||||
{
|
||||
binding.tool_id
|
||||
for binding in config.tool_bindings
|
||||
if binding.tool_id not in tool_by_id
|
||||
}
|
||||
)
|
||||
if missing_tool_ids:
|
||||
raise ValueError(
|
||||
"Prompt Realtime 引用了缺失工具:" + ",".join(missing_tool_ids)
|
||||
)
|
||||
validate_runtime_prompt_tools(
|
||||
interface_type=config.realtime_interface_type,
|
||||
external_types={
|
||||
tool_by_id[binding.tool_id].type
|
||||
for binding in config.tool_bindings
|
||||
if binding.tool_id in tool_by_id
|
||||
},
|
||||
external_function_names={
|
||||
tool_by_id[binding.tool_id].function_name
|
||||
for binding in config.tool_bindings
|
||||
if binding.tool_id in tool_by_id
|
||||
},
|
||||
built_in_tools=config.built_in_tools,
|
||||
)
|
||||
return
|
||||
|
||||
_validate_voice_resource(
|
||||
|
||||
Reference in New Issue
Block a user