feat(BA-3948): Add client SDK support for events APIs
#8132
+339
−2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Resolves #8131 (BA-3948)
This pull request introduces a new client SDK
Eventsclass and associated CLI commands to enable real-time streaming of session/kernel lifecycle events and background task events via Server-Sent Events (SSE). It also integrates theEventsAPI into the session client and makes some minor dependency import fixes.Event Streaming Functionality
Eventsclass insrc/ai/backend/client/func/events.pyto provide async methods for subscribing to session and background task events using SSE.EventsAPI in theAsyncSessionclass, making it accessible viasession.Events. [1] [2] [3]CLI Enhancements
eventsgroup insrc/ai/backend/client/cli/events.py:listen-session: Stream session/kernel events with filtering and wait options.listen-background-task: Stream background task events for a given task ID. [1] [2]Documentation
.feature.mdentry describing the new event streaming capabilities for both SDK and CLI.Dependency Import Fixes
ClosingErrorinvalkey_client/client.pyandTimeoutErrorinvalkey_stream/client.pyto use the correct module paths. [1] [2] [3]Checklist: (if applicable)
ai.backend.testdocsdirectory