Metadata-Version: 2.1
Name: extism-func-gen
Version: 0.2.0
Summary: 
License: MIT
Author: The Extism Authors
Author-email: oss@extism.org
Requires-Python: >=3.11,<4.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Requires-Dist: extism (>=0.3.0,<0.4.0)
Requires-Dist: langchain (>=0.0.150,<0.0.151)
Requires-Dist: openai (>=0.27.4,<0.28.0)
Description-Content-Type: text/markdown

# func-gen

func-gen can be used to generate unix text processing utilities from English text.
It uses [langchain](https://python.langchain.com/en/latest/index.html) to create javascript functions
to process text, and it uses [Extism](https://extism.org/) and the [JavaScript PDK](https://extism.org/docs/write-a-plugin/js-pdk)
to safely execute the code in a Wasm sandbox.

## Install

```
pip install extism-func-gen
```

## Run

```bash
# Need to set the OpenAI API key
export OPENAI_API_KEY="sk-<paste-key-here>"

# Create a func
func-gen count_vowels -d "Write a function that counts the number of vowels in an input string"

# Use a func
echo "hello world" | func-gen count_vowels
# 3


# List the funcs
func-gen --list
```


