Documentation
¶
Index ¶
- type ApplyPricingRequest
- type ApplyPricingResponse
- type CreateRequest
- type FetchPricingRequest
- type FetchPricingResponse
- type Handler
- func (h *Handler) ApplyPricing(c *app.Context, req ApplyPricingRequest) (ApplyPricingResponse, error)
- func (h *Handler) Create(c *app.Context, req CreateRequest) (api.Created[models.ModelConfig], error)
- func (h *Handler) Delete(c *app.Context, req api.IDPathRequest) (api.StatusResponse, error)
- func (h *Handler) FetchPricing(c *app.Context, req FetchPricingRequest) (FetchPricingResponse, error)
- func (h *Handler) Get(c *app.Context, req api.IDPathRequest) (models.ModelConfig, error)
- func (h *Handler) List(c *app.Context, req ListRequest) (api.PaginatedResponse[models.ModelConfig], error)
- func (h *Handler) Sync(c *app.Context, _ api.EmptyRequest) (SyncResponse, error)
- func (h *Handler) Update(c *app.Context, req UpdateRequest) (models.ModelConfig, error)
- type ListRequest
- type PriceCandidate
- type PricingRecommendation
- type PricingUpdate
- type PricingValues
- type SyncResponse
- type UpdateRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ApplyPricingRequest ¶
type ApplyPricingRequest struct {
Updates []PricingUpdate `json:"updates" binding:"required"`
}
type ApplyPricingResponse ¶
type ApplyPricingResponse struct {
Updated int `json:"updated"`
}
type CreateRequest ¶
type FetchPricingRequest ¶
type FetchPricingRequest struct {
Source string `form:"source"` // "" = all, "basellm", "models.dev"
}
type FetchPricingResponse ¶
type FetchPricingResponse struct {
Matches []PricingRecommendation `json:"matches"`
UnmatchedModels []string `json:"unmatched_models"`
SourceErrors map[string]string `json:"source_errors,omitempty"`
}
type Handler ¶
func (*Handler) ApplyPricing ¶
func (h *Handler) ApplyPricing(c *app.Context, req ApplyPricingRequest) (ApplyPricingResponse, error)
func (*Handler) Create ¶
func (h *Handler) Create(c *app.Context, req CreateRequest) (api.Created[models.ModelConfig], error)
func (*Handler) Delete ¶
func (h *Handler) Delete(c *app.Context, req api.IDPathRequest) (api.StatusResponse, error)
func (*Handler) FetchPricing ¶
func (h *Handler) FetchPricing(c *app.Context, req FetchPricingRequest) (FetchPricingResponse, error)
func (*Handler) Get ¶
func (h *Handler) Get(c *app.Context, req api.IDPathRequest) (models.ModelConfig, error)
func (*Handler) List ¶
func (h *Handler) List(c *app.Context, req ListRequest) (api.PaginatedResponse[models.ModelConfig], error)
func (*Handler) Sync ¶
func (h *Handler) Sync(c *app.Context, _ api.EmptyRequest) (SyncResponse, error)
func (*Handler) Update ¶
func (h *Handler) Update(c *app.Context, req UpdateRequest) (models.ModelConfig, error)
type ListRequest ¶
type ListRequest struct {
api.PaginationQuery
Search string `form:"search"`
PriceFilter string `form:"price_filter"`
}
type PriceCandidate ¶ added in v0.0.6
type PriceCandidate struct {
Source string `json:"source"`
Provider string `json:"provider"`
MatchType string `json:"match_type"`
MatchedName string `json:"matched_name"`
Price PricingValues `json:"price"`
}
type PricingRecommendation ¶ added in v0.0.6
type PricingRecommendation struct {
ModelID uint `json:"model_id"`
ModelName string `json:"model_name"`
Current PricingValues `json:"current"`
HasPrice bool `json:"has_price"`
Recommended PricingValues `json:"recommended"`
Provenance string `json:"provenance"`
Confidence string `json:"confidence"`
ReviewReasons []string `json:"review_reasons,omitempty"`
HasChange bool `json:"has_change"`
Candidates []PriceCandidate `json:"candidates"`
}
type PricingUpdate ¶
type PricingValues ¶
type SyncResponse ¶
type UpdateRequest ¶
type UpdateRequest struct {
ID string `uri:"id" binding:"required"`
Fields map[string]any `json:"-"`
}
func (*UpdateRequest) SetBodyMap ¶
func (r *UpdateRequest) SetBodyMap(fields map[string]any)
Source Files
¶
Click to show internal directories.
Click to hide internal directories.