1.1.2-Robot Dialog Openapi-websocket

1. Overview

  • Interface name: Robot dialog-websocket interface

  • Version number: v1.0.0

2. Information

  • WebSocket: wss://DOMAIN/openapi/v2/ws/dialog/

  • Domain: Refer to "Service address description"

3. Protocol Description

3.1 Heartbeat (not required)

Refer to the following examples

3.2 Conversation

Request body field:

Parameter name
Type
Required
Description

cybertron-robot-key

string

Yes

Robot key

cybertron-robot-token

string

Yes

Robot token

username

string

Yes

User account

extra-header

string

No

Same http interface

extra-body

string

No

Same http interface

segment_code

string

No

session code

question

string

Yes

Dialog problem (if the robot configures priority intent, it is necessary to pass a null value to drive the conversation flow to start)

More optional extended request field:

Field Name
Type
Description

message_params

array

Pass the message field of the model, same as openai's interface message.

chat_history

array

dialog history, spelled into message

tip_message_extra

string

robot configuration role setting field. If this field is present when the interface is called, this round of dialog will override the robot configuration role setting

tip_message_params

object

parameters in the robot configuration role setting field. If this field is present when the interface is called, this round of dialog will be filled with the parameters in the robot configuration role setting

model_params

object

model parameters, currently supports 4 parameter configurations

Extended fields example:

// message_params
[
    {
        "role": "system",
        "content": "You are a customer service and can answer many questions"
    },
    {
        "role": "user",
        "content": "Problem"
    }
]
// chat_history
[
    {
        "question": "How big is Beijing?",
        "answer": "Beijing is very big, 7777"
    },
    {
        "question": "How small is Beijing?",
        "answer": "Beijing is very small, 000000000000"
    }
]
// tip_message_extra
"Your name is JoJo, you are...."
// tip_message_params
{
    "name": "Sun Wukong...."
}
// model_params
{
    "top_p": 0.98,
    "temperature": 0.1,
    "frequency_penalty": 1,
    "presence_penalty": 2,
    "max_tokens": 1000 // since: v1.4.10
}

Expanded field notes:

  • The three fields of message_params, tip_message_extra, tip_message_params are mutually exclusive, and only one of them takes effect. Parameter priority: message_params > tip_message_extra > tip_message_params. If you pass at the same time, the higher priority will take effect.

  • The chat_history and message_params parameters are mutually exclusive, and tip_message_extra, tip_message_params, model_params can be passed together. According to the rules, you can use the network search and rag functions.

Response body field:

Field Name
Type
Description

code

string

"000000" is normal, other exceptions

message

string

Status description

index

int

-4 is the reference picture; -3 is the network search result; -2 is the thread information, which can be ignored; when it is -1, it means that the question has been confirmed to be received; when it is 0, it starts to increment and finish isnWhen data is a reply clip output by streaming, there are other clips waiting to be received

finish

string

ywhen, it means that the reply has ended; at this time, all complete replies in data, and the user decides to choose according to the needs

type

string

heartbeatHeartbeat request;stringWhen data is text that can be spliced ​​directly;jsonWhen data is a string serialized by json;flowThe special analysis rules for data are as follows

data

-

After the reply is completed, the data is the same as the http interface

In response bodytype=flowWhen the fields in data:

Field Name
Type
Description

answer

string

Answer returned by the conversation stream, use this client to display (key fields)

content_type

string

Return to answer type

code

string

"000000" is normal, other exceptions

node_stream

int

Whether this node is streaming output; 1: streaming, 0: non-streaming (usually involving model reply will be streaming output) (key fields)

node_answer_index

string

Node streaming return number (key field)

node_answer_finish

string

Whether the node answers are completed (key fields)

flow_stage

string

flow_running

flow_uuid

string

dialog uuid, generally not available to clients

history

array

Dialog stream saves conversation history, which is not available to clients

output

array

Node output information, which is not available to clients

target_node_id

string

target node, generally not available to clients

source_node_id

string

Not available to clients on average

cur_node_id

string

Not available to clients on average

node_id

string

Not available to clients on average

session_id

string

Not available to clients on average

4. Example

Example 1 - Heartbeat (not required)

ask:

{
    "type": "heartbeat",
    "data": "ping"
}

response:

{
    "code": "000000",
    "message": "success",
    "type": "heartbeat",
    "data": "pong"
}

Example 2-Normal Dialog

ask:

{
    "cybertron-robot-key": "PL1qFV************ lhkA0NSPo=",
    "cybertron-robot-token": "MTcwMjg3*********************************************dWJ3ckd1ODQ9",
    "username": "testuser",
    "question": "the weather info of beijing",
    "segment_code": "wWkE3bNkL3SzJX9orcO9P"
}

response:

{
    "code": "000000",
    "message": "success",
    "dialog_id": "1745062364369207296",
    "type": "string",
    "index": 0,
    "data": "in",
    "finish": "n"
}
{
    "code": "000000",
    "message": "success",
    "dialog_id": "1745062364369207296",
    "type": "string",
    "index": 1,
    "data": "Mang",
    "finish": "n"
}
{
    "code": "000000",
    "message": "success",
    "dialog_id": "1745062364369207296",
    "type": "string",
    "index": 2,
    "data": "Mang",
    "finish": "n"
}
// ...
{
    "code": "000000",
    "message": "success",
    "dialog_id": "1745062364369207296",
    "type": "string",
    "index": 219,
    "data": ".",
    "finish": "n"
}
{
    "code": "000000",
    "message": "success",
    "dialog_id": "1745062364369207296",
    "type": "json",
    "index": 220,
    "data": {
        "type": "string",
        "Answer": "Survey in the vast sea of ​​people, \nSeeking the home of the soul.\nSunlight shines on the earth, \nWarming every corner.\n\nThe spring breeze blows through the flowers, \nThe fragrance fills the air.\nThe scorching sun in summer, \nBathing on the beach by the sea.\nThe maple leaves in autumn are as red as fire, \nFloating on the waves on the lake.\nThe snowflakes in winter are flying, \nThe entire ridge is high.\nLife is like a poem The meaning is long, and every line is worth cherishing. \n Feel the beauty of life with your heart, and let the soul fly in the poem. \n\n May the power of poetry accompany you, and warm every lonely night. \n Let the rhythm of words jump, and awaken the sleeping dreams in your heart. \n\n This is the poem I weave for you, and I hope it will bring you a little joy. \n Let us enter the world of poetry together, and feel the beauty and freedom in it. "
    },
    "finish": "y"
}

Example 3-Streaming Output 1

ask:

{
    "question": "",
    "username": "kKp5xVJJ_Gx6ZG2vJSvkQ",
    "cybertron-robot-key": "St8EsOt*********xE9bMeKc=",
    "cybertron-robot-token": "MTczMDA5***************************************M2VMR3JJc1U9",
    "segment_code": "_wg7RYDBFtarIHV_b0an6"
}

response:

{
    "code": "400000",
    "message": "task send success,",
    "type": "json",
    "index": -2,
    "data": {
        "task_id": "df60fc1a94fa11ef993fe4434b3011a0"
    }
}
{
    "code": "400000",
    "message": "send question success",
    "index": -1,
    "type": "json",
    "data": {
        "question": "",
        "dialog_id": "1850795752799076352",
        "id": "198778",
        "response_create_time": "2024-10-28 15:04",
        "response_create_time_timestamp": "1730099068247",
        "response_update_time": "2024-10-28 15:04",
        "response_update_time_timestamp": "1730099068247"
    }
}
{
    "flow_redis_key": "215kKp5xVJJ_Gx6ZG2vJSvkQ_wg7RYDBFtarIHV_b0an2",
    "code": "000000",
    "message": "success",
    "dialog_id": 1850795752799076352,
    "type": "flow",
    "index": 0,
    "data": {
        "final": true,
        "id": null,
        "response_create_time": "2024-10-28 15:04",
        "response_create_time_timestamp": "1730099068259",
        "response_update_time": "2024-10-28 15:04",
        "response_update_time_timestamp": "1730099068259",
        "flow_uuid": "bfa90c48-91d8-11ef-8a93-e4434b3011a0",
        "history": [
            {
                "timestamp": 1730099068796,
                "time_date": "20241028150428796289",
                "node_id": "24e67700-ae1d-4f03-b5ef-609a23e0c7e5",
                "robot_user_replying": "Please enter the game you want to query",
                "robot_user_asking": "",
                "user_robot_replying": ""
            }
        ],
        "output": {
            "inputs": {},
            "variables": {},
            "entities": {},
            "robot_user_asking": "",
            "user_robot_replying": "",
            "robot_user_replying": "Please enter the game you want to query"
        },
        "answer": "Please enter the game you want to query",
        "content_type": "text",
        "session_id": "df672ee6-94fa-11ef-8430-e4434b3011a0",
        "flow_stage": "flow_running",
        "code": "000000",
        "node_stream": 0,
        "target_node_id": "24e67700-ae1d-4f03-b5ef-609a23e0c7e5",
        "source_node_id": "24e67700-ae1d-4f03-b5ef-609a23e0c7e5",
        "cur_node_id": "24e67700-ae1d-4f03-b5ef-609a23e0c7e5",
        "node_id": "24e67700-ae1d-4f03-b5ef-609a23e0c7e5"
    },
    "finish": "y",
    "cur_node_id": "24e67700-ae1d-4f03-b5ef-609a23e0c7e5",
    "node_id": "24e67700-ae1d-4f03-b5ef-609a23e0c7e5",
    "debug": 0,
    "node_developer": 0,
    "flow_name": "Game Assistant 11",
    "node_type": "answer",
    "node_title": null
}

Example 4-Streaming Output 2

ask:

{
    "question": "Genshin Impact",
    "username": "kKp5xVJJ_Gx6ZG2vJSvkQ",
    "cybertron-robot-key": "St8EsOt*********xE9bMeKc=",
    "cybertron-robot-token": "MTczMDA5***************************************M2VMR3JJc1U9",
    "segment_code": "_wg7RYDBFtarIHV_b0an6"
}

response:

{
    "code": "400000",
    "message": "task send success,",
    "type": "json",
    "index": -2,
    "data": {
        "task_id": "ae3ccb1894fb11ef9f3de4434b3011a0"
    }
}
{
    "code": "400000",
    "message": "send question success",
    "index": -1,
    "type": "json",
    "data": {
        "question": "Genshin Impact",
        "dialog_id": "1850797208411308032",
        "id": "198790",
        "response_create_time": "2024-10-28 15:10",
        "response_create_time_timestamp": "1730099415291",
        "response_update_time": "2024-10-28 15:10",
        "response_update_time_timestamp": "1730099415291"
    }
}
{
    "flow_redis_key": "215kKp5xVJJ_Gx6ZG2vJSvkQ_wg7RYDBFtarIHV_b0an2",
    "code": "000000",
    "message": "success",
    "dialog_id": 1850797208411308032,
    "type": "flow",
    "index": 0,
    "data": {
        "final": true,
        "id": null,
        "response_create_time": "2024-10-28 15:10",
        "response_create_time_timestamp": "1730099415379",
        "response_update_time": "2024-10-28 15:10",
        "response_update_time_timestamp": "1730099415379",
        "flow_uuid": "bfa90c48-91d8-11ef-8a93-e4434b3011a0",
        "history": [
            {
                "timestamp": 1730099070616,
                "time_date": "20241028150430616346",
                "node_id": "24e67700-ae1d-4f03-b5ef-609a23e0c7e5",
                "robot_user_replying": "Please enter the game you want to query",
                "robot_user_asking": "",
                "user_robot_replying": ""
            },
            {
                "timestamp": 1730099320084,
                "time_date": "20241028150840084725",
                "node_id": "883cc5b6-55d2-4cb8-be94-de71fd6b93eb",
                "robot_user_replying": "",
                "robot_user_asking": "",
                "user_robot_replying": "Genshin Impact"
            }
        ],
        "output": {
            "inputs": {},
            "variables": {
                "play_name": "Genshin Impact"
            },
            "entities": {},
            "robot_user_asking": "",
            "user_robot_replying": "Genshin Impact",
            "robot_user_replying": ""
        },
        "answer": "exploration",
        "content_type": "text",
        "session_id": "df672ee6-94fa-11ef-8430-e4434b3011a0",
        "flow_stage": "flow_running",
        "code": "000000",
        "node_stream": 1,
        "target_node_id": "4b86d96a-9648-40ce-bcd3-b6dfaed132c6",
        "source_node_id": "883cc5b6-55d2-4cb8-be94-de71fd6b93eb",
        "cur_node_id": "4b86d96a-9648-40ce-bcd3-b6dfaed132c6",
        "node_id": "883cc5b6-55d2-4cb8-be94-de71fd6b93eb",
        "node_answer_index": 0,
        "node_answer_finish": "n"
    },
    "finish": "y",
    "cur_node_id": "4b86d96a-9648-40ce-bcd3-b6dfaed132c6",
    "node_id": "883cc5b6-55d2-4cb8-be94-de71fd6b93eb",
    "debug": 0,
    "node_developer": 0,
    "flow_name": "Game Assistant 11",
    "node_type": "llm",
    "node_title": null
}
{
    "flow_redis_key": "215kKp5xVJJ_Gx6ZG2vJSvkQ_wg7RYDBFtarIHV_b0an2",
    "code": "000000",
    "message": "success",
    "dialog_id": 1850797208411308032,
    "type": "flow",
    "index": 0,
    "data": {
        "final": true,
        "id": null,
        "response_create_time": "2024-10-28 15:10",
        "response_create_time_timestamp": "1730099415379",
        "response_update_time": "2024-10-28 15:10",
        "response_update_time_timestamp": "1730099415379",
        "flow_uuid": "bfa90c48-91d8-11ef-8a93-e4434b3011a0",
        "history": [
            {
                "timestamp": 1730099070616,
                "time_date": "20241028150430616346",
                "node_id": "24e67700-ae1d-4f03-b5ef-609a23e0c7e5",
                "robot_user_replying": "Please enter the game you want to query",
                "robot_user_asking": "",
                "user_robot_replying": ""
            },
            {
                "timestamp": 1730099320084,
                "time_date": "20241028150840084725",
                "node_id": "883cc5b6-55d2-4cb8-be94-de71fd6b93eb",
                "robot_user_replying": "",
                "robot_user_asking": "",
                "user_robot_replying": "Genshin Impact"
            }
        ],
        "output": {
            "inputs": {},
            "variables": {
                "play_name": "Genshin Impact"
            },
            "entities": {},
            "robot_user_asking": "",
            "user_robot_replying": "Genshin Impact",
            "robot_user_replying": ""
        },
        "answer": "open",
        "content_type": "text",
        "session_id": "df672ee6-94fa-11ef-8430-e4434b3011a0",
        "flow_stage": "flow_running",
        "code": "000000",
        "node_stream": 1,
        "target_node_id": "4b86d96a-9648-40ce-bcd3-b6dfaed132c6",
        "source_node_id": "883cc5b6-55d2-4cb8-be94-de71fd6b93eb",
        "cur_node_id": "4b86d96a-9648-40ce-bcd3-b6dfaed132c6",
        "node_id": "883cc5b6-55d2-4cb8-be94-de71fd6b93eb",
        "node_answer_index": 1,
        "node_answer_finish": "n"
    },
    "finish": "y",
    "cur_node_id": "4b86d96a-9648-40ce-bcd3-b6dfaed132c6",
    "node_id": "883cc5b6-55d2-4cb8-be94-de71fd6b93eb",
    "debug": 0,
    "node_developer": 0,
    "flow_name": "Game Assistant 11",
    "node_type": "llm",
    "node_title": null
}
{
    "flow_redis_key": "215kKp5xVJJ_Gx6ZG2vJSvkQ_wg7RYDBFtarIHV_b0an2",
    "code": "000000",
    "message": "success",
    "dialog_id": 1850797208411308032,
    "type": "flow",
    "index": 0,
    "data": {
        "final": true,
        "id": null,
        "response_create_time": "2024-10-28 15:10",
        "response_create_time_timestamp": "1730099415379",
        "response_update_time": "2024-10-28 15:10",
        "response_update_time_timestamp": "1730099415379",
        "flow_uuid": "bfa90c48-91d8-11ef-8a93-e4434b3011a0",
        "history": [
            {
                "timestamp": 1730099070616,
                "time_date": "20241028150430616346",
                "node_id": "24e67700-ae1d-4f03-b5ef-609a23e0c7e5",
                "robot_user_replying": "Please enter the game you want to query",
                "robot_user_asking": "",
                "user_robot_replying": ""
            },
            {
                "timestamp": 1730099320084,
                "time_date": "20241028150840084725",
                "node_id": "883cc5b6-55d2-4cb8-be94-de71fd6b93eb",
                "robot_user_replying": "",
                "robot_user_asking": "",
                "user_robot_replying": "Genshin Impact"
            }
        ],
        "output": {
            "inputs": {},
            "variables": {
                "play_name": "Genshin Impact"
            },
            "entities": {},
            "robot_user_asking": "",
            "user_robot_replying": "Genshin Impact",
            "robot_user_replying": ""
        },
        "answer": "world",
        "content_type": "text",
        "session_id": "df672ee6-94fa-11ef-8430-e4434b3011a0",
        "flow_stage": "flow_running",
        "code": "000000",
        "node_stream": 1,
        "target_node_id": "4b86d96a-9648-40ce-bcd3-b6dfaed132c6",
        "source_node_id": "883cc5b6-55d2-4cb8-be94-de71fd6b93eb",
        "cur_node_id": "4b86d96a-9648-40ce-bcd3-b6dfaed132c6",
        "node_id": "883cc5b6-55d2-4cb8-be94-de71fd6b93eb",
        "node_answer_index": 2,
        "node_answer_finish": "n"
    },
    "finish": "y",
    "cur_node_id": "4b86d96a-9648-40ce-bcd3-b6dfaed132c6",
    "node_id": "883cc5b6-55d2-4cb8-be94-de71fd6b93eb",
    "debug": 0,
    "node_developer": 0,
    "flow_name": "Game Assistant 11",
    "node_type": "llm",
    "node_title": null
}
{
    "flow_redis_key": "215kKp5xVJJ_Gx6ZG2vJSvkQ_wg7RYDBFtarIHV_b0an2",
    "code": "000000",
    "message": "success",
    "dialog_id": 1850797208411308032,
    "type": "flow",
    "index": 0,
    "data": {
        "final": true,
        "id": null,
        "response_create_time": "2024-10-28 15:10",
        "response_create_time_timestamp": "1730099415379",
        "response_update_time": "2024-10-28 15:10",
        "response_update_time_timestamp": "1730099415379",
        "flow_uuid": "bfa90c48-91d8-11ef-8a93-e4434b3011a0",
        "history": [
            {
                "timestamp": 1730099070616,
                "time_date": "20241028150430616346",
                "node_id": "24e67700-ae1d-4f03-b5ef-609a23e0c7e5",
                "robot_user_replying": "Please enter the game you want to query",
                "robot_user_asking": "",
                "user_robot_replying": ""
            },
            {
                "timestamp": 1730099320084,
                "time_date": "20241028150840084725",
                "node_id": "883cc5b6-55d2-4cb8-be94-de71fd6b93eb",
                "robot_user_replying": "",
                "robot_user_asking": "",
                "user_robot_replying": "Genshin Impact"
            }
        ],
        "output": {
            "inputs": {},
            "variables": {
                "play_name": "Genshin Impact"
            },
            "entities": {},
            "robot_user_asking": "",
            "user_robot_replying": "Genshin Impact",
            "robot_user_replying": ""
        },
        "answer": ",",
        "content_type": "text",
        "session_id": "df672ee6-94fa-11ef-8430-e4434b3011a0",
        "flow_stage": "flow_running",
        "code": "000000",
        "node_stream": 1,
        "target_node_id": "4b86d96a-9648-40ce-bcd3-b6dfaed132c6",
        "source_node_id": "883cc5b6-55d2-4cb8-be94-de71fd6b93eb",
        "cur_node_id": "4b86d96a-9648-40ce-bcd3-b6dfaed132c6",
        "node_id": "883cc5b6-55d2-4cb8-be94-de71fd6b93eb",
        "node_answer_index": 3,
        "node_answer_finish": "n"
    },
    "finish": "y",
    "cur_node_id": "4b86d96a-9648-40ce-bcd3-b6dfaed132c6",
    "node_id": "883cc5b6-55d2-4cb8-be94-de71fd6b93eb",
    "debug": 0,
    "node_developer": 0,
    "flow_name": "Game Assistant 11",
    "node_type": "llm",
    "node_title": null
}
{
    "flow_redis_key": "215kKp5xVJJ_Gx6ZG2vJSvkQ_wg7RYDBFtarIHV_b0an2",
    "code": "000000",
    "message": "success",
    "dialog_id": 1850797208411308032,
    "type": "flow",
    "index": 0,
    "data": {
        "final": true,
        "id": null,
        "response_create_time": "2024-10-28 15:10",
        "response_create_time_timestamp": "1730099415379",
        "response_update_time": "2024-10-28 15:10",
        "response_update_time_timestamp": "1730099415379",
        "flow_uuid": "bfa90c48-91d8-11ef-8a93-e4434b3011a0",
        "history": [
            {
                "timestamp": 1730099070616,
                "time_date": "20241028150430616346",
                "node_id": "24e67700-ae1d-4f03-b5ef-609a23e0c7e5",
                "robot_user_replying": "Please enter the game you want to query",
                "robot_user_asking": "",
                "user_robot_replying": ""
            },
            {
                "timestamp": 1730099320084,
                "time_date": "20241028150840084725",
                "node_id": "883cc5b6-55d2-4cb8-be94-de71fd6b93eb",
                "robot_user_replying": "",
                "robot_user_asking": "",
                "user_robot_replying": "Genshin Impact"
            }
        ],
        "output": {
            "inputs": {},
            "variables": {
                "play_name": "Genshin Impact"
            },
            "entities": {},
            "robot_user_asking": "",
            "user_robot_replying": "Genshin Impact",
            "robot_user_replying": ""
        },
        "answer": "Challenge element response.",
        "content_type": "text",
        "session_id": "df672ee6-94fa-11ef-8430-e4434b3011a0",
        "flow_stage": "flow_running",
        "code": "000000",
        "node_stream": 1,
        "target_node_id": "4b86d96a-9648-40ce-bcd3-b6dfaed132c6",
        "source_node_id": "883cc5b6-55d2-4cb8-be94-de71fd6b93eb",
        "cur_node_id": "4b86d96a-9648-40ce-bcd3-b6dfaed132c6",
        "node_id": "883cc5b6-55d2-4cb8-be94-de71fd6b93eb",
        "node_answer_index": 4,
        "node_answer_finish": "n"
    },
    "finish": "y",
    "cur_node_id": "4b86d96a-9648-40ce-bcd3-b6dfaed132c6",
    "node_id": "883cc5b6-55d2-4cb8-be94-de71fd6b93eb",
    "debug": 0,
    "node_developer": 0,
    "flow_name": "Game Assistant 11",
    "node_type": "llm",
    "node_title": null
}
{
    "flow_redis_key": "215kKp5xVJJ_Gx6ZG2vJSvkQ_wg7RYDBFtarIHV_b0an2",
    "code": "000000",
    "message": "success",
    "dialog_id": 1850797208411308032,
    "type": "flow",
    "index": 0,
    "data": {
        "final": true,
        "id": null,
        "response_create_time": "2024-10-28 15:10",
        "response_create_time_timestamp": "1730099415379",
        "response_update_time": "2024-10-28 15:10",
        "response_update_time_timestamp": "1730099415379",
        "flow_uuid": "bfa90c48-91d8-11ef-8a93-e4434b3011a0",
        "history": [
            {
                "timestamp": 1730099070616,
                "time_date": "20241028150430616346",
                "node_id": "24e67700-ae1d-4f03-b5ef-609a23e0c7e5",
                "robot_user_replying": "Please enter the game you want to query",
                "robot_user_asking": "",
                "user_robot_replying": ""
            },
            {
                "timestamp": 1730099320084,
                "time_date": "20241028150840084725",
                "node_id": "883cc5b6-55d2-4cb8-be94-de71fd6b93eb",
                "robot_user_replying": "",
                "robot_user_asking": "",
                "user_robot_replying": "Genshin Impact"
            }
        ],
        "output": {
            "inputs": {},
            "variables": {
                "play_name": "Genshin Impact"
            },
            "entities": {},
            "robot_user_asking": "",
            "user_robot_replying": "Genshin Impact",
            "robot_user_replying": ""
        },
        "answer": "Explore the open world and challenge elemental responses.",
        "content_type": "text",
        "session_id": "df672ee6-94fa-11ef-8430-e4434b3011a0",
        "flow_stage": "flow_running",
        "code": "000000",
        "node_stream": 1,
        "target_node_id": "4b86d96a-9648-40ce-bcd3-b6dfaed132c6",
        "source_node_id": "883cc5b6-55d2-4cb8-be94-de71fd6b93eb",
        "cur_node_id": "4b86d96a-9648-40ce-bcd3-b6dfaed132c6",
        "node_id": "883cc5b6-55d2-4cb8-be94-de71fd6b93eb",
        "node_answer_index": 5,
        "node_answer_finish": "y"
    },
    "finish": "y",
    "cur_node_id": "4b86d96a-9648-40ce-bcd3-b6dfaed132c6",
    "node_id": "883cc5b6-55d2-4cb8-be94-de71fd6b93eb",
    "debug": 0,
    "node_developer": 0,
    "flow_name": "Game Assistant 11",
    "node_type": "llm",
    "node_title": null
}
{
    "flow_redis_key": "215kKp5xVJJ_Gx6ZG2vJSvkQ_wg7RYDBFtarIHV_b0an2",
    "code": "000000",
    "message": "success",
    "dialog_id": 1850797208411308032,
    "type": "flow",
    "index": 0,
    "data": {
        "final": true,
        "id": null,
        "response_create_time": "2024-10-28 15:10",
        "response_create_time_timestamp": "1730099415379",
        "response_update_time": "2024-10-28 15:10",
        "response_update_time_timestamp": "1730099415379",
        "flow_uuid": "bfa90c48-91d8-11ef-8a93-e4434b3011a0",
        "history": [
            {
                "timestamp": 1730099070616,
                "time_date": "20241028150430616346",
                "node_id": "24e67700-ae1d-4f03-b5ef-609a23e0c7e5",
                "robot_user_replying": "Please enter the game you want to query",
                "robot_user_asking": "",
                "user_robot_replying": ""
            },
            {
                "timestamp": 1730099320084,
                "time_date": "20241028150840084725",
                "node_id": "883cc5b6-55d2-4cb8-be94-de71fd6b93eb",
                "robot_user_replying": "",
                "robot_user_asking": "",
                "user_robot_replying": "Genshin Impact"
            },
            {
                "timestamp": 1730099418660,
                "time_date": "20241028151018660446",
                "node_id": "4b86d96a-9648-40ce-bcd3-b6dfaed132c6",
                "robot_user_replying": "Explore the open world and challenge elemental responses.",
                "robot_user_asking": "",
                "user_robot_replying": "Genshin Impact"
            },
            {
                "timestamp": 1730099418675,
                "time_date": "20241028151018675868",
                "node_id": "ba34c2eb-8de0-4edd-9e7b-63e23179188b",
                "robot_user_replying": "Is the output content satisfactory?",
                "robot_user_asking": "",
                "user_robot_replying": "Genshin Impact"
            }
        ],
        "output": {
            "inputs": {},
            "variables": {
                "play_name": "Genshin Impact"
            },
            "entities": {},
            "robot_user_asking": "",
            "user_robot_replying": "Genshin Impact",
            "robot_user_replying": "Is the output content satisfactory"
        },
        "answer": "Is the output content satisfactory?",
        "content_type": "text",
        "session_id": "df672ee6-94fa-11ef-8430-e4434b3011a0",
        "flow_stage": "flow_running",
        "code": "000000",
        "node_stream": 0,
        "target_node_id": "ba34c2eb-8de0-4edd-9e7b-63e23179188b",
        "source_node_id": "ba34c2eb-8de0-4edd-9e7b-63e23179188b",
        "cur_node_id": "ba34c2eb-8de0-4edd-9e7b-63e23179188b",
        "node_id": "ba34c2eb-8de0-4edd-9e7b-63e23179188b",
        "node_answer_index": 5,
        "node_answer_finish": "y"
    },
    "finish": "y",
    "cur_node_id": "ba34c2eb-8de0-4edd-9e7b-63e23179188b",
    "node_id": "ba34c2eb-8de0-4edd-9e7b-63e23179188b",
    "debug": 0,
    "node_developer": 0,
    "flow_name": "Game Assistant 11",
    "node_type": "answer",
    "node_title": null
}
{
    "code": "400000",
    "message": "success",
    "dialog_id": 1850797208411308032,
    "type": "flow",
    "index": 0,
    "data": null,
    "finish": "y"
}

Example 5 - Plugin - markdown

ask:

{
    "question": "the weather info of beijing",
    "username": "testuser",
    "cybertron-robot-key": "PL1qFV************ lhkA0NSPo=",
    "cybertron-robot-token": "MTcwMjg3*********************************************dWJ3ckd1ODQ9",
    "segment_code": "wWkE3bNkL3SzJX9orcO9P"
}

response:

{
    "code": "000000",
    "message": "send question success",
    "index": -1,
    "type": "json",
    "data": {
        "question": "the weather info of beijing",
        "dialog_id": "1745083757851394048"
    }
}
{
    "code": "000000",
    "message": "success",
    "dialog_id": "1745083757851394048",
    "type": "json",
    "index": 0,
    "data": {
        "type": "json",
        "answer": {
            "type": "markdown",
            "data": "| Weather               | Details            |\n|:----------------------|:-------------------|\n| Daytime weather       | Clear              |\n| Nighttime weather     | Clear              |\n| Daytime temperature   | 5 degrees Celsius  |\n| Nighttime temperature | -7 degrees Celsius |\n| Wind force            | 1-3 level          |\n| Date                  | 2024-01-10         |",
            "raw_data": {
                "raw": {
                    "Daytime weather": "Clear",
                    "Nighttime weather": "Clear",
                    "Daytime temperature": "5 degrees Celsius",
                    "Nighttime temperature": "-7 degrees Celsius",
                    "Wind force": "1-3 level",
                    "Date": "2024-01-10"
                },
                "markdown": "| Weather               | Details            |\n|:----------------------|:-------------------|\n| Daytime weather       | Clear              |\n| Nighttime weather     | Clear              |\n| Daytime temperature   | 5 degrees Celsius  |\n| Nighttime temperature | -7 degrees Celsius |\n| Wind force            | 1-3 level          |\n| Date                  | 2024-01-10         |",
                "type": "markdown",
                "desc": "According to the weather forecast, 2024-01-10, Beijing, the weather conditions are as follows: \n- Daytime weather: Clear\n- Nighttime weather: Clear\n- Daytime temperature: 5 degrees Celsius\n- Nighttime temperature: -7 degrees Celsius\n- Wind force: 1-3 level\n\nPlease plan your activities accordingly. Pay attention to add clothes when necessary. If you have any other questions, I'm here to assist you."
            },
            "description": "According to the weather forecast, 2024-01-10, Beijing, the weather conditions are as follows: \n- Daytime weather: Clear\n- Nighttime weather: Clear\n- Daytime temperature: 5 degrees Celsius\n- Nighttime temperature: -7 degrees Celsius\n- Wind force: 1-3 level\n\nPlease plan your activities accordingly. Pay attention to add clothes when necessary. If you have any other questions, I'm here to assist you."
        }
    },
    "finish": "n"
}
{
    "code": "000000",
    "message": "success",
    "dialog_id": "1745083757851394048",
    "type": "json",
    "index": 1,
    "data": {
        "type": "json",
        "answer": {
            "type": "markdown",
            "data": "| Weather               | Details            |\n|:----------------------|:-------------------|\n| Daytime weather       | Clear              |\n| Nighttime weather     | Clear              |\n| Daytime temperature   | 5 degrees Celsius  |\n| Nighttime temperature | -7 degrees Celsius |\n| Wind force            | 1-3 level          |\n| Date                  | 2024-01-10         |",
            "raw_data": {
                "raw": {
                    "Daytime weather": "Clear",
                    "Nighttime weather": "Clear",
                    "Daytime temperature": "5 degrees Celsius",
                    "Nighttime temperature": "-7 degrees Celsius",
                    "Wind force": "1-3 level",
                    "Date": "2024-01-10"
                },
                "markdown": "| Weather               | Details            |\n|:----------------------|:-------------------|\n| Daytime weather       | Clear              |\n| Nighttime weather     | Clear              |\n| Daytime temperature   | 5 degrees Celsius  |\n| Nighttime temperature | -7 degrees Celsius |\n| Wind force            | 1-3 level          |\n| Date                  | 2024-01-10         |",
                "type": "markdown",
                "desc": "According to the weather forecast, 2024-01-10, Beijing, the weather conditions are as follows: \n- Daytime weather: Clear\n- Nighttime weather: Clear\n- Daytime temperature: 5 degrees Celsius\n- Nighttime temperature: -7 degrees Celsius\n- Wind force: 1-3 level\n\nPlease plan your activities accordingly. Pay attention to add clothes when necessary. If you have any other questions, I'm here to assist you."
            },
            "description": "According to the weather forecast, 2024-01-10, Beijing, the weather conditions are as follows: \n- Daytime weather: Clear\n- Nighttime weather: Clear\n- Daytime temperature: 5 degrees Celsius\n- Nighttime temperature: -7 degrees Celsius\n- Wind force: 1-3 level\n\nPlease plan your activities accordingly. Pay attention to add clothes when necessary. If you have any other questions, I'm here to assist you."
        }
    },
    "finish": "y"
}

Example 6 - Plugin - Chart

ask:

{
    "question": "Doll company website user data details",
    "username": "testuser",
    "cybertron-robot-key": "PL1qFV************ lhkA0NSPo=",
    "cybertron-robot-token": "MTcwMjg3*********************************************dWJ3ckd1ODQ9",
    "segment_code": "wWkE3bNkL3SzJX9orcO9P"
}

response:

{
    "code": "000000",
    "message": "send question success",
    "index": -1,
    "type": "json",
    "data": {
        "question": "Doll company website user data details",
        "dialog_id": "1745085048405180416"
    }
}
{
    "code": "000000",
    "message": "success",
    "dialog_id": "1745085048405180416",
    "type": "json",
    "index": 0,
    "data": {
        "type": "json",
        "answer": {
            "type": "markdown",
            "data": "| Date | Registered User | Paid User |\n|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |",
            "raw_data": {
                "data": [
                    {
                        "Date": "2024-01-04",
                        "Registered User": 508,
                        "Paid User": 360
                    },
                    {
                        "Date": "2024-01-05",
                        "Registered User": 769,
                        "Paid User": 645
                    },
                    {
                        "Date": "2024-01-06",
                        "Registered User": 723,
                        "Paid User": 432
                    },
                    {
                        "Date": "2024-01-07",
                        "Registered User": 156,
                        "Paid User": 139
                    },
                    {
                        "Date": "2024-01-08",
                        "Registered User": 183,
                        "Paid User": 102
                    },
                    {
                        "Date": "2024-01-09",
                        "Registered User": 882,
                        "Paid User": 414
                    },
                    {
                        "Date": "2024-01-10",
                        "Registered User": 733,
                        "Paid User": 220
                    }
                ],
                "raw": [
                    {
                        "Date": "2024-01-04",
                        "Registered User": 508,
                        "Paid User": 360
                    },
                    {
                        "Date": "2024-01-05",
                        "Registered User": 769,
                        "Paid User": 645
                    },
                    {
                        "Date": "2024-01-06",
                        "Registered User": 723,
                        "Paid User": 432
                    },
                    {
                        "Date": "2024-01-07",
                        "Registered User": 156,
                        "Paid User": 139
                    },
                    {
                        "Date": "2024-01-08",
                        "Registered User": 183,
                        "Paid User": 102
                    },
                    {
                        "Date": "2024-01-09",
                        "Registered User": 882,
                        "Paid User": 414
                    },
                    {
                        "Date": "2024-01-10",
                        "Registered User": 733,
                        "Paid User": 220
                    }
                ],
                "markdown": "| Date | Registered User | Paid User |\n|:------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 360 |",
                "field_headers": [
                    "date",
                    "Registered User",
                    "Paid User"
                ],
                "chart_type": "bar",
                "type": "chart",
                "dimension": "date",
                "desc": "According to the query, the number of registered users has been 733, 882, and 183 respectively, and the number of paid users is 220, 414, and 102 respectively. If there are any other questions, I can continue to help you."
            },
            "description": "According to the query, the number of registered users has been 733, 882, and 183, respectively, and the number of paid users is 220, 414, and 102, respectively. If there are any other questions, I can continue to help you."
        }
    },
    "finish": "n"
}
{
    "code": "000000",
    "message": "success",
    "dialog_id": "1745085048405180416",
    "type": "json",
    "index": 1,
    "data": {
        "type": "json",
        "answer": {
            "type": "markdown",
            "data": "| Date | Registered User | Paid User |\n|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |",
            "raw_data": {
                "data": [
                    {
                        "Date": "2024-01-04",
                        "Registered User": 508,
                        "Paid User": 360
                    },
                    {
                        "Date": "2024-01-05",
                        "Registered User": 769,
                        "Paid User": 645
                    },
                    {
                        "Date": "2024-01-06",
                        "Registered User": 723,
                        "Paid User": 432
                    },
                    {
                        "Date": "2024-01-07",
                        "Registered User": 156,
                        "Paid User": 139
                    },
                    {
                        "Date": "2024-01-08",
                        "Registered User": 183,
                        "Paid User": 102
                    },
                    {
                        "Date": "2024-01-09",
                        "Registered User": 882,
                        "Paid User": 414
                    },
                    {
                        "Date": "2024-01-10",
                        "Registered User": 733,
                        "Paid User": 220
                    }
                ],
                "raw": [
                    {
                        "Date": "2024-01-04",
                        "Registered User": 508,
                        "Paid User": 360
                    },
                    {
                        "Date": "2024-01-05",
                        "Registered User": 769,
                        "Paid User": 645
                    },
                    {
                        "Date": "2024-01-06",
                        "Registered User": 723,
                        "Paid User": 432
                    },
                    {
                        "Date": "2024-01-07",
                        "Registered User": 156,
                        "Paid User": 139
                    },
                    {
                        "Date": "2024-01-08",
                        "Registered User": 183,
                        "Paid User": 102
                    },
                    {
                        "Date": "2024-01-09",
                        "Registered User": 882,
                        "Paid User": 414
                    },
                    {
                        "Date": "2024-01-10",
                        "Registered User": 733,
                        "Paid User": 220
                    }
                ],
                "markdown": "| Date | Registered User | Paid User |\n|:------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 360 |",
                "field_headers": [
                    "date",
                    "Registered User",
                    "Paid User"
                ],
                "chart_type": "bar",
                "type": "chart",
                "dimension": "date",
                "desc": "According to the query, the number of registered users has been 733, 882, and 183 respectively, and the number of paid users is 220, 414, and 102 respectively. If there are any other questions, I can continue to help you."
            },
            "description": "According to the query, the number of registered users has been 733, 882, and 183, respectively, and the number of paid users is 220, 414, and 102, respectively. If there are any other questions, I can continue to help you."
        }
    },
    "finish": "y"
}

Example 7 - Plugin - Internet search, knowledge base image (since: v1.4.0)

ask:

{
    "question": "The latest news in Beijing, where is Beijing?",
    "username": "me@host.com",
    "cybertron-robot-key": "dlaJconh*********iZCR4w%3D",
    "cybertron-robot-token": "MTcxMjEwO*********************************klBMmFpUFZ0T1U9",
    "segment_code": "-rohx1iD39tOpWeJF3vUy"
}

response:

{
    "code": "000000",
    "message": "task send success,",
    "type": "json",
    "index": -2,
    "data": {
        "task_id": "520202d82af911ef8ddc2800af4a2ec9"
    }
}
{
    "code": "000000",
    "message": "send question success",
    "index": -1,
    "type": "json",
    "data": {
    "question": "The latest news in Beijing, where is Beijing?",
        "dialog_id": "1801909085148839936"
    }
}
{
    "code": "000000",
    "message": "success",
    "dialog_id": "1801909085148839936",
    "type": "online_search",
    "index": -3,
    "data": {
        "index": 0,
        "type": "online_search",
        "answer": {
            "title": "Xinhuanet Beijing Channel_Beijing News_Capital",
            "href": "http://www.bj.xinhuanet.com/",
            "body": "Xinhua News Agency reporters look at Beijing more. \"South Water\" enters Beijing to 10 billion cubic meters. Beijing cracks down on more than 9,000 illegal and irregular \"self-media\" accounts. Beijing: Stay at work under high temperatures. Beijing will conduct joint inspections on high temperature operations. \"Traditional Medicine + AI\" Tsinghua University Li Shao's team won the highest award for the Geneva International Invention Exhibition. Beijing received 7.792 million tourists during the Dragon Boat Festival holiday..."
        },
        "online_search_info": {
            "avatar": "api/media/file/image/avatar/online_search.png",
            "plugin_name": "Internet search",
            "name": "text_search",
            "status": "success"
        }
    },
    "finish": "n"
}
{
    "code": "000000",
    "message": "success",
    "dialog_id": "1801909085148839936",
    "type": "online_search",
    "index": -3,
    "data": {
        "index": 1,
        "type": "online_search",
        "answer": {
            "title": "The latest news about the new coronavirus in Beijing_Beijing local cases | risk level | nucleic acid testing | isolation - Beijing local treasure",
            "href": "http://m.bj.bendibao.com/news/xinxingfeiyan/",
            "body": "Sometimes I shop at Jiajiafu Life Supermarket (Majialou Store) and eat at Jinhanzi Noodle Restaurant near my residence. On the morning of January 19, I bought food at the Chuyuanjia Service Department, and at Jiajiafu Life Supermarket (Majialou Store) at noon and evening. I did not go out again after returning home. The report on the same day was negative. The report on January 22 was negative. The report on January 23 was positive."
        },
        "online_search_info": {
            "avatar": "api/media/file/image/avatar/online_search.png",
            "plugin_name": "Internet search",
            "name": "text_search",
            "status": "success"
        }
    },
    "finish": "n"
}
{
    "code": "000000",
    "message": "success",
    "dialog_id": "1801909085148839936",
    "type": "online_search",
    "index": -3,
    "data": {
        "index": 2,
        "type": "online_search",
        "answer": {
            "title": "Xinhuanet Beijing Channel_Beijing News_Capital",
            "href": "http://bj.news.cn/",
            "body": "Beijing News More. The passenger flow in key business districts in Beijing during the Dragon Boat Festival holiday exceeded 20 million. During the Dragon Boat Festival holiday, Beijing municipal parks welcomed 1.24 million visitors. Beijing: How did the Summer Palace Temple of Heaven Zoo become the \"top stream\". Beijing: The orange warning of high temperature is released. Tomorrow, 38℃ will be hit. 1mm precise control creates robot \"hands\". The 114 appointment registration platform covers 290 hospitals. Beijing: Last year..."
        },
        "online_search_info": {
            "avatar": "api/media/file/image/avatar/online_search.png",
            "plugin_name": "Internet search",
            "name": "text_search",
            "status": "success"
        }
    },
    "finish": "n"
}
{
    "code": "000000",
    "message": "success",
    "dialog_id": "1801909085148839936",
    "type": "string",
    "index": 0,
    "data": "Beijing",
    "finish": "n"
}
{
    "code": "000000",
    "message": "success",
    "dialog_id": "1801909085148839936",
    "type": "string",
    "index": 1,
    "data": "Yes",
    "finish": "n"
}
// ...
{
    "code": "000000",
    "message": "success",
    "dialog_id": "1801909085148839936",
    "type": "string",
    "index": 66,
    "data": ".",
    "finish": "n"
}
{
    "code": "000000",
    "message": "success",
    "dialog_id": "1801909085148839936",
    "type": "images",
    "index": -4,
    "data": {
        "index": 0,
        "type": "images",
        "answer": "https://bucket1.some-host.com/api/app/cybertron/knowledge_file/image/knowledge/qa_img/1718088783776a6e19-8cb2-4551-b3a5-7500e723f24dBeijing 2.jpg"
    },
    "finish": "n"
}
{
    "code": "000000",
    "message": "success",
    "dialog_id": "1801909085148839936",
    "type": "images",
    "index": -4,
    "data": {
        "index": 1,
        "type": "images",
        "answer": "https://bucket1.some-host.com/api/app/cybertron/knowledge_file/image/knowledge/qa_img/17180887862cd0cce0-937f-49c0-bf93-89775d53c1bfBeijing 1.jpeg"
    },
    "finish": "n"
}
{
    "code": "000000",
    "message": "success",
    "dialog_id": "1801909085148839936",
    "type": "json",
    "index": 67,
    "data": {
        "type": "json",
        "answer": {
            "type": "online_search|image",
            "online_search": [
                {
                    "title": "Xinhuanet Beijing Channel_Beijing News_Capital",
                    "href": "http://www.bj.xinhuanet.com/",
                    "body": "Xinhua News Agency reporters look at Beijing more. \"South Water\" enters Beijing to 10 billion cubic meters. Beijing cracks down on more than 9,000 illegal and irregular \"self-media\" accounts. Beijing: Stay at work under high temperatures. Beijing will conduct joint inspections on high temperature operations. \"Traditional Medicine + AI\" Tsinghua University Li Shao's team won the highest award for the Geneva International Invention Exhibition. Beijing received 7.792 million tourists during the Dragon Boat Festival holiday..."
                },
                {
                    "title": "The latest news about the new coronavirus in Beijing_Beijing local cases | risk level | nucleic acid testing | isolation - Beijing local treasure",
                    "href": "http://m.bj.bendibao.com/news/xinxingfeiyan/",
                    "body": "Sometimes I shop at Jiajiafu Life Supermarket (Majialou Store) and eat at Jinhanzi Noodle Restaurant near my residence. On the morning of January 19, I bought food at the Chuyuanjia Service Department, and at Jiajiafu Life Supermarket (Majialou Store) at noon and evening. I did not go out again after returning home. The report on the same day was negative. The report on January 22 was negative. The report on January 23 was positive."
                },
                {
                    "title": "Xinhuanet Beijing Channel_Beijing News_Capital",
                    "href": "http://bj.news.cn/",
                    "body": "Beijing News More. The passenger flow in key business districts in Beijing during the Dragon Boat Festival holiday exceeded 20 million. During the Dragon Boat Festival holiday, Beijing municipal parks welcomed 1.24 million visitors. Beijing: How did the Summer Palace Temple of Heaven Zoo become the \"top stream\". Beijing: The orange warning of high temperature is released. Tomorrow, 38℃ will be hit. 1mm precise control creates robot \"hands\". The 114 appointment registration platform covers 290 hospitals. Beijing: Last year..."
                }
            ],
            "description": "Beijing is the capital of China, located in North China, with geographical coordinates of 116.4074 degrees east longitude and 39.9042 degrees north latitude. If you want to know the latest news about Beijing, please browse relevant news websites or use news mobile applications to obtain the latest information.",
            "image": [
                "https://bucket1.some-host.com/api/app/cybertron/knowledge_file/image/knowledge/qa_img/1718088783776a6e19-8cb2-4551-b3a5-7500e723f24dBeijing 2.jpg",
                "https://bucket1.some-host.com/api/app/cybertron/knowledge_file/image/knowledge/qa_img/17180887862cd0cce0-937f-49c0-bf93-89775d53c1bf Beijing 1.jpeg"
            ],
            "online_search_info": {
                "avatar": "api/media/file/image/avatar/online_search.png",
                "plugin_name": "Internet search",
                "name": "text_search",
                "status": "success"
            }
        }
    },
    "finish": "y"
}