Skip to content
This repository was archived by the owner on Jul 22, 2025. It is now read-only.

Conversation

@SamSaffron
Copy link
Member

@SamSaffron SamSaffron commented Nov 12, 2024

Implement streaming tool call implementation for Anthropic and Open AI.

When calling:

llm.generate(..., partial_tool_calls: true) do ...

Partials may contain ToolCall instances with partial: true, These tool calls are partially populated with json partially parsed.

So for example when performing a search you may get:

ToolCall(..., {search: "hello" })
ToolCall(..., {search: "hello world" })

The library used to parse json is:

https://github.com/dgraham/json-stream

We use a fork cause we need access to the internal buffer.

This prepares internals to perform partial tool calls, but does not implement it yet.

@SamSaffron SamSaffron changed the title Anthropic implementation of partial streaming FEATURE: partial tool call support for OpenAI and Anthropic Nov 13, 2024
@SamSaffron SamSaffron marked this pull request as ready for review November 13, 2024 05:56
@SamSaffron SamSaffron merged commit 823e8ef into main Nov 13, 2024
6 checks passed
@SamSaffron SamSaffron deleted the stream_tool_params branch November 13, 2024 19:58
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants