Skip to content
On this page

<<EasyGPT>>.addMessage()

Add a message that will be sent to ChatGPT after the ask method has been called.

To achieve this easyGPT adds a message with the role of "user" to the stack.

The user messages help instruct the assistant. They can be generated by the end users of an application, or set by a developer as an instruction. - Chat completion - OpenAI API

Usage

js
instance.addMessage('Hello ChatGPT!');

Parameters

PARAMETERTYPEDefaultDESCRIPTION
contentStringN/AThe message you wish to add.

Returns

EasyGPT instance (<<EasyGPT>>)