Skip to main content

A new package that processes user input to generate structured summaries of decentralized protocol concepts, such as Polyproto, by extracting key features and benefits. It uses pattern matching to ens

Project description

decentralized-summarizer

PyPI version License: MIT Downloads LinkedIn

decentralized-summarizer is a Python package that turns user input about decentralized protocols (e.g., Polyproto) into clear, structured summaries. It extracts key features and benefits while avoiding technical jargon, making the output accessible to non‑expert audiences. The package leverages pattern matching to guarantee that the generated summaries follow a predefined format.

Features

  • Simple API – One function call to generate a summary.
  • LLM‑agnostic – Uses ChatLLM7 by default; you can plug any LangChain‑compatible LLM.
  • Formatted output – Enforces a regex pattern, ensuring consistent structure.
  • No jargon – Tailored prompts keep language clear and approachable.

Installation

pip install decentralized_summarizer

Quick Start

from decentralized_summarizer import decentralized_summarizer

# Simple usage with the default ChatLLM7
summary = decentralized_summarizer(
    user_input="Explain the main advantages of Polyproto in a decentralized network."
)

print(summary)  # => List of formatted summary strings

Function Signature

def decentralized_summarizer(
    user_input: str,
    api_key: Optional[str] = None,
    llm: Optional[BaseChatModel] = None,
) -> List[str]:
Parameter Type Description
user_input str The raw text you want to summarise.
api_key Optional[str] API key for ChatLLM7. If omitted, the function reads LLM7_API_KEY from the environment or uses a placeholder "None" (which works for the free tier).
llm Optional[BaseChatModel] A LangChain LLM instance. If not provided, ChatLLM7 from langchain_llm7 is used.

Using a Custom LLM

You can pass any LangChain‑compatible chat model (OpenAI, Anthropic, Google, etc.):

OpenAI

from langchain_openai import ChatOpenAI
from decentralized_summarizer import decentralized_summarizer

my_llm = ChatOpenAI(model="gpt-4o-mini")
summary = decentralized_summarizer(
    user_input="What are the security benefits of a decentralized exchange?",
    llm=my_llm,
)

Anthropic

from langchain_anthropic import ChatAnthropic
from decentralized_summarizer import decentralized_summarizer

my_llm = ChatAnthropic(model="claude-3-opus-20240229")
summary = decentralized_summarizer(
    user_input="Describe how decentralised governance works.",
    llm=my_llm,
)

Google Gemini

from langchain_google_genai import ChatGoogleGenerativeAI
from decentralized_summarizer import decentralized_summarizer

my_llm = ChatGoogleGenerativeAI(model="gemini-1.5-flash")
summary = decentralized_summarizer(
    user_input="Summarise the key points of the Polkadot parachain model.",
    llm=my_llm,
)

API Key & Rate Limits

  • The package defaults to ChatLLM7 from the langchain_llm7 package.
  • The free tier of ChatLLM7 provides sufficient rate limits for typical usage.
  • For higher limits, supply your own API key:
    • Environment variable: export LLM7_API_KEY="your_key"
    • Direct argument: api_key="your_key"

Obtain a free API key by registering at: https://token.llm7.io/

Contributing & Support

Author

Eugene Evstafev
Email: hi@eugene.plus
GitHub: chigwell


The package uses ChatLLM7 from langchain_llm7 by default. Feel free to replace it with any other LangChain chat model that matches the BaseChatModel interface.

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

decentralized_summarizer-2025.12.21120929.tar.gz (4.7 kB view details)

Uploaded Source

Built Distribution

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

File details

Details for the file decentralized_summarizer-2025.12.21120929.tar.gz.

File metadata

File hashes

Hashes for decentralized_summarizer-2025.12.21120929.tar.gz
Algorithm Hash digest
SHA256 0b2fbbc62a9a95747319f83296d927aa0f373e53beb26423c298814ea0901216
MD5 6ede7e8e720a8cfc1b47a504247b4fef
BLAKE2b-256 a28b2579d0f38f1ad58c0e18cd2f6a06af9debfbd2f7fa7c7d29d1f5c64a27e5

See more details on using hashes here.

File details

Details for the file decentralized_summarizer-2025.12.21120929-py3-none-any.whl.

File metadata

File hashes

Hashes for decentralized_summarizer-2025.12.21120929-py3-none-any.whl
Algorithm Hash digest
SHA256 88f53b1807d39e25b16d40e9a76971071ce9c563f73f82c52e0f6fec4b64055d
MD5 1a9afb78cfe36356eb919a52dc884fc2
BLAKE2b-256 3488d76893636d219c61df00f24f56a246dac36de62cda1dbfed2ee5762e3081

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