From 13a7371e07a02e943fed53468134741e369bf9f4 Mon Sep 17 00:00:00 2001 From: Jaden Fix Date: Thu, 8 Oct 2026 19:30:43 -0700 Subject: [PATCH] Fix batch examples reading .outputs from batch results JobBatch.wait() returns AgentJobResultItem objects, whose outputs are in .result (nullable), not .outputs, so both examples raised AttributeError once the jobs finished. Matches the batch example in SDK_EXAMPLES.md. Tested: ruff check/format on examples/; confirmed the field names in roe._generated.models.agent_job_result_item. Running the examples needs a Roe API key. --- examples/run_agent_many.py | 2 +- examples/run_agent_with_timeout.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/run_agent_many.py b/examples/run_agent_many.py index 45643dd..241b03b 100644 --- a/examples/run_agent_many.py +++ b/examples/run_agent_many.py @@ -41,7 +41,7 @@ def main(): print(f"Completed {len(results)} jobs:") for i, result in enumerate(results, 1): print(f"\nJob {i}:") - for output in result.outputs: + for output in result.result or []: print(f" {output.key}: {output.value}") diff --git a/examples/run_agent_with_timeout.py b/examples/run_agent_with_timeout.py index 102625a..bdaed37 100755 --- a/examples/run_agent_with_timeout.py +++ b/examples/run_agent_with_timeout.py @@ -103,7 +103,7 @@ def example_batch_with_timeout(): print(f"✓ All {len(results)} jobs completed successfully!") for i, result in enumerate(results, 1): print(f"\n Job {i}:") - for output in result.outputs: + for output in result.result or []: print(f" {output.key}: {output.value}") except TimeoutError as e: