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()