Engage App

Initialize a conversation on a designed topic

Initialize a new conversation on a specific topic

POST http://dev-api.med2lab.com/external/v1/engage/topic/init/

Request Body

Name
Type
Description

topic_id*

id

The topic id

Example Output
```json
{
    "engage_id": 854,
    "topic_id": 16,
    "topic_name": "Sale Consultant",
    "dialog": [
        {
            "role": "assistant",
            "content": "Hello! Are you looking for recommendations or assistance with choosing a product? I'm here to help you find the perfect solution to meet your needs! (for example: a dress for a birthday party, a new computer for work etc.)"
        }
    ],
    "data": null,
    "is_end": null
}
```
curl --location 'http://dev-api.med2lab.com/external/v1/engage/topic/init/' \
--header 'Authorization: Bearer PHApOPl7xtqc2ZEqg6c6AcL34DYOQk' \
--header 'Content-Type: application/json' \
--data '{
    "topic_id": 26
}'

Chat

Chat on a conversation

POST http://dev-api.med2lab.com/external/v1/engage/topic/conversation/

Request Body

Name
Type
Description

engage_id*

id

The engage id

data_chat*

string

Your input

```json
{
    "engage_id": 854,
    "topic_id": 16,
    "topic_name": "Sale Consultant",
    "dialog": [
        {
            "role": "assistant",
            "content": "Hello! Are you looking for recommendations or assistance with choosing a product? I'm here to help you find the perfect solution to meet your needs! (for example: a dress for a birthday party, a new computer for work etc.)"
        },
        {
            "role": "user",
            "content": "I'm looking for a cool laptop"
        },
        {
            "role": "assistant",
            "content": "Great! I can definitely assist you in finding a cool laptop. Could you please provide me with some more information about your requirements? For example, what is your budget for the laptop?",
            "is_response": true,
            "send_time": "2023-08-29 19:31:44.623622",
            "response_time": "2023-08-29 19:31:46.542263",
            "latency": "1",
            "chatgpt_version": "gpt-3.5-turbo-0613",
            "log_id": 14561
        }
    ],
    "data": null,
    "is_end": null,
    "response": "Great! I can definitely assist you in finding a cool laptop. Could you please provide me with some more information about your requirements? For example, what is your budget for the laptop?"
}
```
curl --location 'http://dev-api.med2lab.com/external/v1/engage/topic/conversation/' \
--header 'Authorization: Bearer PHApOPl7xtqc2ZEqg6c6AcL34DYOQk' \
--header 'Content-Type: application/json' \
--data '{
    "engage_id": 854,
    "data_chat": "I'\''m looking for a cool laptop"
}'

Last updated