nl2action
A package for natural language interpretation to structured commands or actions
Overview
This package interprets user-submitted text descriptions and converts them into structured commands or actions for devices, home automation scripts, and other applications. It utilizes pattern matching with language models to translate natural language inputs into executable instructions.
Installation
pip install nl2action
Usage
from nl2action import nl2action
response = nl2action("user_input_text")
Parameters
user_input: The user-submitted text to processllm: The langchain llm instance to use (optional, defaults toChatLLM7withLLM7_API_KEY)api_key: The API key for LLM7 (optional, default is environment variableLLM7_API_KEYorNone)
Using a custom LLM instance
from langchain_openai import ChatOpenAI
from nl2action import nl2action
llm = ChatOpenAI()
response = nl2action(user_input, llm=llm)
Using an Anthropic AI
from langchain_anthropic import ChatAnthropic
from nl2action import nl2action
llm = ChatAnthropic()
response = nl2action(user_input, llm=llm)
Using Google Generative AI
from langchain_google_genai import ChatGoogleGenerativeAI
from nl2action import nl2action
llm = ChatGoogleGenerativeAI()
response = nl2action(user_input, llm=llm)
Environment Variables
LLM7_API_KEY: Set to use a custom API key for LLM7, orNonefor the free tier
LLM7 Setup
- Get a free API key at https://token.llm7.io/
- For higher rate limits, set the
LLM7_API_KEYenvironment variable or pass it directly to thenl2actionfunction
Issues
https://github.com/chigwell/ nl2action
Metadata
Release files for nl2action 2025.12.21163026
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| nl2action-2025.12.21163026.tar.gz | 3.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| nl2action-2025.12.21163026-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 8.3 kB
Release files / nl2action-2025.12.21163026.tar.gz
| Download URL | nl2action-2025.12.21163026.tar.gz |
|---|---|
| Size | 3.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
adb382e3a7b18f8daa23a3887df82338f15c9beb6708e95eafbac62f5ef1cb06
|
|
BLAKE2b-256 checksum How to use checksums |
db03f355006d592850a4a6c4fcbcdb4852a648007e81a235f5dd808c19f2a78d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.1
|
Release files / nl2action-2025.12.21163026-py3-none-any.whl
| Download URL | nl2action-2025.12.21163026-py3-none-any.whl |
|---|---|
| Size | 4.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
dd961b7ec058b9977c79727bdd03246be7914f46f98de164be58d1adc8496c5d
|
|
BLAKE2b-256 checksum How to use checksums |
0f8a045fe7fc2864b8d75bb1eeae452786ba157703360b79287ddfe8d2a1dfe6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.1
|