1.0.1 • Published 4 years ago

bluechat-back-test v1.0.1

Weekly downloads
-
License
ISC
Repository
gitlab
Last release
4 years ago

Bluechat

This is a generic chatbots backend, where you can enter your assistant's credentials and register an environment variable check, from a previously determined model, and make external requests.

Platform

Session Id

Request

  • Here you will make an initial request, to obtain the 'session_id', which will be used to let the Assistant know which session the messages sent are from.
GET / <url>:<port>

Exmaple:

GET / localhost:3000

Response

  • The response will be like this:
{
    "data": {
        "session_id": "<id>"
    }
}

Message

Request

  • Here you will make a request passing in the parameters the 'session_id' obtained in the initial request, and in the body a json with key 'text' and the message entered by the user.
POST <url>:<port>/<session_id>
Content-Type: application/json
{
	"text": "<message>"
}

example:

POST localhost:3000/3d86a86b-6b3a-483c-98c0-9098f21fde22
Content-Type: application/json
{
	"text": "corona"
}

Response

  • The response will be like this:
{
    "data": {
        "reponse": {
            "messages": [
                {
                    "response_type": "text",
                    "text": "<message>"
                }
            ],
            "total": 1
        },
        "context": ""
    }
}

Codes

1.0.1

4 years ago

1.0.0

4 years ago