]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commit
tool-call: refactor common chat / tool-call api (+ tests / fixes) (#11900)
authorOlivier Chafik <redacted>
Tue, 18 Feb 2025 18:03:23 +0000 (18:03 +0000)
committerGitHub <redacted>
Tue, 18 Feb 2025 18:03:23 +0000 (18:03 +0000)
commit63e489c025d61c7ca5ec06c5d10f36e2b76aaa1d
treea5f3b58254dd3229b6c2e40b5ce9515f3cb3fa42
parent63ac12856303108ee46635e6c9e751f81415ee64
tool-call: refactor common chat / tool-call api (+ tests / fixes) (#11900)

* tool-call refactoring: moved common_chat_* to chat.h, common_chat_templates_init return a unique_ptr to opaque type

* addressed clang-tidy lints in [test-]chat.*

* rm minja deps from util & common & move it to common/minja/

* add name & tool_call_id to common_chat_msg

* add common_chat_tool

* added json <-> tools, msgs conversions to chat.h

* fix double bos/eos jinja avoidance hack (was preventing inner bos/eos tokens)

* fix deepseek r1 slow test (no longer <think> opening w/ new template)

* allow empty tools w/ auto + grammar

* fix & test server grammar & json_schema params w/ & w/o --jinja
20 files changed:
Makefile
common/CMakeLists.txt
common/arg.cpp
common/chat-template.hpp [deleted file]
common/chat.cpp
common/chat.h [new file with mode: 0644]
common/chat.hpp [deleted file]
common/common.cpp
common/common.h
common/minja.hpp [deleted file]
common/minja/chat-template.hpp [new file with mode: 0644]
common/minja/minja.hpp [new file with mode: 0644]
examples/main/main.cpp
examples/run/run.cpp
examples/server/server.cpp
examples/server/tests/unit/test_chat_completion.py
examples/server/tests/unit/test_tool_call.py
examples/server/utils.hpp
tests/test-chat-template.cpp
tests/test-chat.cpp