Skip to content
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

tool-call: refactor common chat / tool-call api (+ tests / fixes) #11900

Merged
merged 43 commits into from
Feb 18, 2025
Merged
Show file tree
Hide file tree
Changes from 38 commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
36092aa
address clang-tidy lints
ochafik Feb 15, 2025
ef9b91a
tool-call: massive refactoring
ochafik Feb 15, 2025
2f683f0
rm minja dep from util & common
ochafik Feb 15, 2025
7a04ebc
move minja to common/minja
ochafik Feb 15, 2025
ece941b
Update utils.hpp
ochafik Feb 15, 2025
aa09a3c
add common_chat_tool
ochafik Feb 15, 2025
7ae7560
force utf8 encoding in get_chat_template
ochafik Feb 15, 2025
646528a
fix json tools parsing
ochafik Feb 16, 2025
db2b44e
add json tools / messages parsing helpers to common
ochafik Feb 16, 2025
c7c8907
fix common_chat_msgs_parse_oaicompat
ochafik Feb 16, 2025
5f17156
concat multipart content in legacy template path
ochafik Feb 16, 2025
ee9b9d6
add name & tool_call_id to common_chat_msg
ochafik Feb 16, 2025
07f0ad0
Update test-chat.cpp
ochafik Feb 16, 2025
1acda5f
test & fix json<->msg conversions
ochafik Feb 16, 2025
a58e1fc
fix typo
ochafik Feb 16, 2025
103c840
fix content part string concat in legacy template branch
ochafik Feb 16, 2025
c154c02
test tools json conversions
ochafik Feb 16, 2025
3d41f1b
test content parts in test-chat
ochafik Feb 16, 2025
59c8059
fix clang-tidy lints in [test-]chat.*
ochafik Feb 16, 2025
1847cae
fix deepseek r1 slow test (no longer <think> opening w/ new template)
ochafik Feb 16, 2025
8462a51
fix lints in test-chat-template.cpp
ochafik Feb 16, 2025
80c432b
tweak test_calc_result expectations
ochafik Feb 16, 2025
42b29e1
fix double bos/eos jinja avoidance hack (was preventing inner bos/eos…
ochafik Feb 16, 2025
ce4ccf0
add common_chat_templates_source + rehab server template logs
ochafik Feb 16, 2025
cb31f08
fix msg lints
ochafik Feb 16, 2025
76f5d27
tool-call: allow empty tools w/ auto + grammar
ochafik Feb 16, 2025
34e4e22
fix & test grammar & json_schema w/ & w/o --jinja
ochafik Feb 16, 2025
1c6168b
Update test-chat-template.cpp
ochafik Feb 16, 2025
ae6b870
test & fix array message.content
ochafik Feb 16, 2025
1421037
fix links to prepare merge
ochafik Feb 16, 2025
d95a17c
Merge remote-tracking branch 'origin/master' into chat-cleanups
ochafik Feb 16, 2025
5a5ed7b
fix merge
ochafik Feb 16, 2025
dd5ef85
rm trailing spaces
ochafik Feb 16, 2025
2f2f0fa
Add missing <optional> include to chat.cpp
ochafik Feb 16, 2025
a58b9e5
tiny fix: somehow llama_token being defined in an extern c makes it l…
ochafik Feb 16, 2025
f999ff5
alternative fix for gcc c vs. c++ weirdness
ochafik Feb 16, 2025
55a7614
add missing <regex> include to test-chat-template
ochafik Feb 16, 2025
9d62f62
Update chat.hpp
ochafik Feb 16, 2025
da0982a
have common_chat_templates_init return a unique_ptr
ochafik Feb 17, 2025
7ddb454
chat.{hpp -> h}
ochafik Feb 17, 2025
d2969b8
build common_chat_templates_ptr earlier
ochafik Feb 17, 2025
fd2b8e1
use deleter functor for common_chat_templates_ptr
ochafik Feb 17, 2025
9a85439
Merge remote-tracking branch 'origin/master' into chat-cleanups
ochafik Feb 18, 2025
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: 2 additions & 2 deletions common/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ add_library(${TARGET} STATIC
base64.hpp
chat.cpp
chat.hpp
chat-template.hpp
common.cpp
common.h
console.cpp
Expand All @@ -68,7 +67,8 @@ add_library(${TARGET} STATIC
llguidance.cpp
log.cpp
log.h
minja.hpp
minja/chat-template.hpp
minja/minja.hpp
ngram-cache.cpp
ngram-cache.h
sampling.cpp
Expand Down
1 change: 1 addition & 0 deletions common/arg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

#include "log.h"
#include "sampling.h"
#include "chat.hpp"

#include <algorithm>
#include <climits>
Expand Down
Loading
Loading