middlewares

package
v2.9.2 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2025 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateSpec

func ValidateSpec(spec *MiddlewareSpec) error

Types

type Middleware

type Middleware interface {
	Name() string
	Kind() string
	Spec() *MiddlewareSpec
	Handle(ctx *aicontext.Context)
	// contains filtered or unexported methods
}

Middleware defines the interface for middleware in the AI Gateway Controller.

func NewMiddleware

func NewMiddleware(spec *MiddlewareSpec) Middleware

type MiddlewareSpec

type MiddlewareSpec struct {
	Name          string             `json:"name" jsonschema:"required"`
	Kind          string             `json:"kind" jsonschema:"required"`
	SemanticCache *SemanticCacheSpec `json:"semanticCache,omitempty"`
}

MiddlewareSpec defines the specification for middleware in the AI Gateway Controller.

type SemanticCacheSpec

type SemanticCacheSpec struct {
	Embeddings      *embeddings.EmbeddingSpec `json:"embeddings" jsonschema:"required"`
	VectorDB        *vectordb.Spec            `json:"vectorDB" jsonschema:"required"`
	ReadOnly        bool                      `json:"readOnly" jsonschema:"default=false"`
	ContentTemplate string                    `json:"contentTemplate,omitempty"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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