File size: 315 Bytes
a8ab4cd
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
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?"))