-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
feat(client): add ._request_id property to object responses #1707
Conversation
c6d1822
to
06bd42e
Compare
06bd42e
to
48026f3
Compare
58eeaf2
to
e3493e2
Compare
351af85
to
73f9fda
Compare
Nice - this seems like a good thing to do to all the SDKs. |
yup I'm working on this for the Node SDK as well :) |
There was a problem hiding this 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.
eeaa015
to
d2f6e40
Compare
d2f6e40
to
c42e30e
Compare
c42e30e
to
e6b7f13
Compare
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'. |
@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 |
No description provided.