Git Product home page Git Product logo

openai_api_demo's Introduction

Based on OpenAI API Quickstart - Node.js example app

updated on 2024-2-12

This is a modified example based on the "Pet Name Generator App" from the OpenAI API quickstart tutorial. The example is built using the Next.js framework with React, and is designed to provide a demonstration for network automation students using the DevNet environment. To get set up, please either follow the instructions outlined below.

Setup

  1. If you don’t have Node.js installed, install it from here

    for you use ubuntu Linux devasc virtualbox, you can install nodejs version 18+ using this link, using the option2.

  2. Clone this repository

    git clone https://github.com/wyonghao/openai_api_demo.git
  3. Navigate into the project directory

    $ cd openai_api_demo
  4. Install the requirements

    $ npm install
  5. Make a copy of the example environment variables file

    $ cp .env.example .env
  6. Add your API key to the newly created .env file. The Key shall start with sk-****

    nano .env
  7. Run the app

    $ npm run dev
  8. Setup the port forward in virtualbox settings to forward 3000 to the port that the host using for example you can use 5555 as the below picture:

Screenshot

You should now be able to access the app at http://localhost:5555, which maps to the guest OS' http://localhost:3000!

website

For the full context behind this example app, check out the official open AI tutorial.

Note, you might need to run

$ npm install
$ npm update

again after the source code or the APIs are updated

openai_api_demo's People

Contributors

wyonghao avatar

Watchers

 avatar

Forkers

leindon

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.