Skip to content

Why full history as input is still necessary? #102

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ShaojieJiang opened this issue Mar 12, 2025 · 8 comments · Fixed by #512, #509 or #508
Closed

Why full history as input is still necessary? #102

ShaojieJiang opened this issue Mar 12, 2025 · 8 comments · Fixed by #512, #509 or #508
Labels
enhancement New feature or request

Comments

@ShaojieJiang
Copy link

Agents are using Responses API by default according to your launch video, so why is it still necessary to pass the whole history list to get an agent response?

I can understand that this is for better backward compatibility, but do you plan to support stateful agent run in the future?

@ShaojieJiang ShaojieJiang added the question Question about using the SDK label Mar 12, 2025
@rm-openai rm-openai added enhancement New feature or request and removed question Question about using the SDK labels Mar 12, 2025
@rm-openai
Copy link
Collaborator

Yes, indeed planning this. Will get to it soon!

@piscespieces
Copy link

@ShaojieJiang We'll have to wait a bit for that. The "What's New" section of the Assistants API docs says this:

We're working to achieve full feature parity between the Assistants and the Responses API, including support for Assistant-like and Thread-like objects and the Code Interpreter tool. We will communicate updates to the Assistants API in the changelog.

@ShaojieJiang
Copy link
Author

@piscespieces I tried this example using Response API's state management, and it worked nicely.

The issue with Agents SDK is that, although it uses Responses API, it's not yet possible to use OpenAI's state management yet. So it's a missing feature on the Agents SDK side.

@JRich3086
Copy link

@piscespieces I tried this example using Response API's state management, and it worked nicely.

The issue with Agents SDK is that, although it uses Responses API, it's not yet possible to use OpenAI's state management yet. So it's a missing feature on the Agents SDK side.

@ShaojieJiang can I ask for some details on how you accomplished this? I can see the previous response ID buried in response.raw_responses, but I'm not sure how to pass this back to the agent. Or did you mean you are just capturing previous message content?

@scanferla
Copy link

hey! do we have any updates on this? thanks in advance :)

@rm-openai
Copy link
Collaborator

Yes, just added support for previous_response_id to Runner.run. Should help with this.

@rm-openai
Copy link
Collaborator

See #509 for the implementation and #512 for an example of usage.

@piscespieces
Copy link

See #509 for the implementation and #512 for an example of usage.

Thank you! I just tested it locally and works great. @rm-openai

Here's an example for people who might be reading this thread.

from agents import Agent, Runner

agent = Agent(name="Assistant", instructions="You are a helpful assistant. Be very concise.")
result = await Runner.run(agent, "What is the capital of Venezuela?")

print(result.last_response_id) # => resp_67fe6a989c088190966f7aeabce045a00a3a65c85bf....
print(result.final_output) # => Caracas.

result = await Runner.run(agent, "And Colombia?", previous_response_id=result.last_response_id)

print(result.last_response_id) # => resp_123e6a989c0881904f5js6aeabce045a00a3bfg...
print(result.final_output) # => Bogotá

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
5 participants