2024-03-25 15:31:49 +08:00

12 lines
331 B
Python

# LangChain 的 ArxivQueryRun 工具
from chatchat_server.pydantic_types import BaseModel, Field
from langchain.tools.arxiv.tool import ArxivQueryRun
def arxiv(query: str):
tool = ArxivQueryRun()
return tool.run(tool_input=query)
class ArxivInput(BaseModel):
query: str = Field(description="The search query title")