(invocation: ToolInvocation)
| 45 | async def test_should_handle_tool_result_with_failure_resulttype(self, ctx: E2ETestContext): |
| 46 | @define_tool("check_status", description="Checks the status of a service") |
| 47 | def check_status(invocation: ToolInvocation) -> ToolResult: |
| 48 | return ToolResult( |
| 49 | text_result_for_llm="Service unavailable", |
| 50 | result_type="failure", |
| 51 | error="API timeout", |
| 52 | ) |
| 53 | |
| 54 | session = await ctx.client.create_session( |
| 55 | on_permission_request=PermissionHandler.approve_all, tools=[check_status] |