Coder Social home page Coder Social logo

stackwise's Introduction

Stackwise: Explain what you want a function to do, and AI builds it.

Discord Follow Twitter Follow GitHub Repo stars License: MIT

Stackwise is a VS Code extension that automatically writes and imports nodejs functions so that you can write code without context switching.

Usage

Stackwise introduces a straightforward command structure, where you specify a 'brief' for the desired action, along with the inputs and outputs:

stack("brief describing a specific action", {
    in: /* single input or object {} with multiple inputs */,
    out: // same as above, but output
})

This approach streamlines API interactions, reducing the need for intricate coding and extensive API knowledge. Fully typed, and editable within your repo.

Upon saving your command, Stackwise replaces it with a collapsed function with your inputs and an import statement at the top of your file. The generated code resides in the /stacks directory within your project root, ensuring clean and maintainable codebase.

Special Note for NextJS Developers

NextJS developers can leverage Stackwise for server actions, making API integrations even smoother. Here’s an example demonstrating the use of Stackwise in a NextJS environment:

example image

Current Integrations

Stackwise currently integrates with three APIs:

  • Replicate
  • OpenAI
  • Pinecone

Contributions to improve these or add new integrations are welcome. If you're interested in expanding Stackwise's capabilities, feel free to submit a pull request or contact us (join the Discord or [email protected]) for collaboration.

Getting Started

Prerequisites:

  • Typescript project
  • openai api key
  • pinecone api key

To start using Stackwise, follow these steps:

  1. Clone the Stackwise repository:
git clone https://github.com/stackwiseai/stackwise.git
  1. cd stackwise
  2. npm install
  3. copy the launch.json.example into launch.json and fill these environment variables:
  • PINECONE_API_KEY
  • PINECONE_ENVIRONMENT=PINECONE_ENVIRONMENT
  • OPENAI_API_KEY=OPENAI_API_KEY
  1. Click Run and Debug -> Click on the play button "Run Extension"
  2. Open your typescript project. In your typescript project, type:
const prompt = "What's the capital of the United States ?"
result = await stack(
    "Ask a question to GPT-4",
    {
        in: prompt
        output: "Washington D.C"
    }
)
  1. Save your file. The function should collapse into something like this. const prompt = "What's the capital of the United States ?"
const result = await askGPT4(prompt)
  1. You can cmd + click (ctrl + click on windows) on the function to see the code of the function.
  2. If you don't like the code, edit it.

Roadmap

Our future developments include:

  • Interactive stack modification: Chat with your stack to refine and improve it.

  • Dynamic input chains: Link multiple stacks to each other using dynamic inputs. Currently only static briefs work.

  • Expand integrations: Continually adding more APIs based on community feedback. Let us know what you want to see next!

  • API insights: See what APIs you're calling most and how what you're using them for.

  • Non-collapsible stacks: Edit your stacks continuously without automatic collapsing. If something with the api changes, it will automatically heal to work.

Join The Community

Discord Follow

We welcome contributions, feedback, and suggestions to further enhance Stackwise.

We want to make API integration easy, without the hassle of reading documentation or ever leaving your IDE. If you made it here you're at the very least intruiged and we'd love to have you :)


This project is licensed under the MIT License.

stackwise's People

Contributors

waynehamadi avatar silennaihin avatar pagebook1 avatar ariessanity avatar blankeos avatar vmorilla05 avatar damyst avatar stackwisebot 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.