Skip to content

Add IObservable support for RealtimeConversationSession updates #363

Closed as not planned
@paulirwin

Description

@paulirwin

Confirm this is a feature request for the .NET library and not the underlying OpenAI API

  • This is a feature request for the .NET library

Describe the feature or improvement you are requesting

It would be great if we could get an IObservable<ConversationUpdate> API for RealtimeConversationSession for use cases where a stateful subscription to an observable makes more sense than using ReceiveUpdatesAsync. I am currently working around this by using the System.Interactive.Async package and converting the IAsyncEnumerable to an observable with the code below, but it seems like it possibly could be more efficient if it didn't have to do all the async enumerable stuff under the hood, just to be converted back to an observable. And, that would remove the need for this extra NuGet package.

Workaround:

_streamSubscription = _session.ReceiveUpdatesAsync(cancellationToken) .ToObservable() .Subscribe(update => { ... });

Additional context

No response

Metadata

Metadata

Assignees

Labels

feature-requestCategory: A new feature or enhancement to an existing feature is being requested.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions