Skip to content
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

[Python] Support stream responses #1028

Merged
merged 4 commits into from
Sep 24, 2024
Merged

[Python] Support stream responses #1028

merged 4 commits into from
Sep 24, 2024

Conversation

hinthornw
Copy link
Collaborator

@hinthornw hinthornw commented Sep 20, 2024

Both OpenAI & Anthropic's *.create() methods are not generators but in-fact return iterators.

This means that you couldn't use the current @traceable decorator directly (since it would either log the iterator object itself as the response and close the run early OR , as in our workaround, we'd convert it to a generator)

This meant you couldn't directly access the object's other properties.

@hinthornw hinthornw force-pushed the wfh/alwaysfinish branch 3 times, most recently from ef8df53 to 78afa74 Compare September 20, 2024 23:12
@hinthornw hinthornw merged commit 727e412 into main Sep 24, 2024
7 of 8 checks passed
@hinthornw hinthornw deleted the wfh/alwaysfinish branch September 24, 2024 17:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants