From 6f89900194e9c01bf747bba04699484d88fec906 Mon Sep 17 00:00:00 2001 From: Joel Date: Mon, 6 Feb 2023 12:38:26 -0800 Subject: [PATCH] fix(readme): some fixes --- README.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index b9b09e7f..d3ffeeda 100644 --- a/README.md +++ b/README.md @@ -114,6 +114,7 @@ console.log(response3.response); // Les chats sont les meilleurs animaux de comp ### API Server

Setup

+ You can install the package using ```bash npm i -g @waylaidwanderer/chatgpt-api @@ -176,7 +177,7 @@ To start a conversation with ChatGPT, send a POST request to the server's `/conv } ``` The server will return a JSON object containing ChatGPT's response: -```JSON +```JS // HTTP/1.1 200 OK { "response": "I'm doing well, thank you! How are you?", @@ -188,14 +189,14 @@ The server will return a JSON object containing ChatGPT's response: If the request is unsuccessful, the server will return a JSON object with an error message. If the request object is missing a required property (e.g. `message`): -```JSON +```JS // HTTP/1.1 400 Bad Request { "error": "The message parameter is required." } ``` If there was an error sending the message to ChatGPT: -```JSON +```JS // HTTP/1.1 503 Service Unavailable { "error": "There was an error communicating with ChatGPT." @@ -227,7 +228,7 @@ Successful output: { data: ' today', event: '', id: '', retry: undefined } { data: '?', event: '', id: '', retry: undefined } { data: '[DONE]', event: '', id: '', retry: undefined } -Hello! How can I help you today? +// Hello! How can I help you today? ``` Error output: