A new package designed to interpret user-submitted text descriptions, such as notices or requests related to device control or automation, and convert them into structured commands or actions. By leve
Project description
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
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 nl2action-2025.12.21163026.tar.gz.
File metadata
- Download URL: nl2action-2025.12.21163026.tar.gz
- Upload date:
- Size: 3.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
adb382e3a7b18f8daa23a3887df82338f15c9beb6708e95eafbac62f5ef1cb06
|
|
| MD5 |
5147bd7e4b0fbaee9b868f6a723eb16c
|
|
| BLAKE2b-256 |
db03f355006d592850a4a6c4fcbcdb4852a648007e81a235f5dd808c19f2a78d
|
File details
Details for the file nl2action-2025.12.21163026-py3-none-any.whl.
File metadata
- Download URL: nl2action-2025.12.21163026-py3-none-any.whl
- Upload date:
- Size: 4.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dd961b7ec058b9977c79727bdd03246be7914f46f98de164be58d1adc8496c5d
|
|
| MD5 |
4a8285a43d84277b38a2af95e88ddcd8
|
|
| BLAKE2b-256 |
0f8a045fe7fc2864b8d75bb1eeae452786ba157703360b79287ddfe8d2a1dfe6
|