mirror of
https://github.com/LostRuins/koboldcpp.git
synced 2026-09-19 01:05:09 +02:00
Merge commit 'acecd56032ddc34bada14a2d978f110d9c987095' into concedo_experimental
# Conflicts: # .github/workflows/build-cpu.yml # common/CMakeLists.txt # common/chat-auto-parser-generator.cpp # docs/development/parsing.md # grammars/README.md # json_to_gbnf.py # tests/CMakeLists.txt # tests/test-chat-peg-parser.cpp # tests/test-chat.cpp # tests/test-grammar-integration.cpp # tests/test-json-schema-to-grammar.cpp # tools/cli/README.md # tools/completion/README.md # tools/server/README.md
This commit is contained in:
@@ -600,6 +600,16 @@ json common_chat_tools_to_json_oaicompat(const std::vector<common_chat_tool> & t
|
||||
return result;
|
||||
}
|
||||
|
||||
json common_chat_tool_parameters(const json & function) {
|
||||
if (function.contains("parameters")) {
|
||||
const auto & params = function.at("parameters");
|
||||
if (!params.is_null() && !(params.is_object() && params.empty())) {
|
||||
return params;
|
||||
}
|
||||
}
|
||||
return json{{"type", "object"}, {"properties", json::object()}};
|
||||
}
|
||||
|
||||
std::vector<common_chat_tool> common_chat_tools_parse_oaicompat(const json & tools) {
|
||||
std::vector<common_chat_tool> result;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user