def add_dataframe(
        self,
        df,
        feedback_mode: Optional[feedback_schema.FeedbackMode] = None,
    ) -> List[record_schema.Record]:
        """Add the given dataframe as records to the database and evaluate any pre-specified
        feedbacks on them.

        The class `VirtualRecord` may be useful for creating records for virtual models.

        If `feedback_mode` is specified, will use that mode for these records only.
        """

        data_dict = df.to_dict("records")
        records = []

        for record in data_dict:
            if "contexts" in record:
                retriever = select_schema.Select.RecordCalls.retriever
                if retriever not in self.app:
                    self.app[retriever] = None
                self.app[retriever] = record["contexts"]

                context_rets = (
                    record["contexts"]
                    if isinstance(record["contexts"], list)
                    else [record["contexts"]]
                )

                rec = VirtualRecord(
                    calls={
                        retriever.get_context: dict(
                            args=[record["query"]], rets=context_rets
                        )
                    },
                    main_input=record["query"],
                    main_output=record["response"],
                )
            else:
                rec = VirtualRecord(
                    main_input=record["query"],
                    main_output=record["response"],
                    calls={},
                )
            records.append(rec)

        for record in records:
            self.add_record(record, feedback_mode=feedback_mode)

        return records
Add the given dataframe as records to the database and evaluate any pre-specified
        feedbacks on them.

        The class `VirtualRecord` may be useful for creating records for virtual models.

        If `feedback_mode` is specified, will use that mode for these records only.
        
src/core/trulens/apps/virtual.py