chore: function calling cleanup #2195
Merged
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.
Describe Your Changes
llama-server
has already supported tool_callsThis pull request includes significant changes to the
docs
andengine
directories, focusing on updating the function calling format and removing unused utility functions. The most important changes include updating the function call instructions in the documentation, removing preprocessing and postprocessing function calls, and adding a new parameter in the local engine.Documentation updates:
docs/docs/guides/function-calling.md
: Updated the function call instructions to include a detailed format and guidelines for calling custom functions. [1] [2]Codebase simplification:
engine/controllers/server.cc
: Removed thePostProcessResponse
call from theProcessNonStreamRes
function.engine/services/inference_service.cc
: Removed thePreprocessRequest
call from theHandleChatCompletion
function.engine/test/components/test_function_calling.cc
: Removed the entire test file related to function calling utilities.engine/utils/function_calling/common.h
: Removed multiple utility functions related to function calling, includingCreateCustomFunctionsString
,IsValidToolChoiceFormat
,UpdateMessages
,PreprocessRequest
, andPostProcessResponse
.Enhancements:
engine/extensions/local-engine/local_engine.cc
: Added the--jinja
parameter to theLoadModel
function.Fixes Issues
Self Checklist