docstr: We can import and use the callback handler from LangChain itself.
docstr_tok: ["We","can","import","and","use","the","callback","handler","from","LangChain","itself","."]
code: def test_import_from_langchain(self):
      """We can import and use the callback handler from LangChain itself."""
      from langchain.callbacks import (
          StreamlitCallbackHandler as LangChainStreamlitCallbackHandler,
      )
  
      from streamlit.external.langchain import (
          StreamlitCallbackHandler as InternalStreamlitCallbackHandler,
      )
  
      # LangChain's StreamlitCallbackHandler() function will use Streamlit's
      # internal StreamlitCallbackHandler class if it exists.
      handler = LangChainStreamlitCallbackHandler(
          st.container(),
          max_thought_containers=55,
          expand_new_thoughts=True,
          collapse_completed_thoughts=False,
          thought_labeler=None,
      )
      self.assertIsInstance(handler, InternalStreamlitCallbackHandler)
  
file_path: streamlit/lib/tests/streamlit/external/langchain/streamlit_callback_handler_test.py
imports: from __future__ import annotations
  import unittest
  from pathlib import Path
  from unittest.mock import MagicMock
  import pytest
  import semver
  from google.protobuf.json_format import MessageToDict
  import streamlit
  from tests.delta_generator_test_case import DeltaGeneratorTestCase
label_desc: Use image node_id 3 for calling the StreamlitCallbackHandlerAPITest obj's underlying member method code with example usage: obj.test_import_from_langchain() without return types