tp-llmatch-formatter
A Textpattern CMS content management package designed to streamline content formatting tasks using LLM7.
Overview
This package allows users to input text-based content or instructions related to their Textpattern CMS, such as article drafts, formatting queries, or template adjustments. The package processes this input using llmatch-messages to ensure the output adheres to specific structured formats required by Textpattern, such as article tags, template syntax, or formatting rules. This ensures that the content or instructions are correctly formatted and ready for integration into the CMS, reducing manual errors and improving efficiency in content management workflows.
Installation
pip install tp_llmatch_formatter
Usage
Basic Usage
from tp_llmatch_formatter import tp_llmatch_formatter
response = tp_llmatch_formatter(user_input="Your text input here")
Using a Custom LLM
You can use any LLM compatible with LangChain. Here are examples using different LLMs:
Using OpenAI
from langchain_openai import ChatOpenAI
from tp_llmatch_formatter import tp_llmatch_formatter
llm = ChatOpenAI()
response = tp_llmatch_formatter(user_input="Your text input here", llm=llm)
Using Anthropic
from langchain_anthropic import ChatAnthropic
from tp_llmatch_formatter import tp_llmatch_formatter
llm = ChatAnthropic()
response = tp_llmatch_formatter(user_input="Your text input here", llm=llm)
Using Google
from langchain_google_genai import ChatGoogleGenerativeAI
from tp_llmatch_formatter import tp_llmatch_formatter
llm = ChatGoogleGenerativeAI()
response = tp_llmatch_formatter(user_input="Your text input here", llm=llm)
Using LLM7 API Key
By default, the package uses the LLM7 API. You can pass your API key directly or via an environment variable.
Using Environment Variable
import os
from tp_llmatch_formatter import tp_llmatch_formatter
os.environ["LLM7_API_KEY"] = "your_api_key"
response = tp_llmatch_formatter(user_input="Your text input here")
Passing API Key Directly
from tp_llmatch_formatter import tp_llmatch_formatter
response = tp_llmatch_formatter(user_input="Your text input here", api_key="your_api_key")
Parameters
user_input(str): The user input text to process.llm(Optional[BaseChatModel]): The LangChain LLM instance to use. If not provided, the default ChatLLM7 will be used.api_key(Optional[str]): The API key for LLM7. If not provided, the package will use the environment variableLLM7_API_KEYor a default value.
Default LLM
The package uses ChatLLM7 from langchain_llm7 by default. You can safely pass your own LLM instance if you want to use another LLM.
Rate Limits
The default rate limits for LLM7 free tier are sufficient for most use cases of this package. If you want higher rate limits for LLM7, you can pass your own API key via the environment variable LLM7_API_KEY or directly via the api_key parameter. You can get a free API key by registering at LLM7.
Issues
If you encounter any issues, please report them on the GitHub issues page.
Author
- Eugene Evstafev
- Email: hi@eugene.plus
- GitHub: chigwell
Metadata
Release files for tp-llmatch-formatter 2025.12.21170024
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| tp_llmatch_formatter-2025.12.21170024.tar.gz | 5.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| tp_llmatch_formatter-2025.12.21170024-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 11.4 kB
Release files / tp_llmatch_formatter-2025.12.21170024.tar.gz
| Download URL | tp_llmatch_formatter-2025.12.21170024.tar.gz |
|---|---|
| Size | 5.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3ac181ed3bc9531c7f681cddd8858fbee31566bbf079f4cb20e5c8bfda6edbb6
|
|
BLAKE2b-256 checksum How to use checksums |
c8de2111fa9d04b9647dfc152dc36fbe1e1b9857c3b0195eb65a7f32999de5ff
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.1
|
Release files / tp_llmatch_formatter-2025.12.21170024-py3-none-any.whl
| Download URL | tp_llmatch_formatter-2025.12.21170024-py3-none-any.whl |
|---|---|
| Size | 6.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f5d7d00b5a50e0df8565e2a8433597a7b61cf95e40e0765c40faaa0d363b9e42
|
|
BLAKE2b-256 checksum How to use checksums |
8479b4f7da6ca7208211298c9939f371683297e36dc732e05cfe5a55c4054374
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.1
|