Documentation ¶
Index ¶
- func HealthHandler(c *fiber.Ctx) error
- func NotFoundHandler(c *fiber.Ctx) error
- type Handler
- func LangChatHandler(routerManager *routers.RouterManager) Handler
- func LangRoutersHandler(routerManager *routers.RouterManager) Handler
- func LangStreamChatHandler(tel *telemetry.Telemetry, routerManager *routers.RouterManager) Handler
- func LangStreamRouterValidator(routerManager *routers.RouterManager) Handler
- type Server
- type ServerConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HealthHandler ¶
func HealthHandler(c *fiber.Ctx) error
HealthHandler
@id glide-health @Summary Gateway Health @Description @tags Operations @Accept json @Produce json @Success 200 {object} schemas.HealthSchema @Router /v1/health/ [get]
func NotFoundHandler ¶
func NotFoundHandler(c *fiber.Ctx) error
Types ¶
type Handler ¶
type Handler = func(c *fiber.Ctx) error
func LangChatHandler ¶
func LangChatHandler(routerManager *routers.RouterManager) Handler
LangChatHandler
@id glide-language-chat @Summary Language Chat @Description Talk to different LLM Chat APIs via unified endpoint @tags Language @Param router path string true "Router ID" @Param payload body schemas.ChatRequest true "Request Data" @Accept json @Produce json @Success 200 {object} schemas.ChatResponse @Failure 400 {object} schemas.Error @Failure 404 {object} schemas.Error @Router /v1/language/{router}/chat [POST]
func LangRoutersHandler ¶
func LangRoutersHandler(routerManager *routers.RouterManager) Handler
LangRoutersHandler
@id glide-language-routers @Summary Language Router List @Description Retrieve list of configured active language routers and their configurations @tags Language @Accept json @Produce json @Success 200 {object} schemas.RouterListSchema @Router /v1/language/ [GET]
func LangStreamChatHandler ¶
func LangStreamChatHandler(tel *telemetry.Telemetry, routerManager *routers.RouterManager) Handler
LangStreamChatHandler
@id glide-language-chat-stream @Summary Language Chat @Description Talk to different LLM Stream Chat APIs via a unified websocket endpoint @tags Language @Param router path string true "Router ID" @Param Connection header string true "Websocket Connection Type" @Param Upgrade header string true "Upgrade header" @Param Sec-WebSocket-Key header string true "Websocket Security Token" @Param Sec-WebSocket-Version header string true "Websocket Security Token" @Accept json @Success 101 @Failure 426 @Failure 404 {object} schemas.Error @Router /v1/language/{router}/chatStream [GET]
func LangStreamRouterValidator ¶
func LangStreamRouterValidator(routerManager *routers.RouterManager) Handler
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func NewServer ¶
func NewServer(config *ServerConfig, tel *telemetry.Telemetry, routerManager *routers.RouterManager) (*Server, error)
type ServerConfig ¶
type ServerConfig struct { Host string `yaml:"host"` Port int `yaml:"port"` ReadTimeout *time.Duration `yaml:"read_timeout"` WriteTimeout *time.Duration `yaml:"write_timeout"` IdleTimeout *time.Duration `yaml:"idle_timeout"` MaxRequestBodySize *int `yaml:"max_request_body_size"` }
func DefaultServerConfig ¶
func DefaultServerConfig() *ServerConfig
func (*ServerConfig) Address ¶
func (cfg *ServerConfig) Address() string
func (*ServerConfig) ToServer ¶
func (cfg *ServerConfig) ToServer() *fiber.App
Click to show internal directories.
Click to hide internal directories.