functions

package
v1.0.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(name string, factory FunctionFactory)

Types

type Background

type Background struct {
	OrgID         uint64
	OrgName       string
	UserID        string
	Resources     map[string]json.Number
	ProjectID     uint64
	ApplicationID uint64
	Prompt        string `json:"prompt" yaml:"prompt"`
}

type CallbackURL

type CallbackURL struct{ CallbackURL any }

type Function

type Function interface {
	Name() string
	Description() string
	SystemMessage(lang string) string
	UserMessage() string
	Schema() (json.RawMessage, error)
	RequestOptions() []sdk.RequestOption
	CompletionOptions() []sdk.PatchOption
	Callback(ctx context.Context, arguments json.RawMessage, input interface{}) (any, error)
	Handler(ctx context.Context, factory FunctionFactory, req *pb.ApplyRequest, openaiURL *url.URL, xAIProxyModelId string) (any, error)
}

type FunctionFactory

type FunctionFactory func(ctx context.Context, prompt string, background *pb.Background) Function

func Retrieve

func Retrieve(name string) (FunctionFactory, bool)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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