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

Question about Tool Call Streaming #326

Open
Lightblues opened this issue Mar 25, 2025 · 3 comments
Open

Question about Tool Call Streaming #326

Lightblues opened this issue Mar 25, 2025 · 3 comments
Labels
enhancement New feature or request

Comments

@Lightblues
Copy link

I found that OpenAIChatCompletionsModel can only stream out text, but cannot stream out tool_call deltas. But I think streaming is an important feature for application that need instant responses.

There is a comment in the code that "Because we don't know the name of the function until the end of the stream, we'll save everything and yield events at the end", but I don't understand it. Could you clarify the reason why we cannot just yield ResponseFunctionCallArgumentsDeltaEvent (openai.types.responses.response_function_call_arguments_delta_event) in ChatCompletions API?

@Lightblues Lightblues added the question Question about using the SDK label Mar 25, 2025
@rm-openai
Copy link
Collaborator

We get deltas that contain:

  • deltas of the function name
  • deltas of the function args

So e.g. if your function is called "get_weather", the first delta might have get_ and the second might have weather. So until we receive the last delta, we don't know the name of the function.

@rm-openai
Copy link
Collaborator

In practice this doesn't seem to be a real issue so maybe we should fix this

@rm-openai rm-openai added enhancement New feature or request and removed question Question about using the SDK labels Mar 25, 2025
@Lightblues
Copy link
Author

Thank you for your attention to this issue. I appreciate your insights and look forward to seeing progress on this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants