open-perplexity / app.py
vedantdere's picture
added support for websearch agent
2d0cef4
raw
history blame contribute delete
466 Bytes
from smolagents import CodeAgent, WebSearchTool, InferenceClientModel, GradioUI
from smolagents import OpenAIServerModel
# Create the model instance using Gemini API
model = InferenceClientModel()
# Create the CodeAgent with WebSearchTool
agent = CodeAgent(
tools=[WebSearchTool()],
model=model,
stream_outputs=True
)
# Wrap the agent in the HuggingFace Chat UI
ui = GradioUI(agent=agent)
# Launch the UI
if __name__ == "__main__":
ui.launch()