Skip to main content

NewsAgent - TGSC

Project description

News Agent

Join our Discord Subscribe on YouTube Connect on LinkedIn Follow on X.com

NewsAgent is an enterprise-grade news aggregation agent designed to fetch, query, and summarize news from multiple sources at scale. Built for modern businesses, NewsAgent enables you to automate the process of news monitoring, delivering summarized, relevant, and timely news from across the web. Whether you need real-time updates or comprehensive analysis, NewsAgent can seamlessly integrate into your workflows, ensuring that you always stay informed.

Key Features

  • Smart Query Crafting: Automatically creates optimized queries to fetch the most relevant news from multiple sources.
  • Multi-Article Summarization: Efficiently summarizes multiple articles at once, reducing the noise and delivering concise insights.
  • Real-Time Updates: Fetch news in real-time or set scheduled intervals for continuous monitoring.
  • Customizable Sources: Add or remove specific news sources, tailored to your business needs.
  • Enterprise Integration: Easily integrates into existing enterprise platforms for automated news monitoring and alert systems.

Installation

To install NewsAgent, use the following command:

pip3 install -U news-agent

Ensure that you have Python 3.7+ installed.

Quick Start

1. Import and Initialize

from news_agent import NewsAgent

# Initialize the agent with default or custom parameters
agent = NewsAgent(api_key="your_api_key")

2. Fetch and Summarize News

# Fetch and summarize articles on a specific topic
summary = agent.fetch_and_summarize("Artificial Intelligence", sources=["techcrunch", "reuters"])

print(summary)

3. Customize Query Parameters

You can customize query parameters such as date ranges, languages, and source priorities:

summary = agent.fetch_and_summarize(
    "Quantum Computing", 
    date_range="2023-01-01:2023-09-01", 
    language="en", 
    sources=["nytimes", "bbc"]
)

print(summary)

4. Real-Time News Monitoring

Set up continuous real-time monitoring for specific keywords and receive updates as new articles are published:

agent.start_monitoring(
    "Global Markets",
    interval=3600,  # Fetch updates every hour
    on_update_callback=lambda summary: print(f"New Summary: {summary}")
)

Configuration

You can customize the behavior of NewsAgent via several configuration options:

agent = NewsAgent(
    api_key="your_api_key", 
    timeout=10,  # Timeout for API requests in seconds
    max_articles=10  # Maximum number of articles to fetch per query
)

Available Parameters:

  • api_key: Your API key for accessing news data (required).
  • timeout: Set a timeout limit for API requests (default: 10 seconds).
  • max_articles: Limit the number of articles fetched and summarized (default: 10).
  • sources: List of news sources to prioritize during querying.
  • language: Specify the language of the news articles (e.g., en for English).
  • date_range: Specify the date range for fetching articles (format: YYYY-MM-DD:YYYY-MM-DD).

Advanced Usage

NewsAgent also supports advanced use cases such as bulk fetching and deep analysis of specific sectors:

Bulk Fetching

For large-scale news aggregation across multiple industries:

topics = ["Financial Markets", "Healthcare", "Technology"]
summaries = agent.bulk_fetch_and_summarize(topics, sources=["forbes", "reuters", "bloomberg"])

for topic, summary in summaries.items():
    print(f"Topic: {topic}\nSummary: {summary}\n")

Integration with Enterprise Systems

Easily integrate NewsAgent with your company's internal systems via the provided API endpoints or through webhook support for real-time notifications.

agent.start_monitoring(
    "Cybersecurity", 
    interval=1800,  # 30 minutes
    on_update_callback=your_enterprise_notification_system.notify
)

Security

NewsAgent follows strict security protocols:

  • API Key Encryption: All API keys are securely stored and transmitted using industry-standard encryption methods.
  • Data Privacy: NewsAgent does not store any news data or summaries beyond what is necessary for real-time operations.

Enterprise Support

For enterprise customers, we offer:

  • 24/7 Priority Support
  • Custom Feature Development
  • Integration Assistance for your existing platforms (CRM, ERP, etc.)

For more information on enterprise solutions, contact us at enterprise@newsagent.com.

Contributing

We welcome contributions! If you'd like to contribute to NewsAgent, please open an issue or submit a pull request via our GitHub repository.

License

NewsAgent is licensed under the MIT License. See the LICENSE file for more details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

news_swarm-0.0.3.tar.gz (8.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

news_swarm-0.0.3-py3-none-any.whl (9.4 kB view details)

Uploaded Python 3

File details

Details for the file news_swarm-0.0.3.tar.gz.

File metadata

  • Download URL: news_swarm-0.0.3.tar.gz
  • Upload date:
  • Size: 8.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.6 Darwin/23.3.0

File hashes

Hashes for news_swarm-0.0.3.tar.gz
Algorithm Hash digest
SHA256 7b1ad5e408ca3f7c748fd844fca50f4899e9d7974990ff9f3d063ae788df399a
MD5 dfcad6a2edd8b02efe538209e109ac94
BLAKE2b-256 5f96367c3981cf409b23456d1a7ebc090f72afc40ba016e1420e865b33a8014a

See more details on using hashes here.

File details

Details for the file news_swarm-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: news_swarm-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 9.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.6 Darwin/23.3.0

File hashes

Hashes for news_swarm-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 1bf8fa3c9c6f46fe1fc82619dae0d228e258cf3a6e034d933ebb4726a5f95895
MD5 42359f63e4d407254a6d59ec6e2f40cd
BLAKE2b-256 7bc677db864db05b538ed059509b5176c88bcdfd30181eca65aebc1ad54450f9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page