class_docstr: This is a MindsDB integration for the LangChain library, which provides a unified interface for interacting with
  various large language models (LLMs).
  
  Currently, this integration supports exposing OpenAI and Anthrophic's LLMs with normal text completion support. They are then
  wrapped in a zero shot react description agent that offers a few third party tools out of the box, with support
  for additional ones if an API key is provided. Ongoing memory is also provided.
  
  Full tool support list:
      - wikipedia
      - python_repl
      - serper.dev search
class_docstr_tok: ["This","is","a","MindsDB","integration","for","the","LangChain","library",",","which","provides","a","unified","interface","for","interacting","with","various","large","language","models","(","LLMs",")",".","Currently",",","this","integration","supports","exposing","OpenAI","and","Anthrophic","'s","LLMs","with","normal","text","completion","support",".","They","are","then","wrapped","in","a","zero","shot","react","description","agent","that","offers","a","few","third","party","tools","out","of","the","box",",","with","support","for","additional","ones","if","an","API","key","is","provided",".","Ongoing","memory","is","also","provided",".","Full","tool","support","list",":","-","wikipedia","-","python_repl","-","serper.dev","search"]
code: def __init__(self, *args, **kwargs):
      super().__init__(*args, **kwargs)
      self.generative = True
      self.stops = []
      self.default_mode = "default"  # can also be 'conversational' or 'conversational-full'
      self.engine_to_supported_modes = {
          "openai": [
              "default",
              "conversational",
              "conversational-full",
              "image",
          ],
          "anthropic": [
              "default",
              "conversational",
              "conversational-full",
          ],
      }
      self.default_model = _DEFAULT_MODEL
      self.default_max_tokens = _DEFAULT_MAX_TOKENS
      self.default_agent_model = _DEFAULT_AGENT_MODEL
      self.default_agent_tools = _DEFAULT_AGENT_TOOLS
  
imports: import re
  import os
  from typing import Optional, Dict
  from concurrent.futures import as_completed, TimeoutError
  import numpy
  import pandas
  from langchain.schema import SystemMessage
  from langchain.agents import AgentType
  from langchain.llms import OpenAI
  from langchain.chat_models import ChatAnthropic, ChatOpenAI
  from langchain.agents import initialize_agent, create_sql_agent
  from langchain.prompts import PromptTemplate
  from langchain.agents.agent_toolkits import SQLDatabaseToolkit
  from langchain.chains.conversation.memory import ConversationSummaryBufferMemory
  from mindsdb.integrations.handlers.openai_handler.constants import CHAT_MODELS
  from mindsdb.integrations.handlers.langchain_handler.mindsdb_database_agent import MindsDBSQL
  from mindsdb.integrations.handlers.langchain_handler.tools import setup_tools
  from mindsdb.integrations.libs.base import BaseMLEngine
  from mindsdb.integrations.utilities.handler_utils import get_api_key
  from mindsdb.utilities import log
  from mindsdb.utilities.context_executor import ContextThreadPoolExecutor
label_desc: Use image node_id 1 to create a new LangChainHandler object from inherited base classes: BaseMLEngine with example: obj = LangChainHandler()