A new package that analyzes user input text to determine if it expresses a challenge or a statement of inability, and returns a structured, encouraging response. It uses pattern matching to identify p
Project description
Challeneturn
===============
A package that generates encouraging and strategic responses to user input, identifying challenges and offering tips, reframing, or positive reinforcement.
Installation
pip install challengeturn
Usage
from challengeturn import challengeturn
response = challengeturn(user_input="I can't do this")
Documentation
Parameters
user_input: the user's input text (str)llm: an instance ofBaseChatModel(langchain.core.language_models.BaseChatModel), defaulting toChatLLM7from langchain_llm7.api_key: the API key for LLM7, defaulting to theLLM7_API_KEYenvironment variable or "None" if not provided.
Passing your own LLM
You can safely pass your own LLM instance if desired. For example, to use the OpenAI LLM:
from langchain_openai import ChatOpenAI
from challengeturn import challengeturn
llm = ChatOpenAI()
response = challengeturn(user_input, llm=llm)
Or the Anthropic LLM:
from langchain_anthropic import ChatAnthropic
from challengeturn import challengeturn
llm = ChatAnthropic()
response = challengeturn(user_input, llm=llm)
Or the Google Generative AI LLM:
from langchain_google_genai import ChatGoogleGenerativeAI
from challengeturn import challengeturn
llm = ChatGoogleGenerativeAI()
response = challengeturn(user_input, llm=llm)
LLM7 API Key
The default rate limits for LLM7 free tier are sufficient for most use cases of this package. If you require higher rate limits, you can pass your own api_key via environment variable LLM7_API_KEY or via the challengeturn function:
response = challengeturn(user_input, api_key="your_api_key")
You can get a free API key by registering at https://token.llm7.io/.
GitHub
https://github.com/chigwell/challengeturn
Author
Eugene Evstafev hi@eugev.plus
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 challengeturn-2025.12.21183136.tar.gz.
File metadata
- Download URL: challengeturn-2025.12.21183136.tar.gz
- Upload date:
- Size: 4.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
496413cfc77b3701c9c97ccb10d13f581f4a4582c9f627f6c94cc80a8ae9daf4
|
|
| MD5 |
36543c10003f247f9ac31091fe20a028
|
|
| BLAKE2b-256 |
53ad1cf2b295af873aac117948e9acbd3021e5b4cd57f2d0c91596101f608201
|
File details
Details for the file challengeturn-2025.12.21183136-py3-none-any.whl.
File metadata
- Download URL: challengeturn-2025.12.21183136-py3-none-any.whl
- Upload date:
- Size: 5.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 |
f0c46b5d5cbc06b847b807fcdd81a06792c98126d7442c384061d299fe1d1939
|
|
| MD5 |
68518ecc073de686889fc2cca3235b5d
|
|
| BLAKE2b-256 |
b21d895bfeff80608d3ba5f8b23a95fecff251e844f2d76d069355f6bb0efa51
|