Skip to content

Commit ec4aeaf

Browse files
author
ochafik
committed
Revert "Allow tool use + streaming"
This reverts commit 6271714.
1 parent 62d45a5 commit ec4aeaf

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

examples/server/utils.hpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -586,8 +586,15 @@ static json oaicompat_completion_params_parse(
586586
json llama_params;
587587

588588
auto tools = json_value(body, "tools", json());
589-
if (tools.is_array() && !tools.empty() && !use_jinja) {
590-
throw std::runtime_error("tools param requires --jinja flag");
589+
auto stream = json_value(body, "stream", false);
590+
591+
if (tools.is_array() && !tools.empty()) {
592+
if (stream) {
593+
throw std::runtime_error("Cannot use tools with stream");
594+
}
595+
if (!use_jinja) {
596+
throw std::runtime_error("tools param requires --jinja flag");
597+
}
591598
}
592599

593600
// Handle "stop" field

0 commit comments

Comments
 (0)