Got it! Here's a polished version of your README with the provided instructions:
-
Run
npm install
At the base of the project directory, run the following command to install all necessary dependencies:
npm install
-
Generate OpenAI API Key
- Generate an OpenAI API key from here.
-
Create a
.env
FileAt the base of the project, create a
.env
file and add the following line, replacing<YOUR_OPENAI_API_KEY>
with your actual OpenAI API key:OPENAI_API_KEY=<YOUR_OPENAI_API_KEY>
To run the project, use the following command:
node startup.js
-
Update Postman Collection
Make sure your Postman collection is updated with the appropriate endpoints.
-
Hit Chat API from Postman Collection
To initiate a chat, send a request to the chat API. Example request:
{ "query": "Hi" }
On the first response, you will receive a
conversationId
, which will be used for subsequent requests. Example:{ "query": "I want to book a room", "conversationId": "b0ff22ad-8cab-4cbf-ba70-9afa94eb4a2" }
{
"query": "Hi"
}
{
"query": "I want to book a room",
"conversationId": "b0ff22ad-8cab-4cbf-ba70-9afa94eb4a2"
}