sql

package
v0.0.13-alpha.3 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CallbackFn

type CallbackFn func(t *thread.Thread)

type LLM

type LLM interface {
	Generate(context.Context, *thread.Thread) error
}

type Result

type Result struct {
	SQLQuery string
	Answer   string
}

type SQL

type SQL struct {
	// contains filtered or unexported fields
}

func New

func New(llm LLM, db *sql.DB) *SQL

func (*SQL) Run

func (s *SQL) Run(ctx context.Context, question string) (*Result, error)

func (*SQL) WithCallback

func (s *SQL) WithCallback(callbackFn CallbackFn) *SQL

func (*SQL) WithTopK

func (s *SQL) WithTopK(topk int) *SQL

Jump to

Keyboard shortcuts

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