class_docstr: Bridge class to connect langchain.embeddings module to mindsDB
class_docstr_tok: ["Bridge","class","to","connect","langchain.embeddings","module","to","mindsDB"]
code: def predict(self, df: DataFrame, args) -> DataFrame:
      # reconstruct the model from the model storage
      user_args = self.model_storage.json_get("args")
      model = construct_model_from_args(user_args)
  
      # get the target from the model storage
      target = user_args["target"]
      # run the actual embedding vector generation
      # TODO: need a better way to handle this
      # unquote the column names -- removing surrounding `
      cols_dfs = [col.strip("`") for col in df.columns.tolist()]
      df.columns = cols_dfs
      # if input_columns is an empty list, use all the columns
      input_columns = (
          user_args.get("input_columns") or df.columns.tolist()
      )
      # check all the input columns are in the df
      if not all(
          # ignore surrounding ` in the column names when checking
          [col in cols_dfs for col in input_columns]
      ):
          raise Exception(
              f"Input columns {input_columns} not found in the input dataframe. Available columns are {df.columns}"
          )
  
      # convert each row into a document
      df_texts = df[input_columns].apply(self.row_to_document, axis=1)
      embeddings = model.embed_documents(df_texts.tolist())
  
      # create a new dataframe with the embeddings
      df_embeddings = df.copy().assign(**{target: embeddings})
  
      return df_embeddings
  
file_path: mindsdb/mindsdb/integrations/handlers/langchain_embedding_handler/langchain_embedding_handler.py
imports: import copy
  import importlib
  from typing import Dict, Union
  import pandas
  from langchain.embeddings.base import Embeddings
  from pandas import DataFrame
  from mindsdb.integrations.libs.base import BaseMLEngine
  from mindsdb.utilities import log
label_desc: Use image node_id 3 for calling the LangchainEmbeddingHandler obj's underlying member method code with example usage: obj.predict(df, args) and returns: df_embeddings