class_docstr: Knowledge base table interface
  Handlers requests to KB table and modifies data in linked vector db table
class_docstr_tok: ["Knowledge","base","table","interface","Handlers","requests","to","KB","table","and","modifies","data","in","linked","vector","db","table"]
docstr: Returns embeddings for input dataframe.
  Uses model embedding model to convert content to embeddings.
  Automatically detects input and output of model using model description
  :param df:
  :return: dataframe with embeddings
docstr_tok: ["Returns","embeddings","for","input","dataframe",".","Uses","model","embedding","model","to","convert","content","to","embeddings",".","Automatically","detects","input","and","output","of","model","using","model","description",":","param","df",":",":","return",":","dataframe","with","embeddings"]
code: def _df_to_embeddings(self, df: pd.DataFrame) -> pd.DataFrame:
      """
      Returns embeddings for input dataframe.
      Uses model embedding model to convert content to embeddings.
      Automatically detects input and output of model using model description
      :param df:
      :return: dataframe with embeddings
      """
  
      model_id = self._kb.embedding_model_id
      # get the input columns
      model_rec = (
          db.session.query(db.Predictor).filter_by(id=model_id).first()
      )
  
      assert model_rec is not None, f"Model not found: {model_id}"
      model_project = (
          db.session.query(db.Project)
          .filter_by(id=model_rec.project_id)
          .first()
      )
  
      project_datanode = self.session.datahub.get(model_project.name)
  
      # TODO adjust input
      input_col = model_rec.learn_args.get("using", {}).get(
          "question_column"
      )
      if (
          input_col is not None
          and input_col != TableField.CONTENT.value
      ):
          df = df.rename(columns={TableField.CONTENT.value: input_col})
  
      if df.empty:
          df_out = pd.DataFrame(
              [], columns=[TableField.EMBEDDINGS.value]
          )
      else:
          data = df.to_dict("records")
  
          df_out = project_datanode.predict(
              model_name=model_rec.name,
              data=data,
          )
  
          target = model_rec.to_predict[0]
          if target != TableField.EMBEDDINGS.value:
              # adapt output for vectordb
              df_out = df_out.rename(
                  columns={target: TableField.EMBEDDINGS.value}
              )
          df_out = df_out[[TableField.EMBEDDINGS.value]]
  
      return df_out
  
imports: import copy
  from typing import List
  import pandas
  import mindsdb_sql.planner.utils
  from mindsdb_sql.parser.ast import BinaryOperation, Constant, Identifier, Select, Update, Delete, Star
  from mindsdb_sql.parser.dialects.mindsdb import CreatePredictor
  import mindsdb.interfaces.storage.db
  from mindsdb.integrations.libs.vectordatabase_handler import TableField
  from mindsdb.utilities.exception import EntityExistsError, EntityNotExistsError
label_desc: Use image node_id 9 for calling the KnowledgeBaseTable obj's underlying member method code with example usage: obj._df_to_embeddings(df) and returns: df_out