feedback

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 14, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FillInSopCheckPrompt

func FillInSopCheckPrompt(ctx context.Context, lf *LLMFeedback,
	a schema.Agent, messages []schema.Message,
	_ []schema.StepAction, steps []schema.StepAction,
	_ string) bool

func FillInStabilityPrompt

func FillInStabilityPrompt(ctx context.Context, lf *LLMFeedback,
	a schema.Agent, messages []schema.Message,
	actions []schema.StepAction, steps []schema.StepAction,
	_ string) bool

func SopAccessCondition

func SopAccessCondition(_ context.Context, lf *LLMFeedback,
	_ schema.Agent, messages []schema.Message, _ []schema.StepAction,
	_ []schema.StepAction, _ string) bool

Types

type ContentFeedback

type ContentFeedback struct{}

func (*ContentFeedback) Feedback

func (*ContentFeedback) Feedback(_ context.Context, agent schema.Agent,
	messages []schema.Message, actions []schema.StepAction,
	steps []schema.StepAction, _ string) *FeedbackInfo

type Feedback

type Feedback interface {
	Feedback(ctx context.Context, agent schema.Agent, messages []schema.Message, actions []schema.StepAction,
		steps []schema.StepAction, prompt string) *FeedbackInfo
}

func Chain

func Chain(chains ...Feedback) Feedback

Chain function to create a new Feedback that chains multiple Feedback

func NewContentFeedback

func NewContentFeedback() Feedback

func NewLLMFeedback

func NewLLMFeedback(LLM llm.LLM, opts ...LLMFeedbackOption) (Feedback, error)

func NewSopFeedback

func NewSopFeedback(LLM llm.LLM) (Feedback, error)

func NewStabilityFeedback

func NewStabilityFeedback(LLM llm.LLM) (Feedback, error)

type FeedbackInfo

type FeedbackInfo struct {
	Type  FeedbackType `json:"type"`
	Msg   string       `json:"msg"`
	Token int          `json:"token"`
}

type FeedbackType

type FeedbackType = string
const (
	Approved    FeedbackType = "Approved"
	NotApproved FeedbackType = "NotApproved"
)

type LLMFeedback

type LLMFeedback struct {
	Vars map[string]any
	// contains filtered or unexported fields
}

func (*LLMFeedback) Feedback

func (lf *LLMFeedback) Feedback(ctx context.Context, agent schema.Agent,
	messages []schema.Message, actions []schema.StepAction,
	steps []schema.StepAction, prompt string) *FeedbackInfo

type LLMFeedbackOption

type LLMFeedbackOption func(*LLMFeedback)

func WithExpertNum

func WithExpertNum(num int) LLMFeedbackOption

func WithMaxConBlock

func WithMaxConBlock(block int) LLMFeedbackOption

func WithMiddlewares

func WithMiddlewares(middlewares ...Middleware) LLMFeedbackOption

func WithPromptTemplate

func WithPromptTemplate(template string) LLMFeedbackOption

Jump to

Keyboard shortcuts

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