evaluator

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2023 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EvaluateRatingLabel      = corev1alpha1.Group + "/rating"
	EvaluatePipelineRunLabel = corev1alpha1.Group + "/pipelinerun"
	EvaluateDimensionLabel   = corev1alpha1.Group + "/dimension"
)
View Source
const DefaultOutputFormat = `json
{"rating": "xxx","assesement": "xxx"}
`
View Source
const (
	DefaultPromptTemplate = `` /* 786-byte string literal not displayed */

)

Variables

View Source
var (
	ErrEmptyDimension = errors.New("empty dimension")
)

Functions

Types

type Data

type Data struct {
	Owner   *corev1alpha1.Rating
	FromRun string

	Dimension    string
	Tasks        []corev1alpha1.Task
	OutputFormat string
}

+kubebuilder:object:generate=true

func (*Data) DeepCopy

func (in *Data) DeepCopy() *Data

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Data.

func (*Data) DeepCopyInto

func (in *Data) DeepCopyInto(out *Data)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type EvaluateOptions

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

type EvaluateOptionsFunc

type EvaluateOptionsFunc func(*EvaluateOptions)

func WithOutputFormat

func WithOutputFormat(format string) EvaluateOptionsFunc

func WithTemplate

func WithTemplate(template string) EvaluateOptionsFunc

type Evaluator

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

Evaluator implements the Evaluator interface with the help of open

func NewEvaluator

func NewEvaluator(logger logr.Logger, ctx context.Context, c client.Client, scheme *runtime.Scheme, llm types.NamespacedName) (*Evaluator, error)

func (*Evaluator) Evaluate

func (evaluator *Evaluator) Evaluate(ctx context.Context, rating *corev1alpha1.Rating, opts ...EvaluateOptionsFunc) error

func (*Evaluator) EvaluateWithData

func (evaluator *Evaluator) EvaluateWithData(ctx context.Context, data *Data, opts ...EvaluateOptionsFunc) error

Jump to

Keyboard shortcuts

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