CoralLeiCN commited on
Commit
50ee91d
·
1 Parent(s): eab656d

Limit Wikipedia search tool output to 50,000 characters. So do not exceed token quota 250000.

Browse files
Files changed (1) hide show
  1. agent/tools.py +1 -1
agent/tools.py CHANGED
@@ -103,7 +103,7 @@ class WikipediaSearchTool(Tool):
103
  print(f"Page title: {docs}")
104
  page = wikipedia.page(docs[0])
105
  page_html = page.html()
106
- context = md(page_html)
107
  return context
108
  else:
109
  return "No results found for the query."
 
103
  print(f"Page title: {docs}")
104
  page = wikipedia.page(docs[0])
105
  page_html = page.html()
106
+ context = md(page_html)[:50000]
107
  return context
108
  else:
109
  return "No results found for the query."