Skip to main content

A new package is designed to facilitate structured and reliable interactions with language models to generate concise summaries and extract key information from user-provided texts related to specific

Project description

eventlytics-summarizer

PyPI version License: MIT Downloads LinkedIn

eventlytics-summarizer is a tiny Python package that wraps a language‑model call with pattern‑matching and retry logic, making it easy to get concise, structured summaries and key‑point extractions from free‑form event descriptions.
It is especially suited for incident reports, news snippets, or any narrative that needs to be turned into a predictable, machine‑readable format.

Installation

pip install eventlytics_summarizer

Quick start

from eventlytics_summarizer import eventlytics_summarizer

text = """
Gloria Ramirez, a 31‑year‑old patient at the emergency department, suddenly began
seizing and emitting a strange, oily odor.  Shortly after, several staff members
lost consciousness.  The incident was later attributed to a toxic reaction to a
medication administered to Ms. Ramirez.
"""

summary = eventlytics_summarizer(user_input=text)
print(summary)
# -> ['...']   # a list of strings that match the defined output pattern

API

eventlytics_summarizer(
    user_input: str,
    llm: Optional[BaseChatModel] = None,
    api_key: Optional[str] = None
) -> List[str]
Parameter Type Description
user_input str The raw narrative you want to summarize / extract.
llm BaseChatModel (optional) Any LangChain‑compatible chat model. If omitted, the package creates a ChatLLM7 instance automatically.
api_key str (optional) API key for LLM7. If not supplied, the function looks for the LLM7_API_KEY environment variable, falling back to a placeholder "None" (which triggers the default free‑tier limits).

Default LLM (LLM7)

If you do not provide your own model, eventlytics_summarizer uses ChatLLM7 from the langchain_llm7 package:

from langchain_llm7 import ChatLLM7

The free tier of LLM7 provides enough calls for typical usage. To increase limits, supply your own API key:

summary = eventlytics_summarizer(user_input=text, api_key="YOUR_LLM7_API_KEY")

You can obtain a free key by registering at https://token.llm7.io/.

Using a custom LLM

You can plug any LangChain chat model that implements BaseChatModel. Below are a few common examples.

OpenAI (ChatGPT)

from langchain_openai import ChatOpenAI
from eventlytics_summarizer import eventlytics_summarizer

llm = ChatOpenAI(model="gpt-4o-mini")  # or any other OpenAI model
summary = eventlytics_summarizer(user_input=text, llm=llm)

Anthropic (Claude)

from langchain_anthropic import ChatAnthropic
from eventlytics_summarizer import eventlytics_summarizer

llm = ChatAnthropic(model="claude-3-haiku-20240307")
summary = eventlytics_summarizer(user_input=text, llm=llm)

Google Gemini

from langchain_google_genai import ChatGoogleGenerativeAI
from eventlytics_summarizer import eventlytics_summarizer

llm = ChatGoogleGenerativeAI(model="gemini-1.5-flash")
summary = eventlytics_summarizer(user_input=text, llm=llm)

How it works

  1. Prompt construction – a system prompt guides the model to produce concise, domain‑appropriate output, while a human prompt injects your user_input.
  2. Pattern matching – the expected output format is described by a regular expression (eventlytics_summarizer.prompts.pattern). The response is validated against this regex.
  3. Retry / error handlingllmatch automatically retries on mismatches and surfaces a clear RuntimeError if the model cannot satisfy the pattern.

Contributing

Contributions are welcome! Please open an issue or submit a pull request on GitHub.

License

This project is licensed under the MIT License.

Author

Eugene Evstafevhi@eugene.plus
GitHub: chigwell

Bugs & feature requests

If you encounter any problems or have ideas for improvement, please file an issue at:
https://github.com/chigwell/eventlytics-summarizer/issues

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

eventlytics_summarizer-2025.12.21101526.tar.gz (4.8 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 eventlytics_summarizer-2025.12.21101526.tar.gz.

File metadata

File hashes

Hashes for eventlytics_summarizer-2025.12.21101526.tar.gz
Algorithm Hash digest
SHA256 170368a6d9ececb7d7f27c61f13f7bdb58464b32edda47d08cc9c3fc80bd728d
MD5 ecf58ba8bf566d20caea9c6f243ec210
BLAKE2b-256 ff80388966100f29abfa630ad2bdeef1494cc0fcae352d5826769b9af27c38b4

See more details on using hashes here.

File details

Details for the file eventlytics_summarizer-2025.12.21101526-py3-none-any.whl.

File metadata

File hashes

Hashes for eventlytics_summarizer-2025.12.21101526-py3-none-any.whl
Algorithm Hash digest
SHA256 ccd13de56814c3ee0d4255ff09cbc47c13b800fcd1b3eb35eed2cb0549f70828
MD5 d1846c31435f3f00673f964c7b944dc0
BLAKE2b-256 19f875cad98ead03ab0d40a2bf85384fdf96335eac7fd17dca6aa066d167562a

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