Skip to content

Commit

Permalink
SpeziLLMOpenAI: set a text/event-stream schema for the chat/completions
Browse files Browse the repository at this point in the history
endpoint

This enables swift-openapi-generator to generate streamed responses.

See: openai/openai-openapi#311
  • Loading branch information
paulhdk committed Aug 27, 2024
1 parent 2096773 commit 5676f33
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Sources/SpeziLLMOpenAI/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ paths:
application/json:
schema:
$ref: "#/components/schemas/CreateChatCompletionResponse"
text/event-stream:
schema:
$ref: "#/components/schemas/CreateChatCompletionStreamResponse"

x-oaiMeta:
name: Create chat completion
Expand Down
3 changes: 3 additions & 0 deletions Tests/UITests/TestApp/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ paths:
application/json:
schema:
$ref: "#/components/schemas/CreateChatCompletionResponse"
text/event-stream:
schema:
$ref: "#/components/schemas/CreateChatCompletionStreamResponse"

x-oaiMeta:
name: Create chat completion
Expand Down

0 comments on commit 5676f33

Please sign in to comment.