Appends multimodal or complex JSON messages. Supports sending images, specifying Roles (e.g., tool/user/assistant), and injecting tool execution results.
tool_calls.
void LiteRtLm_AppendMessageJson(void* conv_ptr, const char* json_msg);
| Parameter | Responsibility |
|---|---|
conv_ptr |
Valid Session handle. |
json_msg |
JSON message string compliant with OpenAI format. Example: {"role": "user", "content": [...]}
|
const char* ImageJson =
"{"
" \"role\": \"user\","
" \"content\": ["
" {\"type\": \"text\", \"text\": \"Analyze the objects in this image\"},"
" {\"type\": \"image_url\", \"image_url\": {\"url\": \"data:image/jpeg;base64,...\"}}"
" ]"
"}";
LiteRtLm_AppendMessageJson(MyConv, ImageJson);