From 62717145f715d9e4b3f4f26a24eee94b850c5642 Mon Sep 17 00:00:00 2001 From: Olivier Chafik Date: Tue, 28 Jan 2025 09:22:03 +0000 Subject: [PATCH] Allow tool use + streaming --- examples/server/utils.hpp | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/examples/server/utils.hpp b/examples/server/utils.hpp index b6e4e1def..e17c0c543 100644 --- a/examples/server/utils.hpp +++ b/examples/server/utils.hpp @@ -586,15 +586,8 @@ static json oaicompat_completion_params_parse( json llama_params; auto tools = json_value(body, "tools", json()); - auto stream = json_value(body, "stream", false); - - if (tools.is_array() && !tools.empty()) { - if (stream) { - throw std::runtime_error("Cannot use tools with stream"); - } - if (!use_jinja) { - throw std::runtime_error("tools param requires --jinja flag"); - } + if (tools.is_array() && !tools.empty() && !use_jinja) { + throw std::runtime_error("tools param requires --jinja flag"); } // Handle "stop" field