EN 中文
Back to Overview

LiteRtLm_AppendUserMessage

Appends plain text user messages. Updates the Session state to "Waiting for Response".

01. Message Enqueue Logic

graph TD Input[User Text] -->|Append| History[Session History List] History -->|State| Pending[Wait for RunInference]

This function is only responsible for synchronizing text to the Session's internal buffer. To obtain an AI response, LiteRtLm_RunInference must be explicitly called after appending the message.

02. Parameter Definitions

void LiteRtLm_AppendUserMessage(void* conv_ptr, const char* text);
ParameterResponsibility
conv_ptr Valid Session handle.
text User input plain text content.

03. Simple Interaction Code

// 1. Append user message
LiteRtLm_AppendUserMessage(MyConv, "Tell me about Unreal Engine 5.");

// 2. Trigger Inference (next steps)
LiteRtLm_RunInference(MyConv, MySamplingParams, MyCallback, NULL);