mirror of
https://github.com/aljazceru/opencode.git
synced 2025-12-20 09:14:22 +01:00
add sse streaming to sdk
This commit is contained in:
@@ -41,6 +41,7 @@ func (r *EventService) ListStreaming(ctx context.Context, opts ...option.Request
|
||||
err error
|
||||
)
|
||||
opts = append(r.Options[:], opts...)
|
||||
opts = append([]option.RequestOption{option.WithHeader("Accept", "text/event-stream")}, opts...)
|
||||
path := "event"
|
||||
err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &raw, opts...)
|
||||
return ssestream.NewStream[EventListResponse](ssestream.NewDecoder(raw), err)
|
||||
|
||||
Reference in New Issue
Block a user