forked from Archives/langchain
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
690 B
Python
23 lines
690 B
Python
"""Toolkit for the Wolfram Alpha API."""
|
|
|
|
from typing import List
|
|
|
|
from langchain.tools.base import BaseTool, BaseToolkit
|
|
from langchain.tools.wolfram_alpha.tool import WolframAlphaQueryRun
|
|
from langchain.utilities.wolfram_alpha import WolframAlphaAPIWrapper
|
|
|
|
|
|
class WolframAlphaToolkit(BaseToolkit):
|
|
"""Tool that adds the capability to interact with Wolfram Alpha."""
|
|
|
|
wolfram_alpha_appid: str
|
|
|
|
def get_tools(self) -> List[BaseTool]:
|
|
"""Get the tools in the toolkit."""
|
|
wrapper = WolframAlphaAPIWrapper(wolfram_alpha_appid=self.wolfram_alpha_appid)
|
|
return [
|
|
WolframAlphaQueryRun(
|
|
api_wrapper=wrapper,
|
|
)
|
|
]
|