Skip to content

Commit

Permalink
fix chat completions stream response type
Browse files Browse the repository at this point in the history
  • Loading branch information
schnerd committed Jun 16, 2023
1 parent 8be079f commit aa031eb
Showing 1 changed file with 56 additions and 0 deletions.
56 changes: 56 additions & 0 deletions openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2293,6 +2293,7 @@ components:
type: integer
finish_reason:
type: string
enum: ["stop", "length"]
usage:
type: object
properties:
Expand Down Expand Up @@ -2369,6 +2370,7 @@ components:
content:
type: string
description: The contents of the message.
nullable: true
function_call:
type: object
description: The name and arguments of a function that should be called, as generated by the model.
Expand All @@ -2381,6 +2383,28 @@ components:
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.
required:
- role

ChatCompletionStreamResponseDelta:
type: object
properties:
role:
type: string
enum: ["system", "user", "assistant", "function"]
description: The role of the author of this message.
content:
type: string
description: The contents of the chunk message.
nullable: true
function_call:
type: object
description: The name and arguments of a function that should be called, as generated by the model.
properties:
name:
type: string
description: The name of the function to call.
arguments:
type: string
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.

CreateChatCompletionRequest:
type: object
Expand Down Expand Up @@ -2512,6 +2536,7 @@ components:
$ref: '#/components/schemas/ChatCompletionResponseMessage'
finish_reason:
type: string
enum: ["stop", "length", "function_call"]
usage:
type: object
properties:
Expand All @@ -2532,6 +2557,36 @@ components:
- model
- choices

CreateChatCompletionStreamResponse:
type: object
properties:
id:
type: string
object:
type: string
created:
type: integer
model:
type: string
choices:
type: array
items:
type: object
properties:
index:
type: integer
delta:
$ref: '#/components/schemas/ChatCompletionStreamResponseDelta'
finish_reason:
type: string
enum: ["stop", "length", "function_call"]
required:
- id
- object
- created
- model
- choices

CreateEditRequest:
type: object
properties:
Expand Down Expand Up @@ -2617,6 +2672,7 @@ components:
type: integer
finish_reason:
type: string
enum: ["stop", "length"]
usage:
type: object
properties:
Expand Down

0 comments on commit aa031eb

Please sign in to comment.