-
Notifications
You must be signed in to change notification settings - Fork 12.5k
server
: streaming of tool calls and thoughts when --jinja
is on
#12379
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
102 commits
Select commit
Hold shift + click to select a range
16c9c63
add common_regex w/ support for partial final matches
6dcff43
add common_json w/ support for truncated json healing
a95fe78
renaming: string_find_partial_stop (moved to common.cpp)
ce2f593
add common_chat_msg_diff
cd3681d
partial common_chat_parse
9462365
refactor parser w/ optionals
6ed8a8f
server: wire chat diffs in stream mode
eaeed7d
fix trigger of thinking models (must happen after thoughts are closed)
d6e680a
nits + docs
64ea080
fix functionary v3.2 raw python!
c46d4da
rename: common_chat_syntax (now contains format)
4358d5d
rm common_regex.at_start
f477288
Merge remote-tracking branch 'origin/master' into tool-diffs
e0202b3
fix gcc compilation
f840e3a
fix unreachable code warning after [[noreturn]] annotation
af7391e
fix / refactor test-regex-partial
449917b
fix test-chat
b428b5c
rm spaces
668fc90
fix command r7b partial parsing (lacked args path)
b48ab23
Update test_chat_completion.py
aefc8a4
refactor + test chat parser (try_consume_json_with_dumped_args, liter…
22428a4
return partial msg from server
5b9c5a4
refactor partial json
3fbe84f
don't return empty <think></think>
d4cb7fe
test_tool_call: allow comment lines in now-multiline code strings (fo…
31f5eb2
accommodate yet another deepseek r1 distill fantasy syntax (<|tool▁ca…
bddc65a
rm space
ea3bf03
nit: fix python type
f3bfbc6
refactor test-chat-parser
bb7b9fe
fix QwQ 32B tool call parsing after thoughts (hermes2)
f0ea330
fix thinking models + tool calls (</think> not part of trigger's capt…
7856949
reinstate tool call id logic, keep track of previously generated ids
2412b5d
better logs for triggers
02913b0
fix msg diff test
c5c3482
try_consume_regex: basic tests + fix non-partial case
af79da0
chat-parser: test+fix finish, incomplete methods
562800f
normalize args in test-chat
ddeb318
consume spaces after parse_json_tool_calls
6c3f87e
Revert "fix thinking models + tool calls (</think> not part of trigge…
e2cef66
fix required tool calls w/ thinking models that have pre-opened think…
7a61eca
fix thinking model's initial trigger (take 2) + test qwq's template
2f55571
refactor chat parser (rm incomplete)
303f640
test groups of common_chat_msg_parser.try_consume_regex
e9540ad
run most test_tool_call tests in stream + non-stream modes
a818114
make functionary v3.2 parsing more strict (differentiate first match …
5031366
send final diff from server, to close off raw python arguments
dae6a28
nit: spaces
f026cb0
fix diff aggregation logic in make_any_request
e7f9d3e
fix test_chat_completion_with_timings_per_token & test_logprobs_stream
165b525
add missing functional import for gcc compilation
9d4a6f1
fix typo in test_calc_result
64b4039
fix thoughts parsing logic
fbba5da
support partial content streaming in Generic mode
4dcd653
strip reasoning (now that tags are strings and not regexes)
56156b7
run test_thoughts in stream mode too
5dfa2f7
r1: avoid partial call triggers from spaces
91a5084
fix test_thoughts / refactor expectations
4f78d44
fix partial json crashes
ea57e47
fix test-chat's unparsed thought expectation
1d25178
Merge remote-tracking branch 'origin/master' into tool-diffs
42cb16f
fix partial json crash after comma
37b4a3a
fix test-chat.cpp
13d725d
fix gcc build of test
a40aead
Merge remote-tracking branch 'origin/master' into tool-diffs
329d943
Merge remote-tracking branch 'origin/master' into tool-diffs
e63e542
Merge remote-tracking branch 'origin/master' into tool-diffs
21cd34c
fix regex-partial (drop reluctant repetitions conversions)
5f0450d
partial regex: allow newlines in prefixes
36ecb01
tool-call: allow content prelude before hermes2 tool calls (for Qwen2.5)
68eeff1
Update function-calling.md
12deff6
nit: spaces
d0a686b
Update tool_bench.py
a604b2d
Merge remote-tracking branch 'origin/master' into tool-diffs
90789cd
Inject date_string in llama 3.x + test it & functionary v2
71435cf
Inject date_string in llama 3.x + fix for functionary v2
543b73e
add missing chrono include
e3c372c
move/fix detection of functionary v3.1 before llama 3.x, fix & test t…
387611a
Merge branch 'date' into tool-diffs
01a3e31
Merge remote-tracking branch 'origin/master' into tool-diffs
59b87c5
move string_find_partial_stop & string_ends_with to common
ff35374
add common_regex (supports partial matches)
869e1a9
Update test-regex-partial.cpp
6f109fa
Update common/common.cpp
ochafik 908e12f
Update common/regex-partial.cpp
ochafik 868b442
Update common/regex-partial.cpp
ochafik 2ea5f5c
Update common/regex-partial.h
ochafik b275da3
partial regex: add missing iterator end checks
9b620e5
string utils: use string_views
5c99bdc
direct throw to avoid ggml.h include
e051be6
regex-partial: replace missed ggml_asserts
afce553
Merge remote-tracking branch 'origin/master' into partial-regex
c879a57
Merge branch 'partial-regex' into tool-diffs
ad07a3b
Merge remote-tracking branch 'origin/master' into tool-diffs
573e8c3
fix merge
d6e1d5b
Merge remote-tracking branch 'origin/master' into tool-diffs
6946a83
Merge remote-tracking branch 'origin/master' into tool-diffs
224101b
chat-parser: remove input from exception (llm output may contain PII)
6ddda10
Merge remote-tracking branch 'origin/master' into tool-diffs
8886c24
disable failing tests from test_tool_call.py
810c4c3
json-partial: add comments
f0d5df2
Merge remote-tracking branch 'origin/master' into tool-diffs
40951c8
Merge remote-tracking branch 'origin/master' into tool-diffs
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
rename: common_chat_syntax (now contains format)
- Loading branch information
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
The transition from using a simple chat format enum to a full common_chat_syntax struct enhances flexibility but consider adding inline documentation or comments on the new fields (reasoning_format, reasoning_in_content, thinking_forced_open) to aid readability and backward compatibility.
Copilot uses AI. Check for mistakes.