Source code for langchain_community.tools.nasa.tool
"""This tool allows agents to interact with the NASA API, specificallythe the NASA Image & Video Library and Exoplanet"""fromtypingimportOptionalfromlangchain_core.callbacksimportCallbackManagerForToolRunfromlangchain_core.toolsimportBaseToolfrompydanticimportFieldfromlangchain_community.utilities.nasaimportNasaAPIWrapper
[docs]classNasaAction(BaseTool):# type: ignore[override]"""Tool that queries the Atlassian Jira API."""api_wrapper:NasaAPIWrapper=Field(default_factory=NasaAPIWrapper)mode:strname:str=""description:str=""def_run(self,instructions:str,run_manager:Optional[CallbackManagerForToolRun]=None,)->str:"""Use the NASA API to run an operation."""returnself.api_wrapper.run(self.mode,instructions)