Skip to content

Commit df46b87

Browse files
authored
fix: declare a JSON 200 for intern chat so the Python SDK compiles (#875)
2 parents 400381b + 083835d commit df46b87

2 files changed

Lines changed: 20 additions & 0 deletions

File tree

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
overlay: 1.0.0
2+
x-speakeasy-jsonpath: rfc9535
3+
info:
4+
title: Give the intern chat completion a JSON 200 sibling for the Python generator
5+
version: 0.0.0
6+
actions:
7+
- target: $.paths["/interns/{internId}/chat/completions"].post.responses["200"].content
8+
description: >-
9+
The public spec declares only a text/event-stream 200 for this operation.
10+
With sseFlatResponse enabled, the Python generator annotates the method as
11+
returning the flattened chunk while emitting an EventStream body, which
12+
fails pyright and mypy and blocks every release. Declaring a JSON
13+
representation of the same chunk restores the supported SSE-overload
14+
shape so the generated method is typed as the union. The server still
15+
streams every response.
16+
update:
17+
application/json:
18+
schema:
19+
$ref: '#/components/schemas/InternChatCompletionChunk'

‎.speakeasy/workflow.yaml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ sources:
1212
- location: .speakeasy/overlays/boolean-query-params.overlay.yaml
1313
- location: .speakeasy/overlays/fix-nullable-pagination.overlay.yaml
1414
- location: .speakeasy/overlays/deprecated-beta-responses-alias.overlay.yaml
15+
- location: .speakeasy/overlays/intern-chat-json-response.overlay.yaml
1516
output: .speakeasy/out.openapi.yaml
1617
registry:
1718
location: registry.speakeasyapi.dev/openrouter/sdk/open-router-chat-completions-api

0 commit comments

Comments
 (0)