Run on new output token.
Only available when streaming is enabled.
For both chat models and non-chat models (legacy text-completion LLMs).
on_llm_new_token(
self,
token: str,
*,
chunk: GenerationChunk | ChatGenerationChunk | None = None,
run_id: UUID,
parent_run_id: UUID | None = None,
**kwargs: Any = {}
) -> None