Description
Please read this first
- Have you read the docs?Agents SDK docs Yes
- Have you searched for related issues? Others may have had similar requests Yes
Describe the feature
Currently, I'm developing a tool that calls other models. It needs to read the parent agent's history to complete specific tasks, but I haven't found a good way to get this information in a non-streaming context. Right now, I have to resort to methods like this to retrieve it.
context = Context()
r = Runner.run_streamed(
agent,
"""You are solving a Github issue in the repository.
You must make the changes to solve, close, or address the issue, directly in the code.""",
context=context,
max_turns=200,
)
context.run_result_streaming = r
await wait_rrs(r)
Then read context.run_result_streaming.new_items
it in tool.
When I run in non-streaming mode, I haven't found a way to get new_items
during the run.
await Runner.run(
agent,
"""You are solving a Github issue in the repository.
You must make the changes to solve, close, or address the issue, directly in the code.""",
context=context,
max_turns=200,
)
Q&A
- Why I need this feature
I'm developing an agent that needs to call other inference models during its operation to perform complex inferences on the agent's historical records. I considered handoff
, but found that managing the transfer and return of control was quite cumbersome and unstable. Therefore, I had to use tools to call other inference models.
- Why I need to use non-streaming
The agent I'm currently developing is not human-facing, so the simplest non-streaming is sufficient. Moreover, my internal environment doesn't properly support streaming interfaces, making it difficult to use them extensively.