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"`
}
Click to show internal directories.
Click to hide internal directories.