-
Notifications
You must be signed in to change notification settings - Fork 64
/
setting.go
29 lines (25 loc) · 1016 Bytes
/
setting.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package provider
type Setting struct {
CreatedAt int64 `json:"createdAt"`
UpdatedAt int64 `json:"updatedAt"`
Provider string `json:"provider"`
Setting map[string]string `json:"setting,omitempty"`
Id string `json:"id"`
Name string `json:"name"`
AllowedModels []string `json:"allowedModels"`
CostMap *CostMap `json:"costMap"`
}
type CostMap struct {
PromptCostPerModel map[string]float64 `json:"promptCostPerModel"`
CompletionCostPerModel map[string]float64 `json:"completionCostPerModel"`
}
func (s *Setting) GetParam(key string) string {
return s.Setting[key]
}
type UpdateSetting struct {
UpdatedAt int64 `json:"updatedAt"`
Setting map[string]string `json:"setting,omitempty"`
Name *string `json:"name"`
AllowedModels *[]string `json:"allowedModels,omitempty"`
CostMap *CostMap `json:"costMap,omitempty"`
}