crooked-dawn-90821
10/29/2025, 3:11 PMtall-airline-16756
10/29/2025, 3:11 PMtall-airline-16756
10/29/2025, 3:12 PMsession.history.add_message isn’t available in LiveKit. But no worries—you can add an image to the chat history using the ChatContext.add_message method, which is great because it supports multimodal content like images.
Here’s a little example to help you get started:
from livekit.agents import llm
# Create image content from a URL
image_content = llm.ImageContent(
image="https://example.com/image.jpg",
inference_detail="auto"
)
# Create or use existing chat context
chat_ctx = llm.ChatContext()
# Add message with image
chat_ctx.add_message(
role="system",
content=[image_content]
)
Just make sure your image source is either a base64-encoded data URL, an external URL, or a VideoFrame object. If you have any questions or need a hand with anything else, feel free to reach out—I’m here to help!
Sources: Pipeline nodes and hooks | LiveKit Docs | livekit-agents/livekit/agents/llm/_provider_format/aws.py | Vision | LiveKit Docs