A new package would process user-provided text inputs, such as headlines or short descriptions, and generate structured summaries or categorizations using an LLM. It would be particularly useful for c
Project description
textcurator-llm-py
A Python package for processing user-provided texts, such as headlines or short descriptions, and generating structured summaries or categorizations using language models. Designed to facilitate content curation, news aggregation, and event highlighting by producing consistent, formatted outputs with key information extracted automatically.
Features
- Accepts various text inputs and outputs structured summaries.
- Uses the
ChatLLM7model from thelangchain_llm7package by default. - Supports custom language model instances for increased flexibility.
- Implements regex-based pattern matching to extract data reliably.
- Suitable for applications like newsletters, databases, and alert systems.
Installation
Install the package via pip:
pip install textcurator_llm_py
Usage
Import the main function and invoke it with your input text. You can specify your preferred LLM instance or rely on the default ChatLLM7. If not provided, the package will use the API key from the environment variable LLM7_API_KEY.
from textcurator_llm_py import textcurator_llm_py
results = textcurator_llm_py(
user_input="City's Best Winter Show Is in Its Pitch-Dark Skies",
api_key="your_api_key_here" # optional, if not set in environment
)
print(results)
Using a custom language model
You can pass your own LLM instance, such as ChatOpenAI, ChatAnthropic, or others, to tailor the processing:
from langchain_openai import ChatOpenAI
from textcurator_llm_py import textcurator_llm_py
llm = ChatOpenAI()
results = textcurator_llm_py(
user_input="Example headline about an upcoming event.",
llm=llm
)
print(results)
Similarly, support exists for other LLMs:
from langchain_anthropic import ChatAnthropic
llm = ChatAnthropic()
results = textcurator_llm_py(
user_input="News about recent developments.",
llm=llm
)
print(results)
from langchain_google_genai import ChatGoogleGenerativeAI
llm = ChatGoogleGenerativeAI()
results = textcurator_llm_py(
user_input="Short description of an event.",
llm=llm
)
print(results)
Configuration
The function optionally accepts an api_key parameter for the ChatLLM7 model. If not provided, it defaults to the environment variable LLM7_API_KEY. For higher rate limits, obtain an API key at https://token.llm7.io/ and set it accordingly.
Limitations
- The package relies on regex patterns defined within the source code (
pattern). Ensure these patterns are suitable for your input data. - The default
ChatLLM7model is suitable for most use cases; however, users can provide custom LLMs for broader compatibility.
Issues and Support
For issues, please visit the GitHub repository: https://github.com/chigwell/textcurator-llm-py
Author
Eugene Evstafev
Email: hi@euegne.plus
GitHub: chigwell
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file textcurator_llm_py-2025.12.21161315.tar.gz.
File metadata
- Download URL: textcurator_llm_py-2025.12.21161315.tar.gz
- Upload date:
- Size: 5.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
56701786eed1106db6f69d98fc1f2456e38d2e5e1bb4f55d514c9b6f01d57563
|
|
| MD5 |
e1656f8522f5e4e19404b2d98efb5572
|
|
| BLAKE2b-256 |
e28ee2901aaa52b5b0aea62bcbca25d888456a118cd33fea3373798bb97a374b
|
File details
Details for the file textcurator_llm_py-2025.12.21161315-py3-none-any.whl.
File metadata
- Download URL: textcurator_llm_py-2025.12.21161315-py3-none-any.whl
- Upload date:
- Size: 6.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2ed1b212d6b1a1c00d204c59748dcb49b97b61385d64cf11de22a0197d7e1036
|
|
| MD5 |
d65760f7816e0f6262eb4d9406e5973c
|
|
| BLAKE2b-256 |
b88879fcc64743e87f7c7595c7a69098278e21f296acc8c704649a6a022a5ba9
|