-
Notifications
You must be signed in to change notification settings - Fork 0
/
options.go
84 lines (71 loc) · 1.55 KB
/
options.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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
package pkg_ai
type Options interface {
Apply(*Config)
}
type WithConfig func(*Config)
func (w WithConfig) Apply(c *Config) {
w(c)
}
func WithBaiChuanConfig(url, key string) WithConfig {
return func(c *Config) {
c.BaiChuanUrl = url
c.BaiChuanKey = key
}
}
func WithBaiDuConfig(url, clientId, clientSecret string) WithConfig {
return func(c *Config) {
c.BaiDuUrl = url
c.BaiDuClientId = clientId
c.BaiDuClientSecret = clientSecret
}
}
func WithGlmConfig(url, key string) WithConfig {
return func(c *Config) {
c.GlmUrl = url
c.GlmKey = key
}
}
func WithHunYuanConfig(url, clientId, clientSecret string) WithConfig {
return func(c *Config) {
c.HunyuanUrl = url
c.HunyuanClientId = clientId
c.HunyuanClientSecret = clientSecret
}
}
func WithMinimaxiConfig(url, key string) WithConfig {
return func(c *Config) {
c.MinimaxiUrl = url
c.MinimaxiKey = key
}
}
func WithMoonshotConfig(url, key string) WithConfig {
return func(c *Config) {
c.MoonshotUrl = url
c.MoonshotKey = key
}
}
func WithQwenConfig(url, key string) WithConfig {
return func(c *Config) {
c.QwenUrl = url
c.QwenKey = key
}
}
func WithSensenovaConfig(url, clientId, clientSecret string) WithConfig {
return func(c *Config) {
c.SensenovaUrl = url
c.SensenovaClientId = clientId
c.SensenovaClientSecret = clientSecret
}
}
func WithVolcConfig(url, key string) WithConfig {
return func(c *Config) {
c.VolcUrl = url
c.VolcKey = key
}
}
func WithXfYunConfig(url, key string) WithConfig {
return func(c *Config) {
c.XfYunUrl = url
c.XfYunKey = key
}
}