IntelligenceX
Class

CopilotSession

Namespace IntelligenceX.Copilot
Assembly IntelligenceX
Implements
IDisposable
Modifiers sealed

Represents an active Copilot session.

Inheritance

  • Object
  • CopilotSession

Methods

public virtual Void Dispose() #
Returns: Void

Disposes the session and clears handlers.

public IDisposable OnEvent(Action<CopilotSessionEvent> handler) #
Returns: IDisposable

Subscribes to session events.

Parameters

handler System.Action{IntelligenceX.Copilot.CopilotSessionEvent}
Event handler.

Returns

A subscription token that should be disposed to unsubscribe.

public async Task<String> SendAndWaitAsync(CopilotMessageOptions options, Nullable<TimeSpan> timeout = null, CancellationToken cancellationToken = null) #
Returns: Task<String>

Sends a message and waits for the response.

Parameters

options IntelligenceX.Copilot.CopilotMessageOptions
Message options.
timeout System.Nullable{System.TimeSpan} = null
Optional timeout.
cancellationToken System.Threading.CancellationToken = null
Cancellation token.
public async Task<String> SendAsync(CopilotMessageOptions options, CancellationToken cancellationToken = null) #
Returns: Task<String>

Sends a message to the session.

Parameters

options IntelligenceX.Copilot.CopilotMessageOptions
Message options.
cancellationToken System.Threading.CancellationToken = null
Cancellation token.

Properties

public String SessionId { get; } #

Gets the session id.