Skip to content

A News search agent using large language model and web search/scraping tool

Notifications You must be signed in to change notification settings

Srijan0519/News_search_agent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 

Repository files navigation

News_search_agent

Objective:

Create a news search agent using any large language model and a web search/scraping tool of your choice. The agent should be capable of providing the latest news, along with links to relevant articles, based on the user's search query.

Requirements:

  • Use any large language model of your choice.
  • Incorporate a web search/scraping tool for obtaining news articles.
  • Execute the code in a Jupyter notebook or any IDE of your preference.
  • Attach the code file along with screenshots demonstrating the outputs.

Environment Details:

  • IDE: VS Code, Python environment, terminal output
  • Libraries: Streamlit, Serp Api, GoogleSearch, Json (output format)
  • Deployment: Streamlit

Methodology:

  • Main code functions: get_news_results() takes a keyword and an optional max_pages parameter. It uses the Serp api library to perform a Google search for news related to the given keyword. The function fetches results and extracts relevant information like title, link, source, date, snippet, and thumbnail. The loop continues until either 10 pages are fetched (default value of max_pages) or until there are no more pages.
  • Deployment: The st.json(results) line displays the fetched news results in a JSON format on the web page. When the code is run on Streamlit, it provides a simple web interface where users can input a news keyword, click the "Search" button, and see the related news results displayed on the page.

Output


output1

output2

About

A News search agent using large language model and web search/scraping tool

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages