From ae978ad541d2335ea341e6254095ddfa21fb1b54 Mon Sep 17 00:00:00 2001 From: hlohaus <983577+hlohaus@users.noreply.github.com> Date: Wed, 15 Jan 2025 22:45:52 +0100 Subject: Add missing webview requirements Fix web_search in Web UI --- g4f/gui/server/api.py | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'g4f/gui/server/api.py') diff --git a/g4f/gui/server/api.py b/g4f/gui/server/api.py index 2fdc5940..159be0b2 100644 --- a/g4f/gui/server/api.py +++ b/g4f/gui/server/api.py @@ -99,14 +99,9 @@ class Api: }, "type": "function" }] - do_web_search = json_data.get('web_search') - if do_web_search and provider: - kwargs["tool_calls"].append({ - "function": { - "name": "safe_search_tool" - }, - "type": "function" - }) + web_search = json_data.get('web_search') + if web_search: + kwargs["web_search"] = web_search action = json_data.get('action') if action == "continue": kwargs["tool_calls"].append({ -- cgit v1.2.3