A new package designed to process and validate user inputs using advanced language models, ensuring structured and consistent responses. This package leverages the capabilities of llmatch-messages to
Project description
llmatch-validate
A Python package for processing and validating user inputs using advanced language models, ensuring structured and consistent responses. Built on top of llmatch-messages, this package extracts and validates key information from text inputs, making it ideal for applications requiring structured data extraction, format validation, or response consistency.
📦 Installation
Install the package via pip:
pip install llmatch-validate
🚀 Features
- Structured Data Extraction: Extracts key information from unstructured text inputs.
- Regex Validation: Ensures extracted data matches predefined patterns.
- Flexible LLM Integration: Works with default
ChatLLM7or any LangChain-compatible LLM. - Error Handling & Diagnostics: Provides clear error messages for failed validations.
- Retry Mechanism: Built-in retry logic for robustness.
🔧 Usage
Basic Usage (Default LLM: ChatLLM7)
from llmatch_validate import llmatch_validate
response = llmatch_validate(
user_input="Your input text here..."
)
print(response) # Returns validated/extracted data as a list
Custom LLM Integration
You can replace the default ChatLLM7 with any LangChain-compatible LLM (e.g., OpenAI, Anthropic, Google Generative AI).
Example: Using OpenAI
from langchain_openai import ChatOpenAI
from llmatch_validate import llmatch_validate
llm = ChatOpenAI()
response = llmatch_validate(
user_input="Your input text here...",
llm=llm
)
print(response)
Example: Using Anthropic
from langchain_anthropic import ChatAnthropic
from llmatch_validate import llmatch_validate
llm = ChatAnthropic()
response = llmatch_validate(
user_input="Your input text here...",
llm=llm
)
print(response)
Example: Using Google Generative AI
from langchain_google_genai import ChatGoogleGenerativeAI
from llmatch_validate import llmatch_validate
llm = ChatGoogleGenerativeAI()
response = llmatch_validate(
user_input="Your input text here...",
llm=llm
)
print(response)
🔑 API Key Configuration
- Default: Uses
LLM7_API_KEYfrom environment variables. - Manual Override: Pass the API key directly:
response = llmatch_validate( user_input="Your input text here...", api_key="your_llm7_api_key" )
- Get a Free API Key: Register at LLM7 Token.
📌 Parameters
| Parameter | Type | Description |
|---|---|---|
user_input |
str |
The input text to process and validate. |
api_key |
Optional[str] |
LLM7 API key (optional if LLM7_API_KEY is set). |
llm |
Optional[BaseChatModel] |
Custom LangChain LLM (optional; defaults to ChatLLM7). |
📝 Default LLM: ChatLLM7
By default, this package uses ChatLLM7 from langchain_llm7. The free tier rate limits are sufficient for most use cases. For higher limits, provide your own API key.
🔄 Rate Limits
- LLM7 Free Tier: Sufficient for most use cases.
- Custom API Key: Required for higher rate limits (pass via
api_keyorLLM7_API_KEY).
📂 License
This project is licensed under the MIT License.
📧 Support & Issues
For support or bug reports, open an issue on GitHub.
👤 Author
Eugene Evstafev (LinkedIn) | GitHub
Email: hi@euegne.plus
📚 Related Packages
llmatch-messages(Dependency)langchain_llm7(Default LLM)
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 llmatch_validate-2025.12.20175458.tar.gz.
File metadata
- Download URL: llmatch_validate-2025.12.20175458.tar.gz
- Upload date:
- Size: 5.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0db478591c8e95980dea50c919286e876d49f96e972521922f47bc11bb7eefa5
|
|
| MD5 |
1efacd10817fafb34a9231860cdebf93
|
|
| BLAKE2b-256 |
b9055ca679270e0320f68a4712964c03f52d0e2683244d8080a552b3470f110c
|
File details
Details for the file llmatch_validate-2025.12.20175458-py3-none-any.whl.
File metadata
- Download URL: llmatch_validate-2025.12.20175458-py3-none-any.whl
- Upload date:
- Size: 6.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
65219da4d5f53048fa9750d8e758a449827d6c68ed8297eff38d9f231344770a
|
|
| MD5 |
ee39f99e99b4eb3a943da9cb58e4efd8
|
|
| BLAKE2b-256 |
f2b205039bde93baf2d629b7a8784ad42ff3d2e37a6a533742b79997043a88a6
|