Skip to content

Latest commit

 

History

11 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

func-gen

func-gen can be used to generate unix text processing utilities from English text. It uses langchain to create javascript functions to process text, and it uses Extism and the JavaScript PDK to safely execute the code in a Wasm sandbox.

Warning: This only works for very small, simple functions. We have yet to learn about all the tools and techniques to build a reliable code generation model. We'd love some help making the model better and incorporating things like teaching the model documentation for people's Extism plug-in systems.

Demo Video

https://www.loom.com/share/d956147a1a7d449391ec0778ebe12918

Install

Note: First you need to install Extism on your machine if you have not:

pip install --upgrade extism-func-gen

Run

# 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

About

Generate unix text processing utilities from LLMs

Resources

Stars

7 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages