Skip to content

Commit aa031eb

Browse files
committed
fix chat completions stream response type
1 parent 8be079f commit aa031eb

File tree

1 file changed

+56
-0
lines changed

1 file changed

+56
-0
lines changed

openapi.yaml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2293,6 +2293,7 @@ components:
22932293
type: integer
22942294
finish_reason:
22952295
type: string
2296+
enum: ["stop", "length"]
22962297
usage:
22972298
type: object
22982299
properties:
@@ -2369,6 +2370,7 @@ components:
23692370
content:
23702371
type: string
23712372
description: The contents of the message.
2373+
nullable: true
23722374
function_call:
23732375
type: object
23742376
description: The name and arguments of a function that should be called, as generated by the model.
@@ -2381,6 +2383,28 @@ components:
23812383
description: The arguments to call the function with, as generated by the model in JSON format. Note that the model does not always generate valid JSON, and may hallucinate parameters not defined by your function schema. Validate the arguments in your code before calling your function.
23822384
required:
23832385
- role
2386+
2387+
ChatCompletionStreamResponseDelta:
2388+
type: object
2389+
properties:
2390+
role:
2391+
type: string
2392+
enum: ["system", "user", "assistant", "function"]
2393+
description: The role of the author of this message.
2394+
content:
2395+
type: string
2396+
description: The contents of the chunk message.
2397+
nullable: true
2398+
function_call:
2399+
type: object
2400+
description: The name and arguments of a function that should be called, as generated by the model.
2401+
properties:
2402+
name:
2403+
type: string
2404+
description: The name of the function to call.
2405+
arguments:
2406+
type: string
2407+
description: The arguments to call the function with, as generated by the model in JSON format. Note that the model does not always generate valid JSON, and may hallucinate parameters not defined by your function schema. Validate the arguments in your code before calling your function.
23842408

23852409
CreateChatCompletionRequest:
23862410
type: object
@@ -2512,6 +2536,7 @@ components:
25122536
$ref: '#/components/schemas/ChatCompletionResponseMessage'
25132537
finish_reason:
25142538
type: string
2539+
enum: ["stop", "length", "function_call"]
25152540
usage:
25162541
type: object
25172542
properties:
@@ -2532,6 +2557,36 @@ components:
25322557
- model
25332558
- choices
25342559

2560+
CreateChatCompletionStreamResponse:
2561+
type: object
2562+
properties:
2563+
id:
2564+
type: string
2565+
object:
2566+
type: string
2567+
created:
2568+
type: integer
2569+
model:
2570+
type: string
2571+
choices:
2572+
type: array
2573+
items:
2574+
type: object
2575+
properties:
2576+
index:
2577+
type: integer
2578+
delta:
2579+
$ref: '#/components/schemas/ChatCompletionStreamResponseDelta'
2580+
finish_reason:
2581+
type: string
2582+
enum: ["stop", "length", "function_call"]
2583+
required:
2584+
- id
2585+
- object
2586+
- created
2587+
- model
2588+
- choices
2589+
25352590
CreateEditRequest:
25362591
type: object
25372592
properties:
@@ -2617,6 +2672,7 @@ components:
26172672
type: integer
26182673
finish_reason:
26192674
type: string
2675+
enum: ["stop", "length"]
26202676
usage:
26212677
type: object
26222678
properties:

0 commit comments

Comments
 (0)