Skip to contents

This function generates a system prompt for the chat model based on a data frame's schema and optional additional context and instructions.

Usage

querychat_system_prompt(
  df,
  name,
  data_description = NULL,
  extra_instructions = NULL,
  categorical_threshold = 10
)

Arguments

df

A data frame to generate schema information from.

name

A string containing the name of the table in SQL queries.

data_description

Optional description of the data, in plain text or Markdown format.

extra_instructions

Optional additional instructions for the chat model, in plain text or Markdown format.

categorical_threshold

The maximum number of unique values for a text column to be considered categorical.

Value

A string containing the system prompt for the chat model.