https://github.com/chigwell/nl2action
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
https://github.com/chigwell/nl2action
automation-scripts command-translation device-control executable-instructions intuitive-interface language-models mac-automation natural-language-processing pattern-matching seamless-integration text-interpretation user-interaction
Last synced: 5 months ago
JSON representation
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
- Host: GitHub
- URL: https://github.com/chigwell/nl2action
- Owner: chigwell
- Created: 2025-12-21T16:30:25.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2025-12-21T16:30:32.000Z (6 months ago)
- Last Synced: 2025-12-23T06:17:07.705Z (6 months ago)
- Topics: automation-scripts, command-translation, device-control, executable-instructions, intuitive-interface, language-models, mac-automation, natural-language-processing, pattern-matching, seamless-integration, text-interpretation, user-interaction
- Language: Python
- Homepage: https://pypi.org/project/nl2action/
- Size: 2.93 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# nl2action
[](https://badge.fury.io/py/nl2action)
[](https://opensource.org/licenses/MIT)
[](https://pepy.tech/project/nl2action)
[](https://www.linkedin.com/in/eugene-evstafev-716669181/)
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
```bash
pip install nl2action
```
## Usage
```python
from nl2action import nl2action
response = nl2action("user_input_text")
```
## Parameters
* `user_input`: The user-submitted text to process
* `llm`: The langchain llm instance to use (optional, defaults to `ChatLLM7` with `LLM7_API_KEY`)
* `api_key`: The API key for LLM7 (optional, default is environment variable `LLM7_API_KEY` or `None`)
### Using a custom LLM instance
```python
from langchain_openai import ChatOpenAI
from nl2action import nl2action
llm = ChatOpenAI()
response = nl2action(user_input, llm=llm)
```
### Using an Anthropic AI
```python
from langchain_anthropic import ChatAnthropic
from nl2action import nl2action
llm = ChatAnthropic()
response = nl2action(user_input, llm=llm)
```
### Using Google Generative AI
```python
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, or `None` for the free tier
## LLM7 Setup
* Get a free API key at https://token.llm7.io/
* For higher rate limits, set the `LLM7_API_KEY` environment variable or pass it directly to the `nl2action` function
## Issues
https://github.com/chigwell/ nl2action