Step by Step Guide Guide to Create AI Research Assist on Hunging Faces

Promoting Smolagents's Smolagents Framework provides a cold and effective way to build agents AIs weeping web tools and the execution of the code. In this lesson, we show how we can build a powerful AI research assistant who can search for the web as well as summarizes smolagents. This implementation works outside the seams, requires a minimum setup, and shows the power of AI agents to change real land services such as research, summarizing, and retirement of information.
!pip install smolagents beautifulsoup4
First, we include ai Smologents, which enables AGents to use tools such as Web Search and Code Search, and BeaceToup4, Python Library to enter textbooks from Web pages.
import os
from getpass import getpass
# Securely input and store the Hugging Face API token
os.environ["HUGGINGFACEHUB_API_TOKEN"] = getpass("Enter your Hugging Face API token: ")
Now, we are safely installing and storing the huging face token API as a natural flexibility. Using GetPass () To motivate users to enter their symbol without showing security. Token is stored in OS.environ[“HUGGINGFACEHUB_API_TOKEN”]Allowing the guaranteed API senses of the creating face of AI.
from smolagents import CodeAgent, DuckDuckGoSearchTool, HfApiModel
# Initialize the model WITHOUT passing hf_token directly
model = HfApiModel()
# Define tools (DuckDuckGo for web search)
tools = [DuckDuckGoSearchTool()]
# Create the agent
agent = CodeAgent(tools=tools, model=model, additional_authorized_imports=["requests", "bs4"])
Now, we start a powerful agent using the frame of smolagents. It puts HFAPMOMOMODEL () loading the language model based on the API faces, automatically detecting the API Token of authentication API. The agent is added to Duckduckgosearchtool () to make a web search. Also, the Codegent () is established for access to accredited tools, such as applications for applications and BS4 HTML content.
# Example query to the agent:
query = "Summarize the main points of the Wikipedia article on Hugging Face (the company)."
# Run the agent with the query
result = agent.run(query)
print("nAgent's final answer:n", result)
Finally, we send a question to AI agent, asking you to summarize the main points of Wikipedia Article in the kiss. Agent.run (Question) Comnds Create a Web Search Agency, Get active content, and produce a summary using the language model. Finally, the printing () work shows the final order of agent, directly summarizing the requested title.
Following this lesson, we have successfully develop AI-Powered Research Assearch Research Assessment This implementation highlights AI agents power in changing research activities, making it easier to recover and apply a large number of information properly. Without web and summaries, smolagents can be expanded in various real estate programs, including Automated Besting Services, Personal Services Managers, and AI discussions conducted by AI.
Here is the Colab Notebook of the above project. Also, don't forget to follow Sane and join ours Telegraph station including LinkedIn Grtopic. Don't forget to join ours 80k + ml subreddit.
🚨 Recommended Recommended Research for Nexus
Asphazzaq is a Markteach Media Inc. According to a View Business and Developer, Asifi is committed to integrating a good social intelligence. His latest attempt is launched by the launch of the chemistrylife plan for an intelligence, MarktechPost, a devastating intimate practice of a machine learning and deep learning issues that are clearly and easily understood. The platform is adhering to more than two million moon visits, indicating its popularity between the audience.
🚨 Recommended Open-Source Ai Platform: 'Interstagent open source system with multiple sources to test the difficult AI' system (promoted)



