Coder Social home page Coder Social logo

ask-cli's Introduction

ask CLI

Ask is a Deno CLI for pinging GPT-3 and iterating with chain of thought prompting and other prompt engineering tricks.

Inspired by Linus' prototype (his impl here)

image

But it can also iterate on prompts:

image

And then it runs them in parallel for you to choose:

image

Install instructions

We use deno compile to ship a dedicated executable for each system architecture.

See the Releases page to download the appropriate binaries.

If you know what you're doing, you may also just run from source locally, see Local Dev below

Put the binary in your $PATH or just navigate your terminal to the folder where it is.

Usage instructions

These instructions are for Mac, but you should be able to adjust for Linux/Windows accordingly.

First get your OpenAI API Key from: https://beta.openai.com/account/api-keys

Then:

export OPENAI_API_KEY=sk_your_api_key_here
ask "How much wood would a woodchuck chuck if a woodchuck could chuck wood?"

By default you get a panel of options, but you can always exit with Ctrl+C.

The real power of this CLI comes from chaining prompts. You can run candidate prompts in parallel and choose prompts based on the responses.

image

And then it runs them in parallel for you to choose:

image

Local Dev

Make sure to have Deno installed.

Then, you can either:

  • deno run -A index.ts "how do i sample from a normal distribution from scratch in python?" for local dev
  • npm run build && ./builds/askcli "Shawn has five toys. For Christmas, he got two toys each from his mom and dad. How many toys does he have now?" to do a production build

Debugging:

deno run --inspect-brk  -A index.ts -d "How many of the integers between 0 and 99 inclusive are divisible by 8?"

and then open chrome://inspect, open the directory in devtools and put in breakpoints.

ask-cli's People

Contributors

swyxio avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

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