-
Notifications
You must be signed in to change notification settings - Fork 162
chore: function calling cleanup #2195
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Conversation
7f6158f
to
43bf80f
Compare
Preview URL: https://848dd1bb.cortex-docs.pages.dev |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
// deal with out of range numeric values | ||
std::optional<int> numeric_value = GetNumericValue(selection); | ||
if (!numeric_value.has_value() ||(unsigned) numeric_value.value() > options.size() || numeric_value.value() < 1) { | ||
if (!numeric_value.has_value() || |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
break this down into individiual booleans and then compare them.
Like
const bool has_value = !numeric_value.has_value()
etc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
left some comments
…o s/chore/tool
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