[docs]classJinaInput(BaseModel):"""Input for the Jina search tool."""query:str=Field(description="search query to look up")
[docs]classJinaSearch(BaseTool):# type: ignore[override]"""Tool that queries the JinaSearch. ..versionadded:: 0.2.16 """name:str="jina_search"description:str=("Jina Reader allows you to ground your LLM with the latest information from ""the web. ""Jina Reader will search the web and return the top five results with their ""URLs and contents, ""each in clean, LLM-friendly text. This way, you can always keep your LLM ""up-to-date, improve its factuality, and reduce hallucinations.")search_wrapper:JinaSearchAPIWrapper=Field(default_factory=JinaSearchAPIWrapper)# type: ignore[arg-type]def_run(self,query:str,run_manager:Optional[CallbackManagerForToolRun]=None,)->str:"""Use the tool."""returnself.search_wrapper.run(query)