Skip to content

Runninghill/rh-openai-nodejs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Getting Started

OpenAI GPT-3.5 Turbo Interaction

This code provides a simple way to interact with OpenAI's GPT-3.5 Turbo model and measure the time taken for a completion request. It sends a prompt to the model and prints the response along with the time taken in milliseconds.

Prerequisites

  • Node.js installed on your system.
  • An OpenAI API key.

Getting Started

  1. Clone this repository
  2. run npm install to install all the necessary dependencies

Running the Application

To run the applications, follow these steps:

1.You can run the application by using node index.js or npm run start commands

Functions

-runCompletion(prompt): Sends a prompt to the GPT-3.5 Turbo model and prints the response. Also calculates the time taken for the request. -calculateTimeTaken(startTime): Calculates and prints the time taken for the request in milliseconds. Example

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published