prompter

package
v0.0.11 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 16, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DiscoverPrompt

func DiscoverPrompt(connector connectors.Connector, extraPrompt string, tables []TableData, schema string) string

func SchemaFromConfig

func SchemaFromConfig(config connectors.Config) string

SchemaFromConfig resolve schema from database config if it exists

func TablesPrompt

func TablesPrompt(tables []TableData, schema string) string

func Yamlify

func Yamlify(sample any) string

Types

type PromptColumnSchema

type PromptColumnSchema struct {
	Name       string `yaml:"name"`
	Type       string `yaml:"type"`
	PrimaryKey bool   `yaml:"primary_key,omitempty"`
}

PromptColumnSchema is used specifically for generating prompts, omitting sensitive fields like PII flag

type TableData

type TableData struct {
	Columns  []gw_model.ColumnSchema
	Name     string
	Sample   []map[string]any
	RowCount int
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL