Git Product home page Git Product logo

pseudocode's Introduction

PseudoCode

There is a blog post about this project.

pseudocode is a python module which allows users to describe the functions they want via type annotations and docstrings without writing the actual code. It empowers users to iterate with large language models to generate functions which satisfy the user along with defined tests.

pseudocode enforces the defined tests and provides automated feedback to the LLM when attempting to run these tests by reporting exceptions. There is a built in review cycle for the user to provide feedback on the generated code to help guide the LLM.

asciicast

from pseudocode import pseudo_function

@pseudo_function(review=True)
def my_sum_func(a: int, b: int, c: int) -> str:
    """A function which adds all arguments together and multiplies by two

    Examples
    --------
    >>> my_sum_func(1, 2, 3)
    12
    """
    pass

@pseudo_function
def get_total_issues(repository: str) -> int:
    """Get the total issues of given github repository

    Examples
    --------
    >>> get_total_issues("conda/conda")
    """
    pass


# LLM generated functions!
print(my_sum_func(1, 4, 5)) 
print(get_total_issues('conda/conda-libmamba-solver'))

This work uses OpenAIs gpt-3.5-turbo at the moment. Because of this it expects an environment variable OPENAI_API_KEY to be defined.

Vision

Much like how high level languages such as python are abstractions above lower level languages like C/C++. psuedocode aims to take advantages of LLMs to work with developers and enable them to create high level well defined interfaces. LLMs will fill in the details with iteration and feedback from the user.

Longer terms goals:

  • psuedocode.pseudo_file function to generate non-python files e.g. docker-compose.yaml, Dockerfile, pyproject.toml, etc.
  • caching of functions generated from pseudocode.pseudo_function
  • richer testing utilities for defined interfaces

License

MIT

pseudocode's People

Contributors

costrouc avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.