Skip to content

Conversation

@ShreehariVaasishta
Copy link
Contributor

@ShreehariVaasishta ShreehariVaasishta commented Jun 3, 2025

  • I understand that this repository is auto-generated and my pull request may not be merged

Changes being requested

This PR adds the missing parse method to both ResponsesWithRawResponse and AsyncResponsesWithRawResponse in responses.py.

Currently, attempting to call client.responses.with_raw_response.parse() raises an AttributeError because the method isn't included in the wrapped client.

Additional context & links

This change makes it possible to use with_raw_response.parse().
Related error for context:

response = client.responses.with_raw_response.parse( model="gpt-4.1", input=[ {"role": "system", "content": "Extract the event information."}, { "role": "user", "content": "Alice and Bob are going to a science fair on Friday.", }, ], text_format=CalendarEvent, )
AttributeError: 'ResponsesWithRawResponse' object has no attribute 'parse' 
This adds the `parse` method to both `ResponsesWithRawResponse` and `AsyncResponsesWithRawResponse`.
@ShreehariVaasishta ShreehariVaasishta requested a review from a team as a code owner June 3, 2025 10:12
@ShreehariVaasishta ShreehariVaasishta changed the title Add missing parse method to with_raw_response in responses client fix: Add missing parse method to with_raw_response in responses client Jun 4, 2025
@ShreehariVaasishta
Copy link
Contributor Author

ShreehariVaasishta commented Jun 4, 2025

@RobertCraigie When you have a chance, could you please take a look at this PR?
happy to address any feedback or questions you might have.

@RobertCraigie RobertCraigie changed the title fix: Add missing parse method to with_raw_response in responses client fix(responses): support raw responses for parse() Jun 4, 2025
@RobertCraigie RobertCraigie changed the base branch from main to next June 4, 2025 13:50
Copy link
Collaborator

@RobertCraigie RobertCraigie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@RobertCraigie RobertCraigie merged commit d459943 into openai:next Jun 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants