Versions in this module Expand all Collapse all v6 v6.9.3 Mar 25, 2026 Changes in this version + const MappedModelContextKey + type AmpModule struct + func New(opts ...Option) *AmpModule + func NewLegacy(accessManager *sdkaccess.Manager, authMiddleware gin.HandlerFunc) *AmpModule + func (m *AmpModule) GetModelMapper() *DefaultModelMapper + func (m *AmpModule) IsRestrictedToLocalhost() bool + func (m *AmpModule) Name() string + func (m *AmpModule) OnConfigUpdated(cfg *config.Config) error + func (m *AmpModule) Register(ctx modules.Context) error + type AmpRouteType string + const RouteTypeAmpCredits + const RouteTypeLocalProvider + const RouteTypeModelMapping + const RouteTypeNoProvider + type DefaultModelMapper struct + func NewModelMapper(mappings []config.AmpModelMapping) *DefaultModelMapper + func (m *DefaultModelMapper) GetMappings() map[string]string + func (m *DefaultModelMapper) MapModel(requestedModel string) string + func (m *DefaultModelMapper) UpdateMappings(mappings []config.AmpModelMapping) + type FallbackHandler struct + func NewFallbackHandler(getProxy func() *httputil.ReverseProxy) *FallbackHandler + func NewFallbackHandlerWithMapper(getProxy func() *httputil.ReverseProxy, mapper ModelMapper, ...) *FallbackHandler + func (fh *FallbackHandler) SetModelMapper(mapper ModelMapper) + func (fh *FallbackHandler) WrapHandler(handler gin.HandlerFunc) gin.HandlerFunc + type MappedSecretSource struct + func NewMappedSecretSource(defaultSource SecretSource) *MappedSecretSource + func (s *MappedSecretSource) Get(ctx context.Context) (string, error) + func (s *MappedSecretSource) InvalidateCache() + func (s *MappedSecretSource) UpdateDefaultExplicitKey(key string) + func (s *MappedSecretSource) UpdateMappings(entries []config.AmpUpstreamAPIKeyEntry) + type ModelMapper interface + MapModel func(requestedModel string) string + UpdateMappings func(mappings []config.AmpModelMapping) + type MultiSourceSecret struct + func NewMultiSourceSecret(explicitKey string, cacheTTL time.Duration) *MultiSourceSecret + func NewMultiSourceSecretWithPath(explicitKey string, filePath string, cacheTTL time.Duration) *MultiSourceSecret + func (s *MultiSourceSecret) Get(ctx context.Context) (string, error) + func (s *MultiSourceSecret) InvalidateCache() + func (s *MultiSourceSecret) UpdateExplicitKey(key string) + type Option func(*AmpModule) + func WithAccessManager(am *sdkaccess.Manager) Option + func WithAuthMiddleware(middleware gin.HandlerFunc) Option + func WithSecretSource(source SecretSource) Option + type ResponseRewriter struct + func NewResponseRewriter(w gin.ResponseWriter, originalModel string) *ResponseRewriter + func (rw *ResponseRewriter) Flush() + func (rw *ResponseRewriter) Write(data []byte) (int, error) + type SecretSource interface + Get func(ctx context.Context) (string, error) + type StaticSecretSource struct + func NewStaticSecretSource(key string) *StaticSecretSource + func (s *StaticSecretSource) Get(ctx context.Context) (string, error) v6.9.2-rc1 Mar 25, 2026