File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -112,6 +112,9 @@ def parser(obj: CreateEmbeddingResponse) -> CreateEmbeddingResponse:
112
112
# don't modify the response object if a user explicitly asked for a format
113
113
return obj
114
114
115
+ if not obj .data :
116
+ raise ValueError ("No embedding data received" )
117
+
115
118
for embedding in obj .data :
116
119
data = cast (object , embedding .embedding )
117
120
if not isinstance (data , str ):
@@ -228,6 +231,9 @@ def parser(obj: CreateEmbeddingResponse) -> CreateEmbeddingResponse:
228
231
# don't modify the response object if a user explicitly asked for a format
229
232
return obj
230
233
234
+ if not obj .data :
235
+ raise ValueError ("No embedding data received" )
236
+
231
237
for embedding in obj .data :
232
238
data = cast (object , embedding .embedding )
233
239
if not isinstance (data , str ):
You can’t perform that action at this time.
0 commit comments