midterm-project-hf-space / tools /search_wikipedia.py
lakshyaag's picture
project: init
a8ab4cd
raw
history blame
315 Bytes
from langchain_community.tools import WikipediaQueryRun
from langchain_community.utilities import WikipediaAPIWrapper
api_wrapper = WikipediaAPIWrapper(top_k_results=5, doc_content_chars_max=5000)
wikipedia = WikipediaQueryRun(api_wrapper=api_wrapper)
# print(tool.invoke("What's a state in computer science?"))