tool-call: add support to llama-cli using new --tools arg #11556
+50
−15
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.
This PR adds support for tool-calls using a
--tools
switch to llama-cli.It is currently ⚠Experimental!⚠
This required slight modifications to
common_chat_apply_template
in order to support passing a JSON arraytools_json_arr
which defaults to an empty string. It seemed the minimally invasive approach.This doesn't work yet needs the brains added... Trying to figure out how this all works in the server code if anyone has tips please feel free to chime in!😅
Tasks:
--tool-choice
option which defaults to "auto" (see this ref)oaicompat_completion_params_parse
in utils.hpp intocommon_chat_apply_template
(common.cpp).main.cpp
algorithm?