From ca9069415c806be89f11bef47f6525bf4c3b9755 Mon Sep 17 00:00:00 2001
From: Maximilian Winter <maximilian.winter.91@gmail.com>
Date: Sun, 26 May 2024 15:46:01 +0200
Subject: [PATCH] Update tool.py

---
 src/llama_cpp_agent/tools/web_search/tool.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/llama_cpp_agent/tools/web_search/tool.py b/src/llama_cpp_agent/tools/web_search/tool.py
index d4328b9..cd59470 100644
--- a/src/llama_cpp_agent/tools/web_search/tool.py
+++ b/src/llama_cpp_agent/tools/web_search/tool.py
@@ -70,8 +70,8 @@ def search_web(self, search_query: str):
                 if self.max_tokens_search_results >= len(tokens):
                     break
                 else:
-                    remove_char_count += 25
-                    tokens = self.llm_provider.tokenize(res[:-remove_char_count])
+                    remove_char_count += 50
+                    tokens = self.llm_provider.tokenize(res[:remove_char_count])
         if not has_remove_char:
             return "\nResults of searching the web:\n\n" + res
         return "\nResults of searching the web:\n\n" + res[:remove_char_count]