dbchain

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DBChain

type DBChain struct {
	SQLChain *chains.SQLDatabaseChain
	// contains filtered or unexported fields
}

func New

func New(model llms.LanguageModel, engine, dsn string, useAllTables bool) (*DBChain, error)

New returns a new TableChain. useAllTables: user all tables or choose by query If you have a lot of tables, you'd better filter out the tables by useAllTables=false, otherwise, the token may execeded token limit .

func (*DBChain) Answer

func (c *DBChain) Answer(ctx context.Context, question string) (string, error)

func (*DBChain) Call

func (c *DBChain) Call(ctx context.Context, values map[string]any, options ...chains.ChainCallOption) (map[string]any, error)

func (*DBChain) Close

func (c *DBChain) Close() error

func (*DBChain) GetInputKeys

func (c *DBChain) GetInputKeys() []string

GetInputKeys returns the expected input keys.

func (*DBChain) GetMemory

func (c *DBChain) GetMemory() schema.Memory

GetMemory returns the memory.

func (*DBChain) GetOutputKeys

func (c *DBChain) GetOutputKeys() []string

GetOutputKeys returns the output keys the chain will return.

func (*DBChain) Run

func (c *DBChain) Run(ctx context.Context, query string) (string, error)

Jump to

Keyboard shortcuts

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