Skip to content
This repository was archived by the owner on Jul 4, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions engine/utils/function_calling/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,10 @@ inline void UpdateMessages(std::string& system_prompt,
tool_choice["function"]["name"].asString() +
"' to answer the user's question.";
}
bool parallel_tool_calls = request->get("parallel_tool_calls", true).asBool();
if (!parallel_tool_calls) {
system_prompt += "\n\nNow this is your first priority: You must call the only one function at a time.";
}

bool tools_call_in_user_message =
request->get("tools_call_in_user_message", false).asBool();
Expand Down
7 changes: 4 additions & 3 deletions engine/utils/function_calling/llama3.1.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,15 @@ Here is an example,
Reminder:
- Function calls MUST follow the specified format
- Required parameters MUST be specified
- Only call one function at a time
- You can call one or more functions at a time
- Put the entire function call reply on one line
- Always add your sources when using search results to answer the user query
- If can not find correct parameters corresponding to function, ask user again to provide.
- If you can not find correct parameters or arguments corresponding to function in the user's message, ask user again to provide, do not make assumptions.
- No explanation are needed when calling a function.

You are a helpful assistant.
)";

constexpr auto tool_role = "<|eot_id|>\n<|start_header_id|>ipython<|end_header_id|>\n";
constexpr auto tool_role =
"<|eot_id|>\n<|start_header_id|>ipython<|end_header_id|>\n";
} // namespace function_calling_llama3_1_utils
Loading