Skip to content

Conversation

@RobertCraigie
Copy link
Collaborator

No description provided.

@stainless-bot stainless-bot force-pushed the next branch 2 times, most recently from c6d1822 to 06bd42e Compare September 12, 2024 17:03
@stainless-bot stainless-bot force-pushed the robert/add-request-id branch 3 times, most recently from 58eeaf2 to e3493e2 Compare September 16, 2024 11:59
@RobertCraigie RobertCraigie changed the base branch from next to main September 16, 2024 11:59
@RobertCraigie RobertCraigie marked this pull request as ready for review September 16, 2024 12:23
@RobertCraigie RobertCraigie requested a review from a team as a code owner September 16, 2024 12:23
@RobertCraigie RobertCraigie changed the base branch from main to next September 16, 2024 12:23
@kwhinnery-openai
Copy link
Contributor

Nice - this seems like a good thing to do to all the SDKs.

@RobertCraigie
Copy link
Collaborator Author

yup I'm working on this for the Node SDK as well :)

Copy link

@RahulVadisetty91 RahulVadisetty91 left a comment

Choose a reason for hiding this comment

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

This script is well-structured and extremely useful for anyone working with Pydantic models, especially when managing compatibility between Pydantic v1 and v2.

@stainless-bot stainless-bot force-pushed the robert/add-request-id branch 2 times, most recently from eeaa015 to d2f6e40 Compare September 17, 2024 11:49
@wilson97
Copy link

Is it possible to log the request id for async streaming as well? Right now I get the error 'AsyncStream' object has no attribute '_request_id'.

@RobertCraigie
Copy link
Collaborator Author

@wilson97 right now you can do this

stream = await client.chat.completions.create(..., stream=True) stream.response.headers.get('x-request-id') # req_xxx

but I don't see a reason not to add a request_id property to the Stream classes, will add that soon

cgayapr pushed a commit to cgayapr/openai-python that referenced this pull request Dec 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

6 participants