systemprompt

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ContextProvider

type ContextProvider interface {
	Title() string
	Info() string
}

ContextProvider is an interface that defines the title and info of a context provider

type Generator

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

Generator is system prompt generator

func NewGenerator

func NewGenerator(options ...Option) *Generator

NewGenerator returns a new system prompt Generator

func (*Generator) AddContextProviders

func (g *Generator) AddContextProviders(providers ...ContextProvider)

AddContextProviders registers new context providers

func (*Generator) ContextProvider

func (g *Generator) ContextProvider(title string) (ContextProvider, error)

ContextProvider retrieves a context provider by name. If the context provider is not found returns not found error

func (*Generator) Generate

func (g *Generator) Generate() string

func (*Generator) RemoveContextProviders

func (g *Generator) RemoveContextProviders(titles ...string)

RemoveContextProviders Unregisters an existing context provider.

type Option

type Option = func(g *Generator)

func WithBackground

func WithBackground(background []string) Option

WithBackground set Generator background

func WithContextProviders

func WithContextProviders(providers ...ContextProvider) Option

WithContextProviders set Generator context pproviders

func WithOutputInstructs

func WithOutputInstructs(outputInstructs []string) Option

WithOutputInstructs set Generator output instructions

func WithSteps

func WithSteps(steps []string) Option

WithSteps set Generator steps

Jump to

Keyboard shortcuts

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