2424 async_to_streamed_response_wrapper ,
2525)
2626from .._base_client import make_request_options
27+ from .._decoders .jsonl import JSONLDecoder , AsyncJSONLDecoder
2728from ..types .event_list_response import EventListResponse
2829from ..types .event_watch_response import EventWatchResponse
2930
@@ -136,7 +137,7 @@ def watch(
136137 extra_query : Query | None = None ,
137138 extra_body : Body | None = None ,
138139 timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
139- ) -> EventWatchResponse :
140+ ) -> JSONLDecoder [ EventWatchResponse ] :
140141 """
141142 WatchEvents streams all requests events to the client
142143
@@ -173,7 +174,7 @@ def watch(
173174 extra_query : Query | None = None ,
174175 extra_body : Body | None = None ,
175176 timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
176- ) -> EventWatchResponse :
177+ ) -> JSONLDecoder [ EventWatchResponse ] :
177178 """
178179 WatchEvents streams all requests events to the client
179180
@@ -211,8 +212,8 @@ def watch(
211212 extra_query : Query | None = None ,
212213 extra_body : Body | None = None ,
213214 timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
214- ) -> EventWatchResponse :
215- extra_headers = {"Accept" : "application/connect+json " , ** (extra_headers or {})}
215+ ) -> JSONLDecoder [ EventWatchResponse ] :
216+ extra_headers = {"Accept" : "application/jsonl " , ** (extra_headers or {})}
216217 extra_headers = {
217218 ** strip_not_given (
218219 {
@@ -234,7 +235,8 @@ def watch(
234235 options = make_request_options (
235236 extra_headers = extra_headers , extra_query = extra_query , extra_body = extra_body , timeout = timeout
236237 ),
237- cast_to = EventWatchResponse ,
238+ cast_to = JSONLDecoder [EventWatchResponse ],
239+ stream = True ,
238240 )
239241
240242
@@ -344,7 +346,7 @@ async def watch(
344346 extra_query : Query | None = None ,
345347 extra_body : Body | None = None ,
346348 timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
347- ) -> EventWatchResponse :
349+ ) -> AsyncJSONLDecoder [ EventWatchResponse ] :
348350 """
349351 WatchEvents streams all requests events to the client
350352
@@ -381,7 +383,7 @@ async def watch(
381383 extra_query : Query | None = None ,
382384 extra_body : Body | None = None ,
383385 timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
384- ) -> EventWatchResponse :
386+ ) -> AsyncJSONLDecoder [ EventWatchResponse ] :
385387 """
386388 WatchEvents streams all requests events to the client
387389
@@ -419,8 +421,8 @@ async def watch(
419421 extra_query : Query | None = None ,
420422 extra_body : Body | None = None ,
421423 timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
422- ) -> EventWatchResponse :
423- extra_headers = {"Accept" : "application/connect+json " , ** (extra_headers or {})}
424+ ) -> AsyncJSONLDecoder [ EventWatchResponse ] :
425+ extra_headers = {"Accept" : "application/jsonl " , ** (extra_headers or {})}
424426 extra_headers = {
425427 ** strip_not_given (
426428 {
@@ -442,7 +444,8 @@ async def watch(
442444 options = make_request_options (
443445 extra_headers = extra_headers , extra_query = extra_query , extra_body = extra_body , timeout = timeout
444446 ),
445- cast_to = EventWatchResponse ,
447+ cast_to = AsyncJSONLDecoder [EventWatchResponse ],
448+ stream = True ,
446449 )
447450
448451
0 commit comments