refactor: remove legacy assistant compatibility
This commit is contained in:
@@ -24,19 +24,9 @@ def runtime_tool(tool_type: str, config: dict | None = None) -> RuntimeTool:
|
||||
|
||||
|
||||
class ToolPolicyTests(unittest.TestCase):
|
||||
def test_backwards_compatible_execution_defaults(self):
|
||||
self.assertEqual(
|
||||
policy_for_tool(runtime_tool("http")).execution_mode,
|
||||
"immediate",
|
||||
)
|
||||
self.assertEqual(
|
||||
policy_for_tool(runtime_tool("client")).execution_mode,
|
||||
"async",
|
||||
)
|
||||
self.assertEqual(
|
||||
policy_for_tool(runtime_tool("client")).response_wait_mode,
|
||||
"timeout",
|
||||
)
|
||||
def test_missing_current_policy_is_rejected(self):
|
||||
with self.assertRaises(KeyError):
|
||||
policy_for_tool(runtime_tool("http"))
|
||||
|
||||
def test_explicit_policy_is_normalized(self):
|
||||
policy = policy_for_tool(
|
||||
@@ -55,6 +45,22 @@ class ToolPolicyTests(unittest.TestCase):
|
||||
self.assertFalse(policy.wait_for_response)
|
||||
self.assertEqual(policy.response_wait_mode, "session")
|
||||
|
||||
def test_non_client_tools_use_fixed_response_wait_policy(self):
|
||||
policy = policy_for_tool(
|
||||
runtime_tool(
|
||||
"http",
|
||||
{
|
||||
"allow_interruptions": True,
|
||||
"execution_mode": "async",
|
||||
},
|
||||
)
|
||||
)
|
||||
|
||||
self.assertTrue(policy.allow_interruptions)
|
||||
self.assertEqual(policy.execution_mode, "async")
|
||||
self.assertTrue(policy.wait_for_response)
|
||||
self.assertEqual(policy.response_wait_mode, "timeout")
|
||||
|
||||
|
||||
class ToolInterruptionStrategyTests(unittest.IsolatedAsyncioTestCase):
|
||||
async def test_releases_only_after_tool_and_following_speech_finish(self):
|
||||
|
||||
Reference in New Issue
Block a user