Documentation
¶
Overview ¶
Package handler implements the gateway's HTTP handlers: it translates HTTP requests into modality operations, dispatches them through the provider registry, and renders OpenAI-compatible responses and SSE streams.
Index ¶
- func MarkInternalRequest(c *gin.Context)
- type AdminAnalyticsHandler
- type AudioHandler
- type BatchesHandler
- type ChatHandler
- type ControlPlaneHandler
- func (h *ControlPlaneHandler) CreateBudget(c *gin.Context)
- func (h *ControlPlaneHandler) CreateMCPBinding(c *gin.Context)
- func (h *ControlPlaneHandler) CreatePolicy(c *gin.Context)
- func (h *ControlPlaneHandler) CreateProject(c *gin.Context)
- func (h *ControlPlaneHandler) CreateTool(c *gin.Context)
- func (h *ControlPlaneHandler) CreateToolset(c *gin.Context)
- func (h *ControlPlaneHandler) CreateVirtualKey(c *gin.Context)
- func (h *ControlPlaneHandler) DeleteVirtualKey(c *gin.Context)
- func (h *ControlPlaneHandler) ListBudgets(c *gin.Context)
- func (h *ControlPlaneHandler) ListMCPBindings(c *gin.Context)
- func (h *ControlPlaneHandler) ListPolicies(c *gin.Context)
- func (h *ControlPlaneHandler) ListProjects(c *gin.Context)
- func (h *ControlPlaneHandler) ListTools(c *gin.Context)
- func (h *ControlPlaneHandler) ListToolsets(c *gin.Context)
- func (h *ControlPlaneHandler) ListVirtualKeys(c *gin.Context)
- type EmbedHandler
- type FilesHandler
- type HealthHandler
- type ImageHandler
- type InterpretingHandler
- type KeysHandler
- type MCPHandler
- type MetricsHandler
- type ModelsHandler
- type MusicHandler
- func (h *MusicHandler) CancelJob(c *gin.Context)
- func (h *MusicHandler) Edit(c *gin.Context)
- func (h *MusicHandler) Generate(c *gin.Context)
- func (h *MusicHandler) GetJob(c *gin.Context)
- func (h *MusicHandler) GetJobContent(c *gin.Context)
- func (h *MusicHandler) Lyrics(c *gin.Context)
- func (h *MusicHandler) Plans(c *gin.Context)
- func (h *MusicHandler) Stems(c *gin.Context)
- type NotesHandler
- type PodcastHandler
- type TokensHandler
- type TranslationHandler
- type UsageHandler
- type VideoHandler
- type VoiceHandler
- type VoicesHandler
- func (h *VoicesHandler) Activate(c *gin.Context)
- func (h *VoicesHandler) Archive(c *gin.Context)
- func (h *VoicesHandler) CreateClone(c *gin.Context)
- func (h *VoicesHandler) CreateDesign(c *gin.Context)
- func (h *VoicesHandler) Delete(c *gin.Context)
- func (h *VoicesHandler) Get(c *gin.Context)
- func (h *VoicesHandler) List(c *gin.Context)
- func (h *VoicesHandler) Retrain(c *gin.Context)
- func (h *VoicesHandler) Unarchive(c *gin.Context)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MarkInternalRequest ¶
MarkInternalRequest flags the gin context as an internal request.
Types ¶
type AdminAnalyticsHandler ¶
type AdminAnalyticsHandler struct {
// contains filtered or unexported fields
}
AdminAnalyticsHandler serves admin-gated read endpoints the operator console needs: project/global usage with rich breakdowns, and the audit trail. These are additive and never alter the existing self-scoped GET /v1/usage.
func NewAdminAnalyticsHandler ¶
func NewAdminAnalyticsHandler(appStore store.Store) *AdminAnalyticsHandler
func (*AdminAnalyticsHandler) AuditEvents ¶
func (h *AdminAnalyticsHandler) AuditEvents(c *gin.Context)
func (*AdminAnalyticsHandler) Usage ¶
func (h *AdminAnalyticsHandler) Usage(c *gin.Context)
type AudioHandler ¶
type AudioHandler struct {
// contains filtered or unexported fields
}
func NewAudioHandler ¶
func NewAudioHandler(runtime *gwruntime.Holder, drainer *drain.Registry) *AudioHandler
func (*AudioHandler) Create ¶
func (h *AudioHandler) Create(c *gin.Context)
func (*AudioHandler) WebSocket ¶
func (h *AudioHandler) WebSocket(c *gin.Context)
type BatchesHandler ¶
type BatchesHandler struct {
// contains filtered or unexported fields
}
func NewBatchesHandler ¶
func NewBatchesHandler(runtime *gwruntime.Holder, appStore store.Store) *BatchesHandler
func (*BatchesHandler) Create ¶
func (h *BatchesHandler) Create(c *gin.Context)
func (*BatchesHandler) Delete ¶
func (h *BatchesHandler) Delete(c *gin.Context)
func (*BatchesHandler) Get ¶
func (h *BatchesHandler) Get(c *gin.Context)
func (*BatchesHandler) Output ¶
func (h *BatchesHandler) Output(c *gin.Context)
type ChatHandler ¶
type ChatHandler struct {
// contains filtered or unexported fields
}
func NewChatHandler ¶
func (*ChatHandler) Complete ¶
func (h *ChatHandler) Complete(c *gin.Context)
func (*ChatHandler) Messages ¶
func (h *ChatHandler) Messages(c *gin.Context)
func (*ChatHandler) PurgeSemanticCache ¶
func (h *ChatHandler) PurgeSemanticCache(c *gin.Context)
PurgeSemanticCache drops in-process semantic-cache namespaces matching the optional model/project filters (empty body = purge all). Admin-scoped.
func (*ChatHandler) Responses ¶
func (h *ChatHandler) Responses(c *gin.Context)
type ControlPlaneHandler ¶
type ControlPlaneHandler struct {
// contains filtered or unexported fields
}
func NewControlPlaneHandler ¶
func NewControlPlaneHandler(runtime *gwruntime.Holder, appStore store.Store, keyCache *middleware.VirtualKeyCache, auditLogger *store.AsyncAuditLogger, tools *tooling.Registry) *ControlPlaneHandler
func (*ControlPlaneHandler) CreateBudget ¶
func (h *ControlPlaneHandler) CreateBudget(c *gin.Context)
func (*ControlPlaneHandler) CreateMCPBinding ¶
func (h *ControlPlaneHandler) CreateMCPBinding(c *gin.Context)
func (*ControlPlaneHandler) CreatePolicy ¶
func (h *ControlPlaneHandler) CreatePolicy(c *gin.Context)
func (*ControlPlaneHandler) CreateProject ¶
func (h *ControlPlaneHandler) CreateProject(c *gin.Context)
func (*ControlPlaneHandler) CreateTool ¶
func (h *ControlPlaneHandler) CreateTool(c *gin.Context)
func (*ControlPlaneHandler) CreateToolset ¶
func (h *ControlPlaneHandler) CreateToolset(c *gin.Context)
func (*ControlPlaneHandler) CreateVirtualKey ¶
func (h *ControlPlaneHandler) CreateVirtualKey(c *gin.Context)
func (*ControlPlaneHandler) DeleteVirtualKey ¶
func (h *ControlPlaneHandler) DeleteVirtualKey(c *gin.Context)
func (*ControlPlaneHandler) ListBudgets ¶
func (h *ControlPlaneHandler) ListBudgets(c *gin.Context)
func (*ControlPlaneHandler) ListMCPBindings ¶
func (h *ControlPlaneHandler) ListMCPBindings(c *gin.Context)
func (*ControlPlaneHandler) ListPolicies ¶
func (h *ControlPlaneHandler) ListPolicies(c *gin.Context)
func (*ControlPlaneHandler) ListProjects ¶
func (h *ControlPlaneHandler) ListProjects(c *gin.Context)
func (*ControlPlaneHandler) ListTools ¶
func (h *ControlPlaneHandler) ListTools(c *gin.Context)
func (*ControlPlaneHandler) ListToolsets ¶
func (h *ControlPlaneHandler) ListToolsets(c *gin.Context)
func (*ControlPlaneHandler) ListVirtualKeys ¶
func (h *ControlPlaneHandler) ListVirtualKeys(c *gin.Context)
type EmbedHandler ¶
type EmbedHandler struct {
// contains filtered or unexported fields
}
func NewEmbedHandler ¶
func NewEmbedHandler(runtime *gwruntime.Holder, cache cachepkg.Cache) *EmbedHandler
func (*EmbedHandler) Create ¶
func (h *EmbedHandler) Create(c *gin.Context)
type FilesHandler ¶
type FilesHandler struct {
// contains filtered or unexported fields
}
func NewFilesHandler ¶
func NewFilesHandler(runtime *gwruntime.Holder, appStore store.Store, auditLogger *store.AsyncAuditLogger, logger *slog.Logger) *FilesHandler
func (*FilesHandler) Content ¶
func (h *FilesHandler) Content(c *gin.Context)
func (*FilesHandler) Delete ¶
func (h *FilesHandler) Delete(c *gin.Context)
func (*FilesHandler) Get ¶
func (h *FilesHandler) Get(c *gin.Context)
func (*FilesHandler) List ¶
func (h *FilesHandler) List(c *gin.Context)
func (*FilesHandler) Materialize ¶
func (h *FilesHandler) Materialize(c *gin.Context)
func (*FilesHandler) Upload ¶
func (h *FilesHandler) Upload(c *gin.Context)
type HealthHandler ¶
type HealthHandler struct {
// contains filtered or unexported fields
}
func NewHealthHandler ¶
func (*HealthHandler) Liveness ¶
func (h *HealthHandler) Liveness(c *gin.Context)
func (*HealthHandler) Readiness ¶
func (h *HealthHandler) Readiness(c *gin.Context)
type ImageHandler ¶
type ImageHandler struct {
// contains filtered or unexported fields
}
func NewImageHandler ¶
func NewImageHandler(runtime *gwruntime.Holder, cache cachepkg.Cache) *ImageHandler
func (*ImageHandler) Edit ¶
func (h *ImageHandler) Edit(c *gin.Context)
func (*ImageHandler) Generate ¶
func (h *ImageHandler) Generate(c *gin.Context)
type InterpretingHandler ¶
type InterpretingHandler struct {
// contains filtered or unexported fields
}
func NewInterpretingHandler ¶
func NewInterpretingHandler(runtime *gwruntime.Holder, drainer *drain.Registry) *InterpretingHandler
func (*InterpretingHandler) Create ¶
func (h *InterpretingHandler) Create(c *gin.Context)
func (*InterpretingHandler) WebSocket ¶
func (h *InterpretingHandler) WebSocket(c *gin.Context)
type KeysHandler ¶
type KeysHandler struct {
// contains filtered or unexported fields
}
func NewKeysHandler ¶
func NewKeysHandler(runtime *gwruntime.Holder, appStore store.Store, keyCache *middleware.APIKeyCache, virtualKeyCache *middleware.VirtualKeyCache) *KeysHandler
func (*KeysHandler) Create ¶
func (h *KeysHandler) Create(c *gin.Context)
func (*KeysHandler) Delete ¶
func (h *KeysHandler) Delete(c *gin.Context)
func (*KeysHandler) List ¶
func (h *KeysHandler) List(c *gin.Context)
type MCPHandler ¶
type MCPHandler struct {
// contains filtered or unexported fields
}
func NewMCPHandler ¶
func (*MCPHandler) Serve ¶
func (h *MCPHandler) Serve(c *gin.Context)
func (*MCPHandler) ServeAggregate ¶
func (h *MCPHandler) ServeAggregate(c *gin.Context)
ServeAggregate exposes every binding the caller's scopes allow through a single MCP endpoint. Tools are namespaced `{binding_id}:{tool}`.
type MetricsHandler ¶
type MetricsHandler struct {
// contains filtered or unexported fields
}
func NewMetricsHandler ¶
func NewMetricsHandler(runtime *gwruntime.Holder, recorder *metrics.Recorder) *MetricsHandler
func (*MetricsHandler) Serve ¶
func (h *MetricsHandler) Serve(c *gin.Context)
type ModelsHandler ¶
type ModelsHandler struct {
// contains filtered or unexported fields
}
func NewModelsHandler ¶
func NewModelsHandler(runtime *gwruntime.Holder) *ModelsHandler
func (*ModelsHandler) Capabilities ¶
func (h *ModelsHandler) Capabilities(c *gin.Context)
func (*ModelsHandler) List ¶
func (h *ModelsHandler) List(c *gin.Context)
type MusicHandler ¶
type MusicHandler struct {
// contains filtered or unexported fields
}
func NewMusicHandler ¶
func NewMusicHandler(runtime *gwruntime.Holder, cache cachepkg.Cache, requestLogger *store.AsyncRequestLogger) *MusicHandler
func (*MusicHandler) CancelJob ¶
func (h *MusicHandler) CancelJob(c *gin.Context)
func (*MusicHandler) Edit ¶
func (h *MusicHandler) Edit(c *gin.Context)
func (*MusicHandler) Generate ¶
func (h *MusicHandler) Generate(c *gin.Context)
func (*MusicHandler) GetJob ¶
func (h *MusicHandler) GetJob(c *gin.Context)
func (*MusicHandler) GetJobContent ¶
func (h *MusicHandler) GetJobContent(c *gin.Context)
func (*MusicHandler) Lyrics ¶
func (h *MusicHandler) Lyrics(c *gin.Context)
func (*MusicHandler) Plans ¶
func (h *MusicHandler) Plans(c *gin.Context)
func (*MusicHandler) Stems ¶
func (h *MusicHandler) Stems(c *gin.Context)
type NotesHandler ¶
type NotesHandler struct {
// contains filtered or unexported fields
}
func NewNotesHandler ¶
func NewNotesHandler(runtime *gwruntime.Holder) *NotesHandler
func (*NotesHandler) Create ¶
func (h *NotesHandler) Create(c *gin.Context)
func (*NotesHandler) Delete ¶
func (h *NotesHandler) Delete(c *gin.Context)
func (*NotesHandler) Get ¶
func (h *NotesHandler) Get(c *gin.Context)
type PodcastHandler ¶
type PodcastHandler struct {
// contains filtered or unexported fields
}
func NewPodcastHandler ¶
func NewPodcastHandler(runtime *gwruntime.Holder, cache cachepkg.Cache, requestLogger *store.AsyncRequestLogger) *PodcastHandler
func (*PodcastHandler) Cancel ¶
func (h *PodcastHandler) Cancel(c *gin.Context)
func (*PodcastHandler) Content ¶
func (h *PodcastHandler) Content(c *gin.Context)
func (*PodcastHandler) Create ¶
func (h *PodcastHandler) Create(c *gin.Context)
func (*PodcastHandler) Get ¶
func (h *PodcastHandler) Get(c *gin.Context)
type TokensHandler ¶
type TokensHandler struct {
// contains filtered or unexported fields
}
func NewTokensHandler ¶
func NewTokensHandler(chat *ChatHandler) *TokensHandler
func (*TokensHandler) Count ¶
func (h *TokensHandler) Count(c *gin.Context)
type TranslationHandler ¶
type TranslationHandler struct {
// contains filtered or unexported fields
}
func NewTranslationHandler ¶
func NewTranslationHandler(runtime *gwruntime.Holder) *TranslationHandler
func (*TranslationHandler) Translate ¶
func (h *TranslationHandler) Translate(c *gin.Context)
type UsageHandler ¶
type UsageHandler struct {
// contains filtered or unexported fields
}
func NewUsageHandler ¶
func NewUsageHandler(appStore store.Store) *UsageHandler
func (*UsageHandler) Get ¶
func (h *UsageHandler) Get(c *gin.Context)
type VideoHandler ¶
type VideoHandler struct {
// contains filtered or unexported fields
}
func NewVideoHandler ¶
func NewVideoHandler(runtime *gwruntime.Holder) *VideoHandler
func (*VideoHandler) Cancel ¶
func (h *VideoHandler) Cancel(c *gin.Context)
func (*VideoHandler) Content ¶
func (h *VideoHandler) Content(c *gin.Context)
func (*VideoHandler) Generate ¶
func (h *VideoHandler) Generate(c *gin.Context)
func (*VideoHandler) Get ¶
func (h *VideoHandler) Get(c *gin.Context)
type VoiceHandler ¶
type VoiceHandler struct {
// contains filtered or unexported fields
}
func NewVoiceHandler ¶
func (*VoiceHandler) CreateStreamingTranscriptionSession ¶
func (h *VoiceHandler) CreateStreamingTranscriptionSession(c *gin.Context)
func (*VoiceHandler) Speech ¶
func (h *VoiceHandler) Speech(c *gin.Context)
func (*VoiceHandler) StreamingTranscriptionWebSocket ¶
func (h *VoiceHandler) StreamingTranscriptionWebSocket(c *gin.Context)
func (*VoiceHandler) Transcribe ¶
func (h *VoiceHandler) Transcribe(c *gin.Context)
type VoicesHandler ¶
type VoicesHandler struct {
// contains filtered or unexported fields
}
func NewVoicesHandler ¶
func NewVoicesHandler(runtime *gwruntime.Holder, appStore store.Store) *VoicesHandler
func (*VoicesHandler) Activate ¶
func (h *VoicesHandler) Activate(c *gin.Context)
func (*VoicesHandler) Archive ¶
func (h *VoicesHandler) Archive(c *gin.Context)
func (*VoicesHandler) CreateClone ¶
func (h *VoicesHandler) CreateClone(c *gin.Context)
func (*VoicesHandler) CreateDesign ¶
func (h *VoicesHandler) CreateDesign(c *gin.Context)
func (*VoicesHandler) Delete ¶
func (h *VoicesHandler) Delete(c *gin.Context)
func (*VoicesHandler) Get ¶
func (h *VoicesHandler) Get(c *gin.Context)
func (*VoicesHandler) List ¶
func (h *VoicesHandler) List(c *gin.Context)
func (*VoicesHandler) Retrain ¶
func (h *VoicesHandler) Retrain(c *gin.Context)
func (*VoicesHandler) Unarchive ¶
func (h *VoicesHandler) Unarchive(c *gin.Context)
Source Files
¶
- adminanalytics.go
- audio.go
- audio_tokens.go
- batch_tokens.go
- batches.go
- chat.go
- chat_files.go
- chat_validation.go
- controlplane.go
- conversation.go
- conversation_execution.go
- conversation_streams.go
- embed.go
- failover.go
- file_tokens.go
- file_understanding_registry.go
- files.go
- guardrails_apply.go
- guardrails_judge.go
- health.go
- hedge.go
- image.go
- interpreting.go
- interpreting_tokens.go
- keys.go
- mcp.go
- mcp_source.go
- messages.go
- metrics.go
- models.go
- multimodal_helpers.go
- music.go
- music_tokens.go
- notes.go
- notes_tokens.go
- podcast.go
- podcast_tokens.go
- response_cache.go
- responses.go
- routing_apply.go
- semcache_apply.go
- semcache_embedder.go
- signed_tokens.go
- sse.go
- token_source.go
- tokens.go
- translation.go
- usage.go
- video.go
- video_tokens.go
- voice.go
- voice_stream.go
- voice_stream_tokens.go
- voices.go