You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/customize/runtime/server-sent-events.mdx
+20-4Lines changed: 20 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -287,12 +287,12 @@ for await (const event of response.chatStream) {
287
287
}
288
288
```
289
289
290
-
#### Alternative: Single method with Python overloads
290
+
#### Alternative: Single method with overloads
291
291
292
-
Instead of using URL fragments to create separate methods, you can define a single endpoint that supports both response types. Since `inferSSEOverload` defaults to `true` in your `gen.yaml`, Python SDKs will automatically generate a single overloaded method that provides type safety based on the `stream` parameter value:
292
+
Instead of using URL fragments to create separate methods, you can define a single endpoint that supports both response types. Since `inferSSEOverload` defaults to `true` in your `gen.yaml`, TypeScript and Python SDKs will automatically generate a single overloaded method that provides type safety based on the `stream` parameter value:
293
293
294
294
<Callout title="Note" type="info">
295
-
The `inferSSEOverload` feature is currently Python-specific, with support for other languages planned for future releases.
295
+
The `inferSSEOverload` feature is currently supported in TypeScript and Python, with support for other languages planned for future releases.
296
296
</Callout>
297
297
298
298
```yaml
@@ -337,7 +337,23 @@ components:
337
337
# SSE event schema
338
338
```
339
339
340
-
This generates type-safe Python methods:
340
+
This generates type-safe methods in both TypeScript and Python:
0 commit comments