Count Core Data of Chat History

Last Updated on : 2026-03-30 06:51:56Copy for LLMView as MarkdownDownload PDF

Based on the device ID, count the core data of the chat history (T+1), returning a list by day.

API address

GET: /v1.0/cloud/agent/ai/chat/b/devices/{device_id}/statistical-data-history

Request parameter

Parameter nameTypeINRequiredDescription
device_idStringpathtrueThe ID of the specified device.

Description of body

Parameter nameTypeINRequiredDescription
start_timeStringbodytrueThe start date.
end_timeStringbodytrueThe end date.

Return parameter

Parameter nameTypeDescription
chat_countIntegerThe number of chats.
chat_minutesIntegerThe total chat duration, in minutes.
dateStringThe date.
toolListThe number of times the tool has been invoked.
emotionListThe statistical result of emotions.

Description of emotion

Parameter nameTypeDescription
emotion_nameStringThe emotion name.
emotion_codeStringThe emotion code.
emotion_countIntegerThe number of times the emotion has been invoked.

Description of tool

Parameter nameTypeDescription
tool_nameStringThe skill name.
tool_codeStringThe skill code.
tool_countIntegerThe number of times the skill has been invoked.

Request example

GET: /v1.0/cloud/agent/ai/chat/b/devices/{device_id}/statistical-data-history
{
  "device_id": "6c3585ebfe301b40a8u***",
  "start_time": "20260324",
  "end_time": "20260325"
}

Return example

{
    "result": [
        {
            "date": "20260324",
            "chat_minutes": 5,
            "tool": [
                {
                    "tool_name": "Emotion",
                    "tool_count": 2,
                    "tool_code": "emo"
                },
                {
                    "tool_name": "Smart Home Skill v1.5",
                    "tool_count": 2,
                    "tool_code": "smart_home_v1.5"
                },
                {
                    "tool_name": "Intermediate State Response Skill",
                    "tool_count": 1,
                    "tool_code": "intermediate_reply"
                },
                {
                    "tool_name": "Calendar Skill",
                    "tool_count": 1,
                    "tool_code": "calendar"
                }
            ],
            "emotion": [
                {
                    "emotion_count": 1,
                    "emotion_code": "HAPPY"
                },
                {
                    "emotion_count": 1,
                    "emotion_code": "NEUTRAL"
                }
            ],
            "chat_count": 12
        },
        {
            "date": "20260325",
            "chat_minutes": 127,
            "tool": [
                {
                    "tool_name": "Emotion",
                    "tool_count": 43,
                    "tool_code": "emo"
                },
                {
                    "tool_name": "Intermediate State Response Skill",
                    "tool_count": 17,
                    "tool_code": "intermediate_reply"
                },
                {
                    "tool_name": "Play Control Skill",
                    "tool_count": 2,
                    "tool_code": "PlayControl"
                },
                {
                    "tool_name": "Calendar Skill",
                    "tool_count": 1,
                    "tool_code": "calendar"
                },
                {
                    "tool_count": 1,
                    "tool_code": "device_schedule_set"
                }
            ],
            "emotion": [
                {
                    "emotion_count": 28,
                    "emotion_code": "NEUTRAL"
                },
                {
                    "emotion_count": 10,
                    "emotion_code": "HAPPY"
                },
                {
                    "emotion_count": 2,
                    "emotion_code": "CONFUSED"
                },
                {
                    "emotion_count": 1,
                    "emotion_code": "THINKING"
                },
                {
                    "emotion_count": 1,
                    "emotion_code": "RELAXED"
                },
                {
                    "emotion_count": 1,
                    "emotion_code": "SAD"
                }
            ],
            "chat_count": 230
        }
    ],
    "t": 1753707608368,
    "success": true
}

Error code

For more information, see error code.