Skip to content

Commit 8809e20

Browse files
authored
Mark all properties in "choices" as required
I'm not sure whether this is actually the case (please decline the PR if not!) but I would expect all keys of this object to be present in all responses (though of course logprobs is marked as sometimes having a `null` value). Making this change would enable nicer types, eg, `response.choices[0].text.length` rather than `response.choices[0].text?.length`
1 parent 0c901d9 commit 8809e20

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

openapi.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2261,6 +2261,11 @@ components:
22612261
type: array
22622262
items:
22632263
type: object
2264+
required:
2265+
- text
2266+
- index
2267+
- logprobs
2268+
- finish_reason
22642269
properties:
22652270
text:
22662271
type: string

0 commit comments

Comments
 (0)