Git Product home page Git Product logo

kami's Introduction

Kami is a tiny copilot for Origami Studio that helps to create JavaScript Patches using GPT-4.
Select a JavaScript Patch, invoke the app's overlay using the shortcut and describe the logic of your patch.

Kami is a native macOS menu bar app. You have to provide your own OpenAI API Key to use the app. Your API key is stored locally on your machine.

Background

  • JavaScript Patches are a fantastic way to prototype more complex logic inside Origami Studio
  • OpenAI's GPT-4 is very capable of writing JavaScript code
  • I experimented with ways to combine these two tools into a single surface

The result is a tiny app that sits ‘on top' of Origami Studio. Think of it as a tiny, rudimentary code editor that lets you open, generate and save JavaScript files without leaving the Origami Studio surface.

Installation

Download the App from the release page and open the Kami.dmg file.

Usage

  1. Launch the app, provide your OpenAI API Key
  2. To pen a JavaScript patch...
  • Using the Shortcut: Select the JavaScript Patch and hit the shortcut (Default: Cmd+J)
  • 🗄️ Using the Context Menu: Right-click the JavaScript Patch > Open with ... > Kami

Caveats

Experimental

Consider this experimental software. One thing to figure out is how to further improve the app's prompt and improve the resulting code/patch quality. If you run into any issues, open an Issue or reach out via Mail/Twitter.

Cost

With every request to GPT-4, the app prepends (a truncated version of) the Origami Studio JavaScript Patch API documentation to the prompt. This is needed to generate the Origami-flavoured JavaScript that drives the patch. This adds an overhead of around 2000 input tokens to every request. In the future, API requests might become cheaper that this becomes negligible, or new APIs such as the Assistant API might make prepending the documentation not necessary anymore.

Permissions

One neat thing is the ability to open JavaScript Patches using the keyboard shortcut. It's quick and simple. For this to work though, the app requires system-level Accessibility Permissions because it emulates a ⌘+C keystroke to copy the JavaScript patch to the clipboard (and then read the Patch data from the clipboard). This is pretty invasive permission to ask for. For what it's worth, the permission is only eber used for that specific purpose. See the PasteboardHandler file for more.

If you don't want to (or can't) give this permission, JavaScript Patches can also be opened via the ‘Open with…’ right-click menu (no permissions are required for that).

Acknowledgements

Luke Haddock, George Kedenburg III for their Origami-GPT-4 experiments and instruction texts, Matthew Mang for their GPT-4 Origami Patch.

kami's People

Contributors

alexwidua 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.