Open
Conversation
d5f8c0c to
abb2ea1
Compare
Collaborator
|
Sorry for the long turnaround here -- the PythonicToolCallParser has a conflict with #152. Can you resolve that or let me know and I will resolve it. Thanks! |
Support multiple parallel tool calls and buffering for Llama 3
Llama 3 natively supports tool calling through an ipython environment which
generates arrays for multiple parallel tool invocations. Depending on the
model size and prompt, it generates either a JSON list of function objects
or a python-style array of function calls.
- Sets `startTag` to `<|python_tag|>` to ensure `ToolCallProcessor`
correctly buffers tool output without leaking it to the streaming UI.
- Upgrades `Llama3ToolCallParser` to parse multiple parallel tool calls
from JSON array payloads `[{"name": ...}]` during `parseEOS`.
- Upgrades `PythonicToolCallParser` to extract multiple sequential
pythonic function calls `[func1(), func2()]` via `parseEOS`.
- Refactors `PythonicToolCallParser` to use modern high-performance
Swift 5.7+ Regex literals instead of legacy NSRegularExpression.
- Add integration unit tests for both parsers to verify multi-call arrays.
Contributor
Author
it should be fixed now. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed changes
Support multiple parallel tool calls and buffering for Llama 3
Llama 3 natively supports tool calling through an ipython environment which
generates arrays for multiple parallel tool invocations. Depending on the
model size and prompt, it generates either a JSON list of function objects
or a python-style array of function calls.
startTagto<|python_tag|>to ensureToolCallProcessorcorrectly buffers tool output without leaking it to the streaming UI.
Llama3ToolCallParserto parse multiple parallel tool callsfrom JSON array payloads
[{"name": ...}]duringparseEOS.PythonicToolCallParserto extract multiple sequentialpythonic function calls
[func1(), func2()]viaparseEOS.PythonicToolCallParserto use modern high-performanceSwift 5.7+ Regex literals instead of legacy NSRegularExpression.
Checklist
Put an
xin the boxes that apply.pre-commit run --all-filesto format my code / installed pre-commit prior to committing changes