[!WARNING]
Aligning ModelFusion to the new OpenAI tool calling and the JSON output guarantees of OpenAI, Ollama, and llama.cpp will lead to breaking changes.
OpenAI introduced parallel tool calling on dev day, and deprecated function calls. They also introduced enforcing JSON output, and Ollama and llama.cpp support this as well.
I will therefore:
introduce a generateToolCalls abstraction (and potentially generateToolCallsOrText)
update useTool to use generateToolCalls
change generateStructure to use forced JSON output instead and only require a schema
remove generateStructureOrText
Tasks
[x] implement generateToolCall for single tool call
[x] implement generateToolCalls for multiple tool calls (and different tools)
[x] switch the various useTool (and useToolsOrGenerateText) functions to be backed by generateToolCall (and generateToolCallsOrText)
[x] update Tool signature and tools
[x] add support for feeding back results in OpenAI chat
[x] remove generateStructureOrText
[x] change generateStructure to not be function-call specific
OpenAI introduced parallel tool calling on dev day, and deprecated function calls. They also introduced enforcing JSON output, and Ollama and llama.cpp support this as well.
I will therefore:
generateToolCalls
abstraction (and potentiallygenerateToolCallsOrText
)useTool
to usegenerateToolCalls
generateStructure
to use forced JSON output instead and only require a schemagenerateStructureOrText
Tasks
generateToolCall
for single tool callgenerateToolCalls
for multiple tool calls (and different tools)useTool
(anduseToolsOrGenerateText
) functions to be backed bygenerateToolCall
(andgenerateToolCallsOrText
)Tool
signature and toolsgenerateStructureOrText
generateStructure
to not be function-call specificuseTool
error handling