Skip to content

Commit

Permalink
Update tool.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Maximilian-Winter committed May 26, 2024
1 parent e26f7fd commit ca90694
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/llama_cpp_agent/tools/web_search/tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit ca90694

Please sign in to comment.