Coder Social home page Coder Social logo

epic-ai's Introduction

Epic Stack + OpenAI

epic-ai.mp4

This demonstrates how to use OpenAI with the Epic Stack. It includes streaming from the chat completion API and enhances the note editor with a completion button for both the title and the content.

To check out the changes, check the git commit history. The important bits are:

  1. Get an API key from OpenAI (you probably will need to setup billing because their free tier does not seem to work very well)
  2. Add the API key to the .env file for local testing and add a fake one to .env.example for the repo
  3. Add the openai package to the package.json file
  4. Add a mock handler for the chat completion API (for now, we just use passthrough, but if you want to mock it so this works offline, then go for it).
  5. Add a resource route that will be used to stream the chat completion API
  6. Add a generate button to the note editor for both the title and content. (Those will need to change to controlled inputs so that the completion can be added to the input value).
  7. When the generate button is clicked, start a new EventStream and point it to our resource route.

Watch me build this live on YouTube.

epic-ai's People

Contributors

kentcdodds 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

Watchers

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