phidatahq / phidata

Build AI Agents with memory, knowledge, tools and reasoning. Chat with them using a beautiful Agent UI.
https://docs.phidata.com
Mozilla Public License 2.0
15.63k stars 2.15k forks source link

Feat: Add Serper Tool for Faster Search #1366

Open lucifertrj opened 1 month ago

lucifertrj commented 1 month ago
from phi.agent import Agent
from phi.model.openai import OpenAIChat
from phi.tools.googleserper import SerperTool

serper_tool = SerperTool()

web_agent = Agent(
    name="Cricket News",
    model=OpenAIChat(id="gpt-4o"),
    tools=[serper_tool],
    instructions=["Always include sources"],
    show_tool_calls=True,
    markdown=True,
)
web_agent.print_response("how much run did Virat scored in 2nd Test Match against NZ in Kanpur 2024", stream=True)

Screenshot 2024-10-29 at 19 06 55

lucifertrj commented 3 weeks ago

Great work @lucifertrj! The PR is perfect and is working correctly. Can you run ./scripts/format.sh and then remove unused imports. Also you aren't using headers param that you have passed in the class

sure will do that.

manthanguptaa commented 2 weeks ago

@lucifertrj the changes went for 461 files. Can you revert your commit? I will do the formatting on my end instead

ysolanky commented 4 days ago

@lucifertrj unfortunately we cannot merge this PR because of the 461 file changes. Please either revert your commit or create a new PR after pulling from main