@@ -157,6 +157,9 @@ type EmbeddingRequest struct {
157
157
Model EmbeddingModel `json:"model"`
158
158
User string `json:"user"`
159
159
EncodingFormat EmbeddingEncodingFormat `json:"encoding_format,omitempty"`
160
+ // Dimensions The number of dimensions the resulting output embeddings should have.
161
+ // Only supported in text-embedding-3 and later models.
162
+ Dimensions int `json:"dimensions,omitempty"`
160
163
}
161
164
162
165
func (r EmbeddingRequest ) Convert () EmbeddingRequest {
@@ -181,6 +184,9 @@ type EmbeddingRequestStrings struct {
181
184
// Currently, only "float" and "base64" are supported, however, "base64" is not officially documented.
182
185
// If not specified OpenAI will use "float".
183
186
EncodingFormat EmbeddingEncodingFormat `json:"encoding_format,omitempty"`
187
+ // Dimensions The number of dimensions the resulting output embeddings should have.
188
+ // Only supported in text-embedding-3 and later models.
189
+ Dimensions int `json:"dimensions,omitempty"`
184
190
}
185
191
186
192
func (r EmbeddingRequestStrings ) Convert () EmbeddingRequest {
@@ -189,6 +195,7 @@ func (r EmbeddingRequestStrings) Convert() EmbeddingRequest {
189
195
Model : r .Model ,
190
196
User : r .User ,
191
197
EncodingFormat : r .EncodingFormat ,
198
+ Dimensions : r .Dimensions ,
192
199
}
193
200
}
194
201
@@ -209,6 +216,9 @@ type EmbeddingRequestTokens struct {
209
216
// Currently, only "float" and "base64" are supported, however, "base64" is not officially documented.
210
217
// If not specified OpenAI will use "float".
211
218
EncodingFormat EmbeddingEncodingFormat `json:"encoding_format,omitempty"`
219
+ // Dimensions The number of dimensions the resulting output embeddings should have.
220
+ // Only supported in text-embedding-3 and later models.
221
+ Dimensions int `json:"dimensions,omitempty"`
212
222
}
213
223
214
224
func (r EmbeddingRequestTokens ) Convert () EmbeddingRequest {
@@ -217,6 +227,7 @@ func (r EmbeddingRequestTokens) Convert() EmbeddingRequest {
217
227
Model : r .Model ,
218
228
User : r .User ,
219
229
EncodingFormat : r .EncodingFormat ,
230
+ Dimensions : r .Dimensions ,
220
231
}
221
232
}
222
233
0 commit comments