ForcePilot/src/agents/tools_factory.py

17 lines
431 B
Python
Raw Normal View History

2025-03-24 19:07:51 +08:00
from pydantic import BaseModel, Field
from langchain_core.tools import Tool, StructuredTool
from src.utils.web_search import WebSearcher
class SearchArgsSchema(BaseModel):
query: str = Field(..., description="The query to search the web for")
search_tool = Tool(
name="search",
description="Search the web for information",
func=WebSearcher().search,
args_schema=SearchArgsSchema,
return_direct=True,
)