select_model

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RequestService

type RequestService struct {
	*request.BaseService
}

RequestService handles request parsing and validation for select model operations It embeds the base request service and specializes it for model selection

func NewRequestService

func NewRequestService() *RequestService

NewRequestService creates a new request service for select model

func (*RequestService) ParseSelectModelRequest

func (rs *RequestService) ParseSelectModelRequest(c *fiber.Ctx) (*models.SelectModelRequest, error)

ParseSelectModelRequest parses and validates the select model request body

func (*RequestService) ValidateSelectModelRequest

func (rs *RequestService) ValidateSelectModelRequest(req *models.SelectModelRequest) error

ValidateSelectModelRequest validates the parsed select model request

type ResponseService

type ResponseService struct {
	*response.BaseService
}

ResponseService handles HTTP responses for select model operations It embeds the base response service and specializes it for model selection

func NewResponseService

func NewResponseService() *ResponseService

NewResponseService creates a new response service

func (*ResponseService) BadRequest

func (rs *ResponseService) BadRequest(c *fiber.Ctx, message string) error

BadRequest sends a bad request error response specific to model selection

func (*ResponseService) InternalError

func (rs *ResponseService) InternalError(c *fiber.Ctx, message string) error

InternalError sends an internal server error response specific to model selection

type Service

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

Service handles model selection logic

func NewService

func NewService(modelRouter *model_router.ModelRouter) *Service

NewService creates a new select model service

func (*Service) SelectModel

func (s *Service) SelectModel(
	ctx context.Context,
	req *models.SelectModelRequest,
	userID, requestID string,
	circuitBreakers map[string]*circuitbreaker.CircuitBreaker,
	mergedConfig *models.ModelRouterConfig,
) (*models.SelectModelResponse, error)

SelectModel performs model selection based on the request

type ValidationError

type ValidationError struct {
	Field   string
	Message string
}

ValidationError represents a request validation error

func (*ValidationError) Error

func (e *ValidationError) Error() string

Jump to

Keyboard shortcuts

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