discourse-ai/lib/completions/endpoints
Sam 823e8ef490
FEATURE: partial tool call support for OpenAI and Anthropic (#908)
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.
2024-11-14 06:58:24 +11:00
..
anthropic.rb FEATURE: partial tool call support for OpenAI and Anthropic (#908) 2024-11-14 06:58:24 +11:00
aws_bedrock.rb FEATURE: improve tool support (#904) 2024-11-12 08:14:30 +11:00
base.rb FEATURE: partial tool call support for OpenAI and Anthropic (#908) 2024-11-14 06:58:24 +11:00
canned_response.rb FEATURE: partial tool call support for OpenAI and Anthropic (#908) 2024-11-14 06:58:24 +11:00
cohere.rb FEATURE: improve tool support (#904) 2024-11-12 08:14:30 +11:00
fake.rb FEATURE: partial tool call support for OpenAI and Anthropic (#908) 2024-11-14 06:58:24 +11:00
gemini.rb FEATURE: improve tool support (#904) 2024-11-12 08:14:30 +11:00
hugging_face.rb FEATURE: improve tool support (#904) 2024-11-12 08:14:30 +11:00
ollama.rb FEATURE: improve tool support (#904) 2024-11-12 08:14:30 +11:00
open_ai.rb FEATURE: partial tool call support for OpenAI and Anthropic (#908) 2024-11-14 06:58:24 +11:00
samba_nova.rb FEATURE: improve tool support (#904) 2024-11-12 08:14:30 +11:00
vllm.rb FEATURE: improve tool support (#904) 2024-11-12 08:14:30 +11:00