-
Notifications
You must be signed in to change notification settings - Fork 0
/
model_embedding_and_chunk.go
230 lines (191 loc) · 6.11 KB
/
model_embedding_and_chunk.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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
/*
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"
)
// EmbeddingAndChunk struct for EmbeddingAndChunk
type EmbeddingAndChunk struct {
UserFileId int32 `json:"user_file_id"`
ChunkIndex NullableInt32 `json:"chunk_index"`
SourceContent string `json:"source_content"`
Embedding []float32 `json:"embedding"`
ContentMetadata map[string]interface{} `json:"content_metadata"`
}
// NewEmbeddingAndChunk instantiates a new EmbeddingAndChunk object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewEmbeddingAndChunk(userFileId int32, chunkIndex NullableInt32, sourceContent string, embedding []float32, contentMetadata map[string]interface{}) *EmbeddingAndChunk {
this := EmbeddingAndChunk{}
this.UserFileId = userFileId
this.ChunkIndex = chunkIndex
this.SourceContent = sourceContent
this.Embedding = embedding
this.ContentMetadata = contentMetadata
return &this
}
// NewEmbeddingAndChunkWithDefaults instantiates a new EmbeddingAndChunk object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewEmbeddingAndChunkWithDefaults() *EmbeddingAndChunk {
this := EmbeddingAndChunk{}
return &this
}
// GetUserFileId returns the UserFileId field value
func (o *EmbeddingAndChunk) GetUserFileId() int32 {
if o == nil {
var ret int32
return ret
}
return o.UserFileId
}
// GetUserFileIdOk returns a tuple with the UserFileId field value
// and a boolean to check if the value has been set.
func (o *EmbeddingAndChunk) GetUserFileIdOk() (*int32, bool) {
if o == nil {
return nil, false
}
return &o.UserFileId, true
}
// SetUserFileId sets field value
func (o *EmbeddingAndChunk) SetUserFileId(v int32) {
o.UserFileId = v
}
// GetChunkIndex returns the ChunkIndex field value
// If the value is explicit nil, the zero value for int32 will be returned
func (o *EmbeddingAndChunk) GetChunkIndex() int32 {
if o == nil || o.ChunkIndex.Get() == nil {
var ret int32
return ret
}
return *o.ChunkIndex.Get()
}
// GetChunkIndexOk returns a tuple with the ChunkIndex field value
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *EmbeddingAndChunk) GetChunkIndexOk() (*int32, bool) {
if o == nil {
return nil, false
}
return o.ChunkIndex.Get(), o.ChunkIndex.IsSet()
}
// SetChunkIndex sets field value
func (o *EmbeddingAndChunk) SetChunkIndex(v int32) {
o.ChunkIndex.Set(&v)
}
// GetSourceContent returns the SourceContent field value
func (o *EmbeddingAndChunk) GetSourceContent() string {
if o == nil {
var ret string
return ret
}
return o.SourceContent
}
// GetSourceContentOk returns a tuple with the SourceContent field value
// and a boolean to check if the value has been set.
func (o *EmbeddingAndChunk) GetSourceContentOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.SourceContent, true
}
// SetSourceContent sets field value
func (o *EmbeddingAndChunk) SetSourceContent(v string) {
o.SourceContent = v
}
// GetEmbedding returns the Embedding field value
// If the value is explicit nil, the zero value for []float32 will be returned
func (o *EmbeddingAndChunk) GetEmbedding() []float32 {
if o == nil {
var ret []float32
return ret
}
return o.Embedding
}
// GetEmbeddingOk returns a tuple with the Embedding field value
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *EmbeddingAndChunk) GetEmbeddingOk() ([]float32, bool) {
if o == nil || isNil(o.Embedding) {
return nil, false
}
return o.Embedding, true
}
// SetEmbedding sets field value
func (o *EmbeddingAndChunk) SetEmbedding(v []float32) {
o.Embedding = v
}
// GetContentMetadata returns the ContentMetadata field value
// If the value is explicit nil, the zero value for map[string]interface{} will be returned
func (o *EmbeddingAndChunk) GetContentMetadata() map[string]interface{} {
if o == nil {
var ret map[string]interface{}
return ret
}
return o.ContentMetadata
}
// GetContentMetadataOk returns a tuple with the ContentMetadata field value
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *EmbeddingAndChunk) GetContentMetadataOk() (map[string]interface{}, bool) {
if o == nil || isNil(o.ContentMetadata) {
return map[string]interface{}{}, false
}
return o.ContentMetadata, true
}
// SetContentMetadata sets field value
func (o *EmbeddingAndChunk) SetContentMetadata(v map[string]interface{}) {
o.ContentMetadata = v
}
func (o EmbeddingAndChunk) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if true {
toSerialize["user_file_id"] = o.UserFileId
}
if true {
toSerialize["chunk_index"] = o.ChunkIndex.Get()
}
if true {
toSerialize["source_content"] = o.SourceContent
}
if o.Embedding != nil {
toSerialize["embedding"] = o.Embedding
}
if o.ContentMetadata != nil {
toSerialize["content_metadata"] = o.ContentMetadata
}
return json.Marshal(toSerialize)
}
type NullableEmbeddingAndChunk struct {
value *EmbeddingAndChunk
isSet bool
}
func (v NullableEmbeddingAndChunk) Get() *EmbeddingAndChunk {
return v.value
}
func (v *NullableEmbeddingAndChunk) Set(val *EmbeddingAndChunk) {
v.value = val
v.isSet = true
}
func (v NullableEmbeddingAndChunk) IsSet() bool {
return v.isSet
}
func (v *NullableEmbeddingAndChunk) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableEmbeddingAndChunk(val *EmbeddingAndChunk) *NullableEmbeddingAndChunk {
return &NullableEmbeddingAndChunk{value: val, isSet: true}
}
func (v NullableEmbeddingAndChunk) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableEmbeddingAndChunk) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}