Skip to main content

A new package that helps users extract and organize key reasons from text inputs, specifically focusing on why certain actions or outcomes might be undesirable. For example, given a text input about t

Project description

undesirablereasons

PyPI version License: MIT Downloads LinkedIn

undesirablereasons is a lightweight Python package that helps you extract and organize key “undesirable” reasons from free‑form text. It leverages llmatch‑messages together with a language model (by default ChatLLM7) to return a clean, structured list of reasons – perfect for content creators, researchers, or anyone who wants to summarize the negative aspects of a topic.

Installation

pip install undesirablereasons

Quick Start

from undesirablereasons import undesirablereasons

user_input = """
Becoming famous sounds great, but it also means losing privacy,
being constantly judged, dealing with paparazzi, and facing intense
pressure to maintain a public image. Fame can attract false
friendships, tax complexities, and the loss of a normal childhood.
"""

reasons = undesirablereasons(user_input)
print(reasons)

Output (example)

[
    "Loss of privacy",
    "Constant judgment and pressure",
    "Paparazzi intrusion",
    "False friendships",
    "Tax complexities",
    "Loss of a normal childhood"
]

API Reference

undesirablereasons(user_input, api_key=None, llm=None) -> List[str]

Parameter Type Description
user_input str The raw text you want to analyse.
api_key Optional[str] API key for LLM7. If omitted, the function reads LLM7_API_KEY from the environment or falls back to the default (free tier).
llm Optional[BaseChatModel] Any LangChain BaseChatModel instance. If omitted, the package creates a ChatLLM7 instance automatically.
  • Returns a list of extracted reasons (strings).
  • Raises RuntimeError if the LLM call fails.

Using a Custom LLM

You can plug in any LangChain‑compatible chat model:

OpenAI

from langchain_openai import ChatOpenAI
from undesirablereasons import undesirablereasons

llm = ChatOpenAI(model="gpt-4o-mini")
reasons = undesirablereasons("...", llm=llm)

Anthropic

from langchain_anthropic import ChatAnthropic
from undesirablereasons import undesirablereasons

llm = ChatAnthropic(model="claude-3-haiku-20240307")
reasons = undesirablereasons("...", llm=llm)

Google Generative AI

from langchain_google_genai import ChatGoogleGenerativeAI
from undesirablereasons import undesirablereasons

llm = ChatGoogleGenerativeAI(model="gemini-1.5-flash")
reasons = undesirablereasons("...", llm=llm)

LLM7 Rate Limits

The free tier of LLM7 provides generous rate limits that are sufficient for most typical uses of this package. If you need higher limits, simply provide your own API key:

reasons = undesirablereasons("...", api_key="YOUR_LLM7_API_KEY")

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

Development

Feel free to open an issue for bugs, feature requests, or questions.

Contributing

Contributions are welcome! Fork the repository, make your changes, and submit a pull request. Please ensure that new code follows the existing style and includes appropriate tests.

License

This project is licensed under the MIT License.

Author

Eugene Evstafevhi@euegne.plus

GitHub: chigwell

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

undesirablereasons-2025.12.21151640.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.

undesirablereasons-2025.12.21151640-py3-none-any.whl (5.5 kB view details)

Uploaded Python 3

File details

Details for the file undesirablereasons-2025.12.21151640.tar.gz.

File metadata

File hashes

Hashes for undesirablereasons-2025.12.21151640.tar.gz
Algorithm Hash digest
SHA256 be2f0a4ab840d315a96af90e66d1d4a6e125244d97c5834fd7e843fe568fab0f
MD5 a0139fec3db5c011088ced45f937b5ec
BLAKE2b-256 fbb74cc152197a158424acd9fc4b0738b3765643b60742dd4fafd747d271fd73

See more details on using hashes here.

File details

Details for the file undesirablereasons-2025.12.21151640-py3-none-any.whl.

File metadata

File hashes

Hashes for undesirablereasons-2025.12.21151640-py3-none-any.whl
Algorithm Hash digest
SHA256 9174f0bc8943894055d1f5e0117a55b480aaf13f3fc80d7ce681efe47af6c324
MD5 5a613abefeb407b527ff5627b534b396
BLAKE2b-256 1a52bc886e25104bf66732f55d2af0f8c17edbde849ce3aa4ecc652083db6a54

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