A new package designed to transform unstructured text inputs into structured, actionable insights using advanced language models. This package leverages the capabilities of llmatch-messages to ensure
Project description
text2structured
Transform unstructured text inputs into structured, actionable insights using advanced language models.
Overview
This package is designed to leverage the capabilities of langchain's messages to transform text inputs into structured, actionable insights. It uses the ChatLLM7 model from langchain_llm7 by default, but allows users to pass their own langchain llm instance for custom LLM usage.
Installation
pip install text2structured
Usage
from text2structured import text2structured
user_input = "How Hurricanes Became a Hot Investment"
response = text2structured(user_input)
Parameters
user_input: the user input text to process (str)llm: the langchain llm instance to use, if not provided the default ChatLLM7 will be used (Optional[BaseChatModel])api_key: the api key for llm7, if not provided the default rate limits for LLM7 free tier will be used (Optional[str])
Custom LLM usage
You can safely pass your own langchain llm instance to use a custom LLM. For example to use the openai model:
from langchain_openai import ChatOpenAI
from text2structured import text2structured
llm = ChatOpenAI()
response = text2structured(user_input, llm=llm)
Similarly you can use anthropic or google models with their respective packages:
# with anthropic model
from langchain_anthropic import ChatAnthropic
from text2structured import text2structured
llm = ChatAnthropic()
response = text2structured(user_input, llm=llm)
# with google model
from langchain_google_genai import ChatGoogleGenerativeAI
from text2structured import text2structured
llm = ChatGoogleGenerativeAI()
response = text2structured(user_input, llm=llm)
Default rate limits
The default rate limits for LLM7 free tier are sufficient for most use cases of this package. If you need higher rate limits you can get a free api key by registering at https://token.llm7.io/. You can pass your api key via environment variable LLM7_API_KEY or directly to the text2structured function:
text2structured(user_input, api_key="your_api_key")
Documentation
For more information about the(ChatLLM7) model and its API, please refer to the langchain_llm7 documentation and the langchain documentation.
GitHub Issues
Open issues on GitHub.
Author
Eugene Evstafev (hi@eugene.plus).
Social media
License
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 text2structured-2025.12.20175536.tar.gz.
File metadata
- Download URL: text2structured-2025.12.20175536.tar.gz
- Upload date:
- Size: 4.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1aec82550de2eaee1a3d9a9aa20c39b097aa3a61febb3d1bf3348b2216f06688
|
|
| MD5 |
24750fc4bc6f635fe2d8dfbc63921234
|
|
| BLAKE2b-256 |
8a17f40bb3c4e0032af02ad9da97fd8f313683810dcf00a06dc333d08a65affa
|
File details
Details for the file text2structured-2025.12.20175536-py3-none-any.whl.
File metadata
- Download URL: text2structured-2025.12.20175536-py3-none-any.whl
- Upload date:
- Size: 5.0 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 |
f38b9892a74cbfb86d6185e1dd18dd0ae888154742b5b1abae130c07382eec80
|
|
| MD5 |
46f1f3988f19a577c3d6b671f276495f
|
|
| BLAKE2b-256 |
65d78fc69ef31f0ac08155a01d107ce8b873971a6197443d8f631f8a8333606d
|