Start or continue a chat conversation
This function starts or continues a chat conversation by adding the user's message to the conversation. If the conversation does not exist, a new one will be initiated. The response can be displayed in the console, returned as a character vector, or returned as a full response object from the ChatGPT API.
A character string representing the message to be added to the chat conversation.
A character string representing the ID of the chat conversation to start or continue. Default is ".__CURRENTCHAT__".
A character string indicating the output format of the response. Default is "message_to_console". Valid options are "message_to_console", "message", or "response_object".
Additional arguments to pass to the chat_completion() function.
Depending on the value of the 'output' argument, this function returns one of the following: * "message_to_console": a message containing the response text is printed to the console (default). * "message": the response text as a character vector. * "response_object": the full response object from the ChatGPT API.