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

feat: openai streaming tool calls #1936

Merged
merged 7 commits into from
Dec 18, 2023
Merged

Conversation

axiomofjoy
Copy link
Contributor

@axiomofjoy axiomofjoy commented Dec 12, 2023

  • adds tool call support for synchronous and asynchronous streaming
  • adds corresponding unit tests

@axiomofjoy axiomofjoy force-pushed the openai-streaming-tool-calls branch from f87d383 to 0be1a35 Compare December 12, 2023 19:24
@axiomofjoy axiomofjoy marked this pull request as ready for review December 12, 2023 21:46
src/phoenix/trace/openai/instrumentor.py Outdated Show resolved Hide resolved
Comment on lines +650 to +651
for tool_call in choice.delta.tool_calls:
tool_index = tool_call.index
Copy link
Contributor

Choose a reason for hiding this comment

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

for extra safety?

Suggested change
for tool_call in choice.delta.tool_calls:
tool_index = tool_call.index
for tool_index, tool_call in enumerate(choice.delta.tool_calls):

@axiomofjoy axiomofjoy merged commit 6dd14cf into main Dec 18, 2023
9 checks passed
@axiomofjoy axiomofjoy deleted the openai-streaming-tool-calls branch December 18, 2023 22:01
RogerHYang pushed a commit that referenced this pull request Dec 19, 2023
- adds tool call support for synchronous and asynchronous streaming
- adds corresponding unit tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

[ENHANCEMENT] support tool call semantic conventions for openai streaming
2 participants