class_docstr: Encapsulates the Streamlit UI for a single LLM 'thought' during a LangChain Agent
  run. Each tool usage gets its own thought; and runs also generally having a
  concluding thought where the Agent determines that it has an answer to the prompt.
  
  Each thought gets its own expander UI.
class_docstr_tok: ["Encapsulates","the","Streamlit","UI","for","a","single","LLM","'thought","'","during","a","LangChain","Agent","run",".","Each","tool","usage","gets","its","own","thought",";","and","runs","also","generally","having","a","concluding","thought","where","the","Agent","determines","that","it","has","an","answer","to","the","prompt",".","Each","thought","gets","its","own","expander","UI","."]
code: def on_llm_new_token(self, token: str, **kwargs: Any) -> None:
      # This is only called when the LLM is initialized with `streaming=True`
      self._llm_token_stream += _convert_newlines(token)
      if self._llm_token_stream_placeholder is None:
          self._llm_token_stream_placeholder = self._container.empty()
      self._llm_token_stream_placeholder.markdown(
          self._llm_token_stream + "▕"
      )
  
imports: from __future__ import annotations
  import time
  from enum import Enum
  from typing import TYPE_CHECKING, Any, Dict, List, NamedTuple, Optional
  from langchain.callbacks.base import BaseCallbackHandler
  from langchain.schema import AgentAction, AgentFinish, LLMResult
  from streamlit.runtime.metrics_util import gather_metrics
label_desc: Use image node_id 6 for calling the LLMThought obj's underlying member method code with example usage: obj.on_llm_new_token(token) without return types