Skip to content

CodeForget/Azure_OpenAI_Js_Chat_Boat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

Azure OpenAI JS Chatbot

This is a simple Node.js command-line application that demonstrates how to use the Azure OpenAI service with the openai JavaScript library.

Prerequisites

  • Node.js (v18+ recommended)
  • An Azure account with an active subscription.
  • An Azure OpenAI Service resource deployed with a model (e.g., gpt-35-turbo).

Setup

  1. Install dependencies:

    Using npm, install the required packages listed in package.json.

    npm install
  2. Configure Environment Variables:

    Create a .env file in the root of the project. This file will store your Azure OpenAI credentials. Add the following content to it, replacing the placeholder values with your specific details.

    AZURE_OPENAI_ENDPOINT="<YOUR_AZURE_OPENAI_ENDPOINT>"
    AZURE_OPENAI_API_KEY="<YOUR_AZURE_OPENAI_API_KEY>"
    MODEL_NAME="<YOUR_DEPLOYMENT_NAME>"

How to Run

Execute the script from your terminal using node. Pass your prompt as a command-line argument enclosed in quotes.

node run_model.js "Your prompt here"

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors