|
|
|
|
|
"""SmartAgent-WebSearch |
|
|
|
|
|
Automatically generated by Colab. |
|
|
|
|
|
Original file is located at |
|
|
https://colab.research.google.com/drive/1qPdXOAY8LSL2X2phmWvpvrdmuDQGsHpe |
|
|
""" |
|
|
|
|
|
!pip install -U smolagents[toolkit] |
|
|
|
|
|
!pip install smolagents |
|
|
|
|
|
!pip install --upgrade smolagents |
|
|
|
|
|
from smolagents import CodeAgent, DuckDuckGoSearchTool, InferenceClientModel |
|
|
|
|
|
|
|
|
model = InferenceClientModel() |
|
|
|
|
|
|
|
|
search_tool = DuckDuckGoSearchTool() |
|
|
|
|
|
|
|
|
agent = CodeAgent(tools=[search_tool], model=model) |
|
|
|
|
|
|
|
|
response = agent.run("Qual a altura do Cristo Redentor?") |
|
|
print(response) |
|
|
|
|
|
from smolagents import CodeAgent, DuckDuckGoSearchTool, InferenceClientModel |
|
|
|
|
|
|
|
|
model = InferenceClientModel() |
|
|
|
|
|
|
|
|
search_tool = DuckDuckGoSearchTool() |
|
|
|
|
|
|
|
|
agent = CodeAgent(tools=[search_tool], model=model) |
|
|
|
|
|
|
|
|
response = agent.run("Quem foi Ada Lovelace?") |
|
|
print(response) |