Websearch Tool
Websearch allows users to search the
What is Web search
The Web Search tool provides agents with access to real-time web information, where they can find current events, recent developments, and external references.
from seekrai import SeekrFlow
from seekrai.types import CreateAgentRequest, WebSearch, WebSearchEnv
client = SeekrFlow()
# Create an agent with WebSearch tool
agent = client.agents.create(
CreateAgentRequest(
name="WebSearchBot",
instructions="You are an expert assistant with access to real-time web information. Use the web_search tool for current events, recent developments, or information not in your training data.",
model_id="meta-llama/Llama-3.1-8B-Instruct",
tools=[WebSearch(
tool_env=WebSearchEnv(
web_search_tool_description="Search the web for current information, news, recent developments, and real-time data.",
)
)],
)
)
# Retrieve the agent to get its details
agent_info = client.agents.retrieve(agent_id=agent.id)
# Print the agent ID and status
print(f"Agent ID: {agent.id}")
print(f"Agent Status: {agent_info.status}")
How to use WebSearch parameter best practices
web_search_tool_description
: This field tells the agent when to use the tool.Good instructions clearly state when the tool should be used, what type of content it should retrieve, and what scenarios it should avoid.
✅ "Use this tool to search for real-time product pricing and availability on external e-commerce websites (e.g. Amazon, Best Buy, Walmart).
Only invoke this tool when the user explicitly asks for current prices, stock information, or product comparisons that are not already covered in internal documents.
Avoid using this tool for general product information, technical specifications, or reviews—use the file search tool or internal knowledge base instead if available."
🚫“Use this when the user asks a question that you think would benefit from websearch”
Updated 1 day ago