Skip to main content

Chatbot UI

ai_ui_chat_chatbot is a simple chatbot UI for the TuyaOpen AI framework. It shows one message at a time, centered on the screen — the current AI reply or status — rather than a scrolling history. It implements the ai_ui_manage interface, so once registered it renders the chat messages, emotions, and status the framework dispatches.

When to choose it

Choose the Chatbot UI when you want a clean, focused display that shows only the latest message — a kiosk, a toy, or any product where one centered line of text is clearer than a full chat thread. For a scrolling bubble conversation on a color LCD use the WeChat-style UI; for a small monochrome screen use the OLED UI.

Enable it

Register the style, then initialize the UI module. Registration runs first because ai_ui_init() invokes the style's disp_init callback:

#include "ai_ui_chat_chatbot.h"
#include "ai_ui_manage.h"

// Register the Chatbot UI, then initialize the UI module.
ai_ui_chat_chatbot_register();
ai_ui_init();

ai_ui_chat_chatbot_register() returns OPERATE_RET (OPRT_OK on success). It is the only function this style exposes — after it runs, you drive the screen entirely through ai_ui_manage.

note

Register exactly one UI style before calling ai_ui_init(). After initialization, send messages with ai_ui_disp_msg() — see UI Management.

See also