-
Notifications
You must be signed in to change notification settings - Fork 0
/
model_embedding_generators_nullable.go
137 lines (115 loc) · 4.55 KB
/
model_embedding_generators_nullable.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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
/*
Carbon
Connect external data to LLMs, no matter the source.
API version: 1.0.0
*/
// Code generated by Konfig (https://konfigthis.com); DO NOT EDIT.
package carbon
import (
"encoding/json"
"fmt"
)
// EmbeddingGeneratorsNullable the model 'EmbeddingGeneratorsNullable'
type EmbeddingGeneratorsNullable string
// List of EmbeddingGeneratorsNullable
const (
EMBEDDINGGENERATORSNULLABLE_OPENAI EmbeddingGeneratorsNullable = "OPENAI"
EMBEDDINGGENERATORSNULLABLE_AZURE_OPENAI EmbeddingGeneratorsNullable = "AZURE_OPENAI"
EMBEDDINGGENERATORSNULLABLE_AZURE_ADA_LARGE_256 EmbeddingGeneratorsNullable = "AZURE_ADA_LARGE_256"
EMBEDDINGGENERATORSNULLABLE_AZURE_ADA_LARGE_1024 EmbeddingGeneratorsNullable = "AZURE_ADA_LARGE_1024"
EMBEDDINGGENERATORSNULLABLE_AZURE_ADA_LARGE_3072 EmbeddingGeneratorsNullable = "AZURE_ADA_LARGE_3072"
EMBEDDINGGENERATORSNULLABLE_AZURE_ADA_SMALL_512 EmbeddingGeneratorsNullable = "AZURE_ADA_SMALL_512"
EMBEDDINGGENERATORSNULLABLE_AZURE_ADA_SMALL_1536 EmbeddingGeneratorsNullable = "AZURE_ADA_SMALL_1536"
EMBEDDINGGENERATORSNULLABLE_COHERE_MULTILINGUAL_V3 EmbeddingGeneratorsNullable = "COHERE_MULTILINGUAL_V3"
EMBEDDINGGENERATORSNULLABLE_VERTEX_MULTIMODAL EmbeddingGeneratorsNullable = "VERTEX_MULTIMODAL"
EMBEDDINGGENERATORSNULLABLE_OPENAI_ADA_LARGE_256 EmbeddingGeneratorsNullable = "OPENAI_ADA_LARGE_256"
EMBEDDINGGENERATORSNULLABLE_OPENAI_ADA_LARGE_1024 EmbeddingGeneratorsNullable = "OPENAI_ADA_LARGE_1024"
EMBEDDINGGENERATORSNULLABLE_OPENAI_ADA_LARGE_3072 EmbeddingGeneratorsNullable = "OPENAI_ADA_LARGE_3072"
EMBEDDINGGENERATORSNULLABLE_OPENAI_ADA_SMALL_512 EmbeddingGeneratorsNullable = "OPENAI_ADA_SMALL_512"
EMBEDDINGGENERATORSNULLABLE_OPENAI_ADA_SMALL_1536 EmbeddingGeneratorsNullable = "OPENAI_ADA_SMALL_1536"
EMBEDDINGGENERATORSNULLABLE_SOLAR_1_MINI EmbeddingGeneratorsNullable = "SOLAR_1_MINI"
)
// All allowed values of EmbeddingGeneratorsNullable enum
var AllowedEmbeddingGeneratorsNullableEnumValues = []EmbeddingGeneratorsNullable{
"OPENAI",
"AZURE_OPENAI",
"AZURE_ADA_LARGE_256",
"AZURE_ADA_LARGE_1024",
"AZURE_ADA_LARGE_3072",
"AZURE_ADA_SMALL_512",
"AZURE_ADA_SMALL_1536",
"COHERE_MULTILINGUAL_V3",
"VERTEX_MULTIMODAL",
"OPENAI_ADA_LARGE_256",
"OPENAI_ADA_LARGE_1024",
"OPENAI_ADA_LARGE_3072",
"OPENAI_ADA_SMALL_512",
"OPENAI_ADA_SMALL_1536",
"SOLAR_1_MINI",
}
func (v *EmbeddingGeneratorsNullable) UnmarshalJSON(src []byte) error {
var value string
err := json.Unmarshal(src, &value)
if err != nil {
return err
}
enumTypeValue := EmbeddingGeneratorsNullable(value)
for _, existing := range AllowedEmbeddingGeneratorsNullableEnumValues {
if existing == enumTypeValue {
*v = enumTypeValue
return nil
}
}
return fmt.Errorf("%+v is not a valid EmbeddingGeneratorsNullable", value)
}
// NewEmbeddingGeneratorsNullableFromValue returns a pointer to a valid EmbeddingGeneratorsNullable
// for the value passed as argument, or an error if the value passed is not allowed by the enum
func NewEmbeddingGeneratorsNullableFromValue(v string) (*EmbeddingGeneratorsNullable, error) {
ev := EmbeddingGeneratorsNullable(v)
if ev.IsValid() {
return &ev, nil
} else {
return nil, fmt.Errorf("invalid value '%v' for EmbeddingGeneratorsNullable: valid values are %v", v, AllowedEmbeddingGeneratorsNullableEnumValues)
}
}
// IsValid return true if the value is valid for the enum, false otherwise
func (v EmbeddingGeneratorsNullable) IsValid() bool {
for _, existing := range AllowedEmbeddingGeneratorsNullableEnumValues {
if existing == v {
return true
}
}
return false
}
// Ptr returns reference to EmbeddingGeneratorsNullable value
func (v EmbeddingGeneratorsNullable) Ptr() *EmbeddingGeneratorsNullable {
return &v
}
type NullableEmbeddingGeneratorsNullable struct {
value *EmbeddingGeneratorsNullable
isSet bool
}
func (v NullableEmbeddingGeneratorsNullable) Get() *EmbeddingGeneratorsNullable {
return v.value
}
func (v *NullableEmbeddingGeneratorsNullable) Set(val *EmbeddingGeneratorsNullable) {
v.value = val
v.isSet = true
}
func (v NullableEmbeddingGeneratorsNullable) IsSet() bool {
return v.isSet
}
func (v *NullableEmbeddingGeneratorsNullable) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableEmbeddingGeneratorsNullable(val *EmbeddingGeneratorsNullable) *NullableEmbeddingGeneratorsNullable {
return &NullableEmbeddingGeneratorsNullable{value: val, isSet: true}
}
func (v NullableEmbeddingGeneratorsNullable) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableEmbeddingGeneratorsNullable) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}