[GH-ISSUE #5993] Tool calls streaming #65786

Closed
opened 2026-05-03 22:41:18 -05:00 by GiteaMirror · 3 comments
Owner

Originally created by @jacob-ebey on GitHub (Jul 26, 2024).
Original GitHub issue: https://github.com/ollama/ollama/issues/5993

What is the issue?

Looking through PR's and issues around tool calls + streaming, it seems we are overlooking that when a tool call is encountered, the body of the tool-call should be discriminated from the "chat response".

We need to be able to implement the following high level logic:

for await (const chunk of response) {
  if (chunk is tool response) {
    storeAndCallToolLater(chunk);
  } else {
    showChatResponseToUser(chunk);
  }

I may be overlooking something, so please let me know if I am.

Originally created by @jacob-ebey on GitHub (Jul 26, 2024). Original GitHub issue: https://github.com/ollama/ollama/issues/5993 ### What is the issue? Looking through PR's and issues around tool calls + streaming, it seems we are overlooking that when a tool call is encountered, the body of the tool-call should be discriminated from the "chat response". We need to be able to implement the following high level logic: ```js for await (const chunk of response) { if (chunk is tool response) { storeAndCallToolLater(chunk); } else { showChatResponseToUser(chunk); } ``` I may be overlooking something, so please let me know if I am.
GiteaMirror added the bug label 2026-05-03 22:41:18 -05:00
Author
Owner

@jacob-ebey commented on GitHub (Jul 27, 2024):

I've implemented this functionality in user-land if anyone needs it now: https://github.com/jacob-ebey/ollama-tools

<!-- gh-comment-id:2253783609 --> @jacob-ebey commented on GitHub (Jul 27, 2024): I've implemented this functionality in user-land if anyone needs it now: https://github.com/jacob-ebey/ollama-tools
Author
Owner

@RobinBially commented on GitHub (Jul 27, 2024):

There are already multiple pull requests:
https://github.com/ollama/ollama/pull/5995
and
https://github.com/ollama/ollama/pull/5915

<!-- gh-comment-id:2254071647 --> @RobinBially commented on GitHub (Jul 27, 2024): There are already multiple pull requests: https://github.com/ollama/ollama/pull/5995 and https://github.com/ollama/ollama/pull/5915
Author
Owner

@jmorganca commented on GitHub (Sep 4, 2024):

Merging with https://github.com/ollama/ollama/issues/5796

<!-- gh-comment-id:2327885043 --> @jmorganca commented on GitHub (Sep 4, 2024): Merging with https://github.com/ollama/ollama/issues/5796
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#65786