I’m using the standard LLM integration (not Realti...
# ask-ai
g
I’m using the standard LLM integration (not Realtime) with gpt-4o via AgentSession, but images via ImageContent still aren’t reaching OpenAI, when images are attached at end of turn. Is there anything special I need to do to prevent images from radically bloating chat context over time, or will OpenAI’s API do something to mitigate context bloat from the images? e.g. Will OpenAI’s service compress older images in chat history to a text description, so that full-res images will not pile up over many turns in a chat?
t
Thanks for reaching out, Dan. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Thanks for reaching out! I wanted to share that OpenAI's API doesn’t automatically compress or summarize older images into text descriptions to help prevent context bloat. Instead, images are sent in their original form, like base64-encoded data URLs or external URLs, and there isn’t a built-in feature to convert them into text summaries over time. To help manage context bloat, LiveKit’s framework uses a smart approach called selective image injection. This means it includes only the latest image in the chat context before generating a response, so it avoids stacking up full-resolution images in the chat history. If you have any more questions or need a hand with anything else, please don’t hesitate to ask—I’m here to help! Sources: livekit-agents/livekit/agents/llm/utils.py | agents/src/llm/__snapshots__/chat_context.test.ts.snap | Vision Agent Quickstart | LiveKit Docs | Vision Agent Quickstart | LiveKit Docs | Vision | LiveKit Docs