Command Palette

Search for a command to run...

UnylyUnyly
Весь каталог

Newslens

БесплатноНе проверен

Utility to use News-Summarization model as a function, tool, MCP or A2A server

GitHubEmbed

Описание

Utility to use News-Summarization model as a function, tool, MCP or A2A server

README

NewsLens is a modular Python SDK designed for production-grade news summarization. It provides a unified interface for model inference, supporting local execution, remote API calls, and mock engines for development.

Installation

NewsLens supports optional dependencies based on your specific requirements.

For standard usage:

pip install newslens

To include specific capabilities, use the following extras:

# For local GPU inference
pip install "newslens[local]"

# For MCP server support
pip install "newslens[mcp]"

# For all features
pip install "newslens[all]"

Usage

The package utilizes a strategy pattern, allowing you to swap inference backends without modifying your application logic.

Programmatic API

You can initialize the NewsLens class by injecting a specific engine.

from newslens.core.model import NewsLens
from newslens.core.engines import RemoteEngine

# Configure the engine
engine = RemoteEngine(api_url="https://api.yourdomain.com")
lens = NewsLens(engine=engine)

# Summarize a single article
summary = lens.summarize("Your article text here.")

# Summarize multiple articles concurrently
summaries = await lens.asummarize_batch(["Article 1", "Article 2"])

FastAPI Server

The package includes a production-ready API server with lifespan management.

from fastapi import FastAPI
from newslens.server.api import app
# The server automatically manages the thread pool and model lifecycle

Agent Integration

NewsLens can be deployed as an MCP server to provide summarization capabilities to AI agents.

from newslens.agents.mcp import create_mcp_server
from newslens.core.model import NewsLens

lens = NewsLens(engine=my_engine)
mcp_server = create_mcp_server(lens)
mcp_server.run(transport="stdio")

Configuration

The SDK uses pydantic-settings. You can configure the BASE_MODEL, ADAPTER_PATH, and MAX_WORKERS via environment variables or a configuration object.

Testing

The package includes a comprehensive test suite. Ensure you have installed the dev dependencies:

pip install "newslens[all]"
pytest

License

This project is licensed under the MIT License

from github.com/Arnab-cloud/newslens

Установка Newslens

У этого сервера нет опубликованного пакета — он собирается из исходников. Открой репозиторий и следуй инструкции в README.

▸ github.com/Arnab-cloud/newslens

FAQ

Newslens MCP бесплатный?

Да, Newslens MCP бесплатный — установка в пару кликов через Unyly без оплаты.

Нужен ли API-ключ для Newslens?

Нет, Newslens работает без API-ключей и переменных окружения.

Newslens — hosted или self-hosted?

Self-hosted: сервер запускается локально на твоей машине командой из раздела установки.

Как установить Newslens в Claude Desktop, Claude Code или Cursor?

Открой Newslens на unyly.org, выбери вкладку своего клиента (Claude Desktop, Claude Code, Cursor) и нажми Install — конфиг сгенерируется автоматически, без правки JSON.

Похожие MCP

Compare Newslens with

Не уверен что выбрать?

Найди свой стек за 60 секунд

Автор?

Embed-бейдж для README

Похожее

Все в категории development