gptscript

package
v0.9.5-rc2 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2024 License: Apache-2.0 Imports: 23 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GPTScript

type GPTScript struct {
	Registry               *llm.Registry
	Runner                 *runner.Runner
	Cache                  *cache.Client
	WorkspacePath          string
	DeleteWorkspaceOnClose bool
	ExtraEnv               []string
	// contains filtered or unexported fields
}

func New

func New(ctx context.Context, o ...Options) (*GPTScript, error)

func (*GPTScript) Chat added in v0.6.0

func (g *GPTScript) Chat(ctx context.Context, prevState runner.ChatState, prg types.Program, envs []string, input string) (runner.ChatResponse, error)

func (*GPTScript) Close

func (g *GPTScript) Close(closeDaemons bool)

func (*GPTScript) GetModel

func (g *GPTScript) GetModel() engine.Model

func (*GPTScript) ListModels

func (g *GPTScript) ListModels(ctx context.Context, providers ...string) ([]string, error)

func (*GPTScript) ListTools added in v0.4.0

func (g *GPTScript) ListTools(_ context.Context, prg types.Program) []types.Tool

func (*GPTScript) Run

func (g *GPTScript) Run(ctx context.Context, prg types.Program, envs []string, input string) (string, error)

type Options

type Options struct {
	Cache                cache.Options
	OpenAI               openai.Options
	Monitor              monitor.Options
	Runner               runner.Options
	DefaultModelProvider string
	CredentialContext    string
	Quiet                *bool
	Workspace            string
	DisablePromptServer  bool
	Env                  []string
}

func Complete added in v0.9.3

func Complete(opts ...Options) Options

Jump to

Keyboard shortcuts

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