feat: organize tools and enable qwen realtime calls
This commit is contained in:
@@ -6,7 +6,7 @@ import asyncio
|
||||
import json
|
||||
from typing import Any
|
||||
|
||||
from models import RuntimeTool
|
||||
from models import RuntimeTool, RuntimeToolBinding
|
||||
from services.runtime_variables import DynamicVariableStore
|
||||
from services.tool_executor import ToolExecutionError, ToolExecutor
|
||||
from test_schemas import ToolCallExpectedBehavior
|
||||
@@ -34,9 +34,9 @@ class MockToolExecutor(ToolExecutor):
|
||||
tool: RuntimeTool,
|
||||
arguments: dict[str, Any] | None = None,
|
||||
*,
|
||||
binding: RuntimeToolBinding | None = None,
|
||||
result_assignments: dict[str, str] | None = None,
|
||||
) -> dict[str, Any]:
|
||||
self.register_secrets(tool)
|
||||
behavior = self._mocks_by_tool_id.get(tool.id) or self._mocks_by_function.get(
|
||||
tool.function_name
|
||||
)
|
||||
@@ -62,7 +62,11 @@ class MockToolExecutor(ToolExecutor):
|
||||
return self._apply_result_assignments(
|
||||
tool,
|
||||
result,
|
||||
result_assignments=result_assignments,
|
||||
result_assignments=(
|
||||
result_assignments
|
||||
if result_assignments is not None
|
||||
else (binding.result_assignments if binding is not None else {})
|
||||
),
|
||||
)
|
||||
|
||||
|
||||
@@ -72,6 +76,9 @@ class TextClientToolPort:
|
||||
def __init__(self) -> None:
|
||||
self.auto_confirmed_messages: list[dict[str, Any]] = []
|
||||
|
||||
def supports(self, function_name: str) -> bool:
|
||||
return function_name == "show_message"
|
||||
|
||||
async def call(
|
||||
self,
|
||||
function_name: str,
|
||||
|
||||
Reference in New Issue
Block a user