Skip to content

sdk==0.1.37

Choose a tag to compare

@github-actions github-actions released this 27 Nov 22:20

langgraph-sdk 0.1.37

Summary of Changes

  • Added new EventSource class to handle Server-Sent Events (SSE) with better line splitting according to the SSE specification
  • Improved the handling of SSE events in the Client.stream methods to ensure proper parsing of newlines (\n, \r, \r\n)

Detailed Changes

EventSource

  • Added a new EventSource class that extends the httpx_sse.EventSource class with custom implementations for SSE event parsing
  • Implemented more robust line splitting that correctly handles different types of newline characters (\n, \r, \r\n) as per the SSE specification
  • Added utility functions aiter_lines_raw and iter_lines_raw to process response streams properly
  • Created BytesLineDecoder for incremental line parsing with proper newline handling

Client.stream

  • Modified both sync and async versions of the stream method to use the new custom EventSource class
  • Updated SSE event iteration to work with the improved line splitting implementation
  • These changes ensure more reliable event streaming, especially with servers that use different line ending conventions