ResponseContext.GetHistoryAsync(CancellationToken) Method

Definition

Resolves and returns the conversation history items for the current request. History is fetched from the provider using previous_response_id and/or conversation context. Items are returned in ascending (chronological) order. Results are cached after the first call.

public virtual System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyList<Azure.AI.AgentServer.Responses.Models.OutputItem>> GetHistoryAsync(System.Threading.CancellationToken cancellationToken = default);
abstract member GetHistoryAsync : System.Threading.CancellationToken -> System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyList<Azure.AI.AgentServer.Responses.Models.OutputItem>>
override this.GetHistoryAsync : System.Threading.CancellationToken -> System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyList<Azure.AI.AgentServer.Responses.Models.OutputItem>>
Public Overridable Function GetHistoryAsync (Optional cancellationToken As CancellationToken = Nothing) As Task(Of IReadOnlyList(Of OutputItem))

Parameters

cancellationToken
CancellationToken

A token to cancel the operation.

Returns

The resolved history items, or an empty list if no conversation context exists.

Applies to