discourse-ai/lib/completions
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
..
dialects FEATURE: improve tool support (#904) 2024-11-12 08:14:30 +11:00
endpoints FEATURE: partial tool call support for OpenAI and Anthropic (#908) 2024-11-14 06:58:24 +11:00
anthropic_message_processor.rb FEATURE: partial tool call support for OpenAI and Anthropic (#908) 2024-11-14 06:58:24 +11:00
json_stream_decoder.rb FEATURE: improve tool support (#904) 2024-11-12 08:14:30 +11:00
json_streaming_parser.rb FEATURE: partial tool call support for OpenAI and Anthropic (#908) 2024-11-14 06:58:24 +11:00
llm.rb FEATURE: partial tool call support for OpenAI and Anthropic (#908) 2024-11-14 06:58:24 +11:00
open_ai_message_processor.rb FEATURE: partial tool call support for OpenAI and Anthropic (#908) 2024-11-14 06:58:24 +11:00
prompt.rb FEATURE: allows forced LLM tool use (#818) 2024-10-05 09:46:57 +10:00
prompt_messages_builder.rb FEATURE: Add support for contextualizing a DM to a bot (#627) 2024-05-21 17:17:02 +10:00
tool_call.rb FEATURE: partial tool call support for OpenAI and Anthropic (#908) 2024-11-14 06:58:24 +11:00
tool_call_progress_tracker.rb FEATURE: partial tool call support for OpenAI and Anthropic (#908) 2024-11-14 06:58:24 +11:00
upload_encoder.rb FEATURE: Add vision support to AI personas (Claude 3) (#546) 2024-03-27 14:30:11 +11:00
xml_tag_stripper.rb FIX: display search correctly, bug when stripping XML (#668) 2024-06-14 15:28:40 +10:00
xml_tool_processor.rb FEATURE: improve tool support (#904) 2024-11-12 08:14:30 +11:00