appruntime

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindNodesHas

func FindNodesHas(app *arcadiav1alpha1.Application, group, kind string) (has bool, namespace, name string)

FindNodesHas group means ref.APIGroup files before `arcadia.kubeagi.k8s.com.cn`

func InitNode

func InitNode(ctx context.Context, appNamespace, name string, ref arcadiav1alpha1.TypedObjectReference) (n base.Node, err error)

Types

type Application

type Application struct {
	Namespace     string
	Name          string
	Spec          arcadiav1alpha1.ApplicationSpec
	Inited        bool
	Nodes         map[string]base.Node
	StartingNodes []base.Node
	EndingNode    base.Node
}

func NewAppOrGetFromCache

func NewAppOrGetFromCache(ctx context.Context, cli client.Client, app *arcadiav1alpha1.Application) (*Application, error)

func (*Application) Init

func (a *Application) Init(ctx context.Context, cli client.Client) (err error)

TODO: 防止无限循环,需要找一下是不是成环

func (*Application) Run

func (a *Application) Run(ctx context.Context, cli client.Client, respStream chan string, input Input) (output Output, err error)

type Input

type Input struct {
	// User Query
	Question string
	// Files from user upload
	// normally, the user will upload the files to s3 first and use the name of files here
	Files []string
	// overrideConfig
	NeedStream     bool
	History        langchaingoschema.ChatMessageHistory
	ConversationID string
}

type Output

type Output struct {
	Answer     string
	References []retriever.Reference
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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