Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterRoutes ¶
func RegisterRoutes(router *swagger.RouteGroup, handler *Handler)
RegisterRoutes registers all rule routes with swagger documentation
Types ¶
type CreateRuleRequest ¶
CreateRuleRequest represents the request to create a rule
type DeleteRuleResponse ¶
type DeleteRuleResponse struct {
Success bool `json:"success" example:"true"`
Message string `json:"message" example:"Rule deleted successfully"`
}
DeleteRuleResponse represents the response for deleting a rule
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler handles rule HTTP requests
func NewHandler ¶
func NewHandler(cfg *config.Config, logger *obs.MemoryLogger) *Handler
NewHandler creates a new rule handler
func (*Handler) CreateRule ¶
CreateRule creates a new rule
func (*Handler) UpdateRule ¶
UpdateRule creates or updates a rule
type RuleResponse ¶
type RuleResponse struct {
Success bool `json:"success" example:"true"`
Data *typ.Rule `json:"data"`
}
RuleResponse represents a rule configuration response
type RulesResponse ¶
type RulesResponse struct {
Success bool `json:"success" example:"true"`
Data interface{} `json:"data"`
}
RulesResponse represents the response for getting all rules
type UpdateRuleRequest ¶
UpdateRuleRequest represents the request to set/update a rule
type UpdateRuleResponse ¶
type UpdateRuleResponse struct {
Success bool `json:"success" example:"true"`
Message string `json:"message" example:"Rule saved successfully"`
Data struct {
UUID string `json:"uuid"`
RequestModel string `json:"request_model" example:"gpt-3.5-turbo"`
ResponseModel string `json:"response_model" example:"gpt-3.5-turbo"`
Description string `json:"description" example:"My rule description"`
Provider string `json:"provider" example:"openai"`
DefaultModel string `json:"default_model" example:"gpt-3.5-turbo"`
Active bool `json:"active" example:"true"`
SmartEnabled bool `json:"smart_enabled" example:"false"`
SmartRouting []smartrouting.SmartRouting `json:"smart_routing,omitempty"`
} `json:"data"`
}
UpdateRuleResponse represents the response for setting/updating a rule
Click to show internal directories.
Click to hide internal directories.