Generate a Message
POST https://app.sociable.how/api/createChatCompletion
To use this endpoint, you must have already created a dialogue and have its id
property. If you have forgotten your dialogue’s id
property, you can use the previous endpoint to view all dialogues and find it again.
Through this endpoint you’ll be able to send one or more messages and generate a response based on the customizations you specified in the dashboard.
There is no need to keep track of previous messages as we store messages for you in our database. We use previous messages to continuously provide conversational context for your AI persona.
Request Parameters
Parameter | Description | Example |
---|---|---|
dialogueId | Current dialogue’s id property | 9c831f86-3859-49b6-8b58-4b5425aaf131 |
messages | An array of Message objects. If passing in multiple messages, order with the oldest message at the beginning and newest message at the end of the array. See below for more information. | [{ “role”: “USER”, “content”: “hi”, “type”: “TEXT” }] |
metadata (optional) | An object with two properties. 1. context (optional): String. Specify context for the conversation.2. event (optional): Enumerated value. Can either be “MESSAGE” or “COMMENT”. | { “context”: “You are discussing travel sites along the Pacific coast”, “event”: “MESSAGE” } |
A Message
object consists of the following:
role: Enumerated value. Can either be USER
or PERSONA
. Indicates who the message is coming from.
content: String. Content of the message.
type: Enumerated value. Can either be TEXT
, IMAGE
, NO_RESPONSE
. Indicates message type (default TEXT
).