red-dentist-96118
12/18/2025, 2:36 AMtall-airline-16756
12/18/2025, 2:36 AMtall-airline-16756
12/18/2025, 2:36 AMllm.ChatChunk.
Quick answer:
• The most common yielded type is llm.ChatChunk. It can include:
◦ text deltas (partial/streamed text) — available at chunk.delta.content
◦ tool calls (instructions to call an external tool)
◦ metadata (usage, reasoning, events)
• You may also see raw strings or None in some implementations.
To safely get the generated text, check for ChatChunk and delta.content, and fall back to stringifying other chunk types. Example pattern:
async for chunk in self._llm.chat(chat_ctx=chat_ctx):
if isinstance(chunk, llm.ChatChunk) and hasattr(chunk.delta, "content"):
text = chunk.delta.content
else:
text = str(chunk) if chunk is not None else None
if text:
# handle the text (print, yield, append, etc.)
print(text, end="")
If you want, tell me:
• which llm client/library/version you’re using, and
• whether you need full responses assembled or incremental streaming output — I’ll give a tailored snippet. Sources: Modifying LLM output before TTS | LiveKit docs | Pipeline nodes and hooks | LiveKit docs