Skip to content

vzan2012/ai-chat

Repository files navigation

OpenAI - Chat Completions

Developed a User Interface where user can able to enter prompt and get the results generated by OpenAI API Completions.

Description

This codebase is developed using Vite, JavaScript and Tailwind CSS has been used. It has the UI and OpenAPI scripts integrated. When the user sends prompt as input, the OpenAI API generates the results and displayed in the UI to the user.

Getting Started

Dependencies

  • To run this application in your local. You need NodeJS installed in your local machine.

Installing

  • Download the zip file from the releases or pull the code

  • After extracting the files to your local machine. Inside the project folder.

  • Execute the command

    npm install

  • Inside the project folder, you can find the file .env.sample file, copy or rename this file .env file.

  • You need to provide OpenAI API Key (to get the key you need to register with OpenAI Platform)

  • VITE_API_KEY = "<< Your Key from OpenAI >>"
    VITE_API_URL = "https://api.openai.com/v1/chat/completions"
    
  • You can find the API URL in OpenAI API Reference

Executing program

  • How to run the program

  • Execute the command in your terminal

    npm run dev

  • Open the browser and access url generated from the terminal (Example: http://localhost:5173)

Screenshots

image

image

Author

Deepak Guptha Sitharaman

License

This project is open source licensed - see the LICENSE.md file for details