modulecomponents

package
v1.26.14 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2025 License: BSD-3-Clause Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const AdditionalPropertyGenerate = additional.PropertyGenerate

Variables

This section is empty.

Functions

func GetGenericAdditionalProperty added in v1.24.0

func GetGenericAdditionalProperty(name, className string) *modulecapabilities.AdditionalProperty

func GetGenericArgument added in v1.24.0

func GetGenericArgument(name, className string, argumentType ArgumentType,
	nearTextTransformer modulecapabilities.TextTransform,
) *graphql.ArgumentConfig

func GetGenericGenerateProperty added in v1.26.0

func GetGenericGenerateProperty(
	className string,
	additionalGenerativeParameters map[string]modulecapabilities.GenerativeProperty,
	defaultProviderName string,
	logger logrus.FieldLogger,
) *modulecapabilities.AdditionalProperty

func GetRateLimitFromContext added in v1.25.0

func GetRateLimitFromContext(ctx context.Context, moduleName string, defaultRPM, defaultTPM int) (int, int)

func GetTotalTokens added in v1.25.25

func GetTotalTokens(usage *Usage) int

func GetValueFromContext added in v1.24.16

func GetValueFromContext(ctx context.Context, key string) string

func GetValueFromGRPC added in v1.22.3

func GetValueFromGRPC(ctx context.Context, key string) []string

Types

type ArgumentType added in v1.24.0

type ArgumentType int
const (
	Get ArgumentType = iota
	Aggregate
	Explore
)

type RateLimits added in v1.25.0

type RateLimits struct {
	LastOverwrite        time.Time
	AfterRequestFunction func(limits *RateLimits, tokensUsed int, deductRequest bool)
	LimitRequests        int
	LimitTokens          int
	RemainingRequests    int
	RemainingTokens      int
	ReservedRequests     int
	ReservedTokens       int
	ResetRequests        time.Time
	ResetTokens          time.Time
}

func (*RateLimits) CanSendFullBatch added in v1.25.13

func (rl *RateLimits) CanSendFullBatch(numRequests int, batchTokens int) bool

func (*RateLimits) CheckForReset added in v1.25.0

func (rl *RateLimits) CheckForReset()

func (*RateLimits) IsInitialized added in v1.25.0

func (rl *RateLimits) IsInitialized() bool

func (*RateLimits) ResetAfterRequestFunction added in v1.25.0

func (rl *RateLimits) ResetAfterRequestFunction(tokensUsed int)

func (*RateLimits) UpdateWithRateLimit added in v1.25.25

func (rl *RateLimits) UpdateWithRateLimit(other *RateLimits)

type Usage added in v1.25.25

type Usage struct {
	CompletionTokens int `json:"completion_tokens,omitempty"`
	PromptTokens     int `json:"prompt_tokens,omitempty"`
	TotalTokens      int `json:"total_tokens,omitempty"`
}

type VectorizationCLIPResult added in v1.25.26

type VectorizationCLIPResult struct {
	TextVectors  [][]float32
	ImageVectors [][]float32
}

type VectorizationResult added in v1.25.0

type VectorizationResult struct {
	Text       []string
	Dimensions int
	Vector     [][]float32
	Errors     []error
}

Jump to

Keyboard shortcuts

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