FunctionInvokingRealtimeClientSession class

A RealtimeClientSession that automatically invokes functions requested by the model over the server-message stream.

When a ResponseOutputItemRealtimeServerMessage with type RealtimeServerMessageType.responseOutputItemDone carries one or more FunctionCallContent, the matching AIFunction is invoked and a FunctionResultContent is sent back to the inner session, repeating until the model stops requesting functions or a stop condition is met.

This is an experimental feature.

Implemented types
Annotations
  • @Source(name: 'FunctionInvokingRealtimeClientSession.cs', namespace: 'Microsoft.Extensions.AI', repository: 'dotnet/extensions', path: 'src/Libraries/Microsoft.Extensions.AI/Realtime/', commit: '2e537166e4231e50cceb66832b9dfd1382e24d1b')

Constructors

FunctionInvokingRealtimeClientSession(RealtimeClientSession _innerSession, FunctionInvokingRealtimeClient _client)
Creates a new FunctionInvokingRealtimeClientSession wrapping innerSession and using client for configuration.

Properties

hashCode int
The hash code for this object.
no setterinherited
options RealtimeSessionOptions?
The current session options.
no setteroverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

disposeAsync() Future<void>
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources asynchronously.
override
getService<T>({Object? key}) → T?
Asks the session for an object of the specified type T.
override
getStreamingResponse({CancellationToken? cancellationToken}) Stream<RealtimeServerMessage>
Streams the response messages generated by the session.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
send(RealtimeClientMessage message, {CancellationToken? cancellationToken}) Future<void>
Sends a client message to the session.
override
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited