Skip to main content

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

LinkedIn

License

License: MIT

PyPI version Downloads

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

text2structured-2025.12.20175536.tar.gz (4.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

text2structured-2025.12.20175536-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

Details for the file text2structured-2025.12.20175536.tar.gz.

File metadata

File hashes

Hashes for text2structured-2025.12.20175536.tar.gz
Algorithm Hash digest
SHA256 1aec82550de2eaee1a3d9a9aa20c39b097aa3a61febb3d1bf3348b2216f06688
MD5 24750fc4bc6f635fe2d8dfbc63921234
BLAKE2b-256 8a17f40bb3c4e0032af02ad9da97fd8f313683810dcf00a06dc333d08a65affa

See more details on using hashes here.

File details

Details for the file text2structured-2025.12.20175536-py3-none-any.whl.

File metadata

File hashes

Hashes for text2structured-2025.12.20175536-py3-none-any.whl
Algorithm Hash digest
SHA256 f38b9892a74cbfb86d6185e1dd18dd0ae888154742b5b1abae130c07382eec80
MD5 46f1f3988f19a577c3d6b671f276495f
BLAKE2b-256 65d78fc69ef31f0ac08155a01d107ce8b873971a6197443d8f631f8a8333606d

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