Home / Companies / Speakeasy / Blog / Post Details
Content Deep Dive

Enhanced Server-Sent Events support

Blog post from Speakeasy

Post Details
Company
Date Published
Author
David Adler
Word Count
748
Language
English
Hacker News Points
-
Summary

SDKs have undergone significant improvements to enhance support for Server-Sent Events (SSE), which facilitate real-time data streaming to clients over a single HTTP connection, a crucial feature for AI and LLM services. These enhancements focus on eliminating boilerplate code and improving type safety, particularly for TypeScript, Python, Java, and C# SDKs. TypeScript and Python SDKs now automatically generate type-safe overloads for operations that handle both streaming and non-streaming responses, addressing previous issues with union types and manual type guards. Additionally, new SSE response flattening in these languages simplifies access by abstracting unnecessary metadata, allowing developers to access response content directly. C# SDKs now fully support SSE, enabling streaming capabilities for .NET applications, while Java SDKs can utilize for-each iteration for more straightforward processing of SSE streams, thereby eliminating the need for manual iterator handling and streamlining the code.