Skip to main content

govaitextextract

PyPI version License: MIT Downloads LinkedIn

Extract structured information from government or organizational tech/AI initiatives

A Python package that processes text inputs (e.g., news headlines, announcements) to extract structured data about government or organizational technology and AI initiatives. It uses a language model to identify key details like entity, initiative name, focus, and more, returning results in a consistent format (JSON/XML-compatible).


📦 Installation

pip install govaitextextract

🚀 Usage

Basic Usage (Default LLM: ChatLLM7)

from govaitextextract import govaitextextract

user_input = "The Ministry of Digital Transformation announces a new AI project with 50 specialists."
response = govaitextextract(user_input)
print(response)

Custom LLM Integration

You can replace the default ChatLLM7 with any LangChain-compatible LLM (e.g., OpenAI, Anthropic, Google):

Using OpenAI:

from langchain_openai import ChatOpenAI
from govaitextextract import govaitextextract

llm = ChatOpenAI()
response = govaitextextract(user_input, llm=llm)

Using Anthropic:

from langchain_anthropic import ChatAnthropic
from govaitextextract import govaitextextract

llm = ChatAnthropic()
response = govaitextextract(user_input, llm=llm)

Using Google Generative AI:

from langchain_google_genai import ChatGoogleGenerativeAI
from govaitextextract import govaitextextract

llm = ChatGoogleGenerativeAI()
response = govaitextextract(user_input, llm=llm)

🔧 Parameters

Parameter Type Description
user_input str The input text (e.g., news headline) to process.
api_key Optional[str] LLM7 API key (defaults to LLM7_API_KEY env var).
llm Optional[BaseChatModel] Custom LangChain LLM (e.g., ChatOpenAI). Falls back to ChatLLM7.

🔑 API Key & Rate Limits

  • Default LLM: ChatLLM7 (from langchain_llm7).
  • Free Tier: Sufficient for most use cases.
  • Custom Key: Pass via api_key or LLM7_API_KEY env var.
  • Get a Key: Register at LLM7.

📜 Output Format

The function returns structured data (e.g., JSON-like) extracted from the input text, such as:

{
    "entity": "Ministry of Digital Transformation",
    "initiative_name": "New AI Project",
    "specialists": 50,
    "focus": "AI"
}

📝 Notes

  • Uses regex validation for consistency.
  • Error handling included for LLM failures.
  • Extensible for custom patterns via pattern in prompts.

📢 Issues & Support

Report bugs or feature requests at: GitHub Issues


👤 Author

Eugene Evstafev 📧 hi@euegne.plus 🔗 GitHub: chigwell


Metadata

Release files for govaitextextract 2025.12.21194243

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for govaitextextract 2025.12.21194243
File Size Uploaded
govaitextextract-2025.12.21194243.tar.gz 4.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for govaitextextract 2025.12.21194243
File Interpreter ABI Platform
govaitextextract-2025.12.21194243-py3-none-any.whl Python 3 none any Details

Total release size: 9.2 kB

Release files / govaitextextract-2025.12.21194243.tar.gz

Download URL govaitextextract-2025.12.21194243.tar.gz
Size 4.3 kB
Tags Source
SHA-256 checksum
How to use checksums
f3d3ab4501be245f387687da3f8597c33f0fd754aa868ad85492217f1c4d5580
BLAKE2b-256 checksum
How to use checksums
420aa359b3f41c8a451857fc9b6c4461895e38923d44fa8820e9d0025d021f4f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.1

Release files / govaitextextract-2025.12.21194243-py3-none-any.whl

Download URL govaitextextract-2025.12.21194243-py3-none-any.whl
Size 4.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
40e8535d4514d5b67a78882b48b2c66f28b897636858877d0bea4a5ef1a53801
BLAKE2b-256 checksum
How to use checksums
03a80f8d3e5a5e619949323172b175eec65f104a1d7753720c0684a4990ec24e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.1

Release history Release notifications | RSS feed

This release

2025.12.21194243 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page