ai

package
v0.5.7 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2024 License: Apache-2.0 Imports: 7 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrMissingAuthToken = errors.New("auth token is required")
	ErrInvalidQuery     = errors.New("query is invalid")
)

Functions

func CheckAIManager

func CheckAIManager(aiMgr *AIManager) error

CheckAIManager check if the AI manager is created

func ExtractSelectSQL

func ExtractSelectSQL(sql string) string

ExtractSelectSQL extracts SQL statements that start with "SELECT * FROM"

func IsInvalidQuery

func IsInvalidQuery(sql string) bool

IsInvalidQuery check if the query is invalid

Types

type AIManager

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

func NewAIManager

func NewAIManager(c registry.ExtraConfig) (*AIManager, error)

NewAIManager returns a new AIManager object

func (*AIManager) ConvertTextToSQL

func (a *AIManager) ConvertTextToSQL(query string) (string, error)

ConvertTextToSQL converts natural language text to an SQL query

func (*AIManager) FixSQL

func (a *AIManager) FixSQL(sql string, query string, sqlErr string) (string, error)

FixSQL fix the error SQL

Jump to

Keyboard shortcuts

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