Skip to content

Commit a50d1db

Browse files
authored
feat: Add typing for completion responses related to logprobs (#217)
1 parent e35014d commit a50d1db

1 file changed

Lines changed: 18 additions & 1 deletion

File tree

openapi.yaml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8486,6 +8486,12 @@ components:
84868486
- tool_calls
84878487
- function_call
84888488

8489+
TopLogprobs:
8490+
description: Top log probabilities for the tokens.
8491+
type: object
8492+
additionalProperties:
8493+
type: number
8494+
84898495
LogprobsPart:
84908496
type: object
84918497
properties:
@@ -8504,6 +8510,8 @@ components:
85048510
items:
85058511
type: number
85068512
description: List of token log probabilities
8513+
top_logprobs:
8514+
$ref: '#/components/schemas/TopLogprobs'
85078515

85088516
PromptPart:
85098517
type: array
@@ -8659,6 +8667,7 @@ components:
86598667
choices:
86608668
$ref: '#/components/schemas/CompletionChoicesData'
86618669
prompt:
8670+
description: When `echo` is true, the prompt is included in the response. Additionally, when `logprobs` is also provided, log probability information is provided on the prompt.
86628671
$ref: '#/components/schemas/PromptPart'
86638672
usage:
86648673
$ref: '#/components/schemas/UsageData'
@@ -8674,6 +8683,7 @@ components:
86748683
- choices
86758684
- usage
86768685
- created
8686+
- prompt
86778687
- model
86788688
- object
86798689

@@ -8791,6 +8801,8 @@ components:
87918801
allOf:
87928802
- nullable: true
87938803
- $ref: '#/components/schemas/LogprobsPart'
8804+
top_logprobs:
8805+
$ref: '#/components/schemas/TopLogprobs'
87948806
ChatCompletionMessage:
87958807
type: object
87968808
required: [role, content]
@@ -9279,14 +9291,17 @@ components:
92799291
type: integer
92809292
model:
92819293
type: string
9294+
prompt:
9295+
description: When `echo` is true, the prompt is included in the response. Additionally, when `logprobs` is also provided, log probability information is provided on the prompt.
9296+
$ref: '#/components/schemas/PromptPart'
92829297
object:
92839298
description: The object type, which is always `chat.completion`.
92849299
const: chat.completion
92859300
warnings:
92869301
type: array
92879302
items:
92889303
$ref: '#/components/schemas/InferenceWarning'
9289-
required: [choices, id, created, model, object]
9304+
required: [choices, id, created, model, object, prompt]
92909305

92919306
ChatCompletionStream:
92929307
oneOf:
@@ -9331,6 +9346,8 @@ components:
93319346
logprobs:
93329347
type: number
93339348
nullable: true
9349+
top_logprobs:
9350+
$ref: '#/components/schemas/TopLogprobs'
93349351
seed:
93359352
type: integer
93369353
nullable: true

0 commit comments

Comments
 (0)