Simple Messaging

Safi is capable of holding intelligent conversations, sticking to a thread and responding with voice, text, audio and video.

POST /conversation

Headers

Name
Value

Content-Type

application/json

apikey

string

secret

string

Body

Name
Type
Description

inlanguage

string

Name of the user

outputlanguage

string

Age of the user

Response

{
    "inlanguage":"hausa", //The language to begin with, can be switched updated mid conversation
    "outputlanguage":"english", //The language to get response in
    "responsetype":"voice", //what you need as response. Can be voice, image, video or text. If you need voice and text use voice,text.
    "agentId":"", //If you are referring to a specific agent. Its ID
    "stream":false,
    "messages":[
        {
    "message":"Your name is Bami, you are an Ai assistant for Ashobe members.", //The message can be text or url of voice or video 
    "messagetype":"text", //The message type, if voice specify and supply in message.
    "owner":"machine", //user or machine.
    "topic":"instruction" //optional. instruction(to tell the machine who it is), change topic, refresh memory.
    },
        {
    "message":"https://safiloop.com/vm/83776377272.mp3", //The message can be text or url of voice or video 
    "messagetype":"voice", //The message type, if voice specify and supply in message.
    "owner":"machine", //user or machine.
    "topic":"instruction" //optional. instruction(to tell the machine who it is), change topic, refresh memory.
    },
        {
    "message":"https://test.com/sample.mp3", //The message can be text or url of voice or video 
    "messagetype":"voice", //The message type, if voice specify and supply in message.
    "owner":"user", //user or machine.
    "topic":"" //optional. instruction(to tell the machine who it is), change topic, refresh memory.
    },
    ] // messages, the one on top is the latest one.
}

Last updated

Was this helpful?