feat: add session-scoped client tool waits
This commit is contained in:
@@ -19,6 +19,7 @@ class ToolRuntimePolicy:
|
||||
allow_interruptions: bool
|
||||
execution_mode: str
|
||||
wait_for_response: bool
|
||||
response_wait_mode: str
|
||||
|
||||
@property
|
||||
def cancel_on_interruption(self) -> bool:
|
||||
@@ -38,8 +39,12 @@ def policy_for_tool(tool: RuntimeTool) -> ToolRuntimePolicy:
|
||||
mode = str(config.get("execution_mode") or default_mode)
|
||||
if mode not in {"immediate", "async"}:
|
||||
mode = default_mode
|
||||
response_wait_mode = str(config.get("response_wait_mode") or "timeout")
|
||||
if response_wait_mode not in {"timeout", "session"}:
|
||||
response_wait_mode = "timeout"
|
||||
return ToolRuntimePolicy(
|
||||
allow_interruptions=bool(config.get("allow_interruptions", True)),
|
||||
execution_mode=mode,
|
||||
wait_for_response=bool(config.get("wait_for_response", True)),
|
||||
response_wait_mode=response_wait_mode,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user