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

Uploaded Source

Built Distribution

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

Uploaded Python 3

Supported by

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