virtualmodel

package
v0.260806.1 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2026 License: MPL-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package virtualmodel exposes management endpoints for the in-process virtual-model providers. The providers themselves are persisted in the shared ProviderStore (Source=builtin); this module only surfaces the registry contents so the frontend can render the Credentials sub-tab and any future configuration UI without re-implementing registry traversal.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterRoutes

func RegisterRoutes(router *swagger.RouteGroup, authMiddleware gin.HandlerFunc, handler *Handler)

RegisterRoutes registers virtual-model management routes under the given /api/v1 group. Auth middleware is attached per-route via WithMiddleware so this registration does not mutate the parent group's middleware chain — other modules sharing /api/v1 are unaffected by registration order.

Types

type AvailableModelEntry

type AvailableModelEntry struct {
	ID       string `json:"id" example:"vm-claude-haiku"`
	Protocol string `json:"protocol" example:"anthropic"` // "anthropic" or "openai"
}

AvailableModelEntry describes a single virtual model registered in the in-process registries. It is independent of the OpenAI Model wire shape so the frontend can render protocol-specific badges without parsing IDs.

type AvailableModelsResponse

type AvailableModelsResponse struct {
	Success bool                  `json:"success" example:"true"`
	Data    []AvailableModelEntry `json:"data"`
}

AvailableModelsResponse is the response body of GET /vmodel/available-models.

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

Handler serves the virtual-model management endpoints.

func NewHandler

func NewHandler(service *virtualserver.Service) *Handler

NewHandler returns a Handler backed by the given vmodel service.

func (*Handler) ListAvailableModels

func (h *Handler) ListAvailableModels(c *gin.Context)

ListAvailableModels returns the union of models registered across the anthropic and openai protocol registries, tagged by protocol. The frontend uses this to populate the Credentials > Virtual Models sub-tab.

Jump to

Keyboard shortcuts

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