Compartir a través de


ChatConversationEvaluator.RenderAsync Method

Definition

Overloads

RenderAsync(ChatMessage, CancellationToken)

Renders the supplied message to a string that can be included as part of the evaluation prompt that this IEvaluator uses.

RenderAsync(ChatResponse, CancellationToken)

Renders the supplied response to a string that can be included as part of the evaluation prompt that this IEvaluator uses.

RenderAsync(ChatMessage, CancellationToken)

Renders the supplied message to a string that can be included as part of the evaluation prompt that this IEvaluator uses.

protected:
 virtual System::Threading::Tasks::ValueTask<System::String ^> RenderAsync(Microsoft::Extensions::AI::ChatMessage ^ message, System::Threading::CancellationToken cancellationToken);
protected virtual System.Threading.Tasks.ValueTask<string> RenderAsync(Microsoft.Extensions.AI.ChatMessage message, System.Threading.CancellationToken cancellationToken);
abstract member RenderAsync : Microsoft.Extensions.AI.ChatMessage * System.Threading.CancellationToken -> System.Threading.Tasks.ValueTask<string>
override this.RenderAsync : Microsoft.Extensions.AI.ChatMessage * System.Threading.CancellationToken -> System.Threading.Tasks.ValueTask<string>
Protected Overridable Function RenderAsync (message As ChatMessage, cancellationToken As CancellationToken) As ValueTask(Of String)

Parameters

message
ChatMessage

Message that is part of the conversation history for the response being evaluated and that is to be rendered as part of the evaluation prompt.

cancellationToken
CancellationToken

A CancellationToken that can cancel the operation.

Returns

A string representation of the supplied message that can be included as part of the evaluation prompt.

Applies to

RenderAsync(ChatResponse, CancellationToken)

Renders the supplied response to a string that can be included as part of the evaluation prompt that this IEvaluator uses.

protected:
 virtual System::Threading::Tasks::ValueTask<System::String ^> RenderAsync(Microsoft::Extensions::AI::ChatResponse ^ response, System::Threading::CancellationToken cancellationToken);
protected virtual System.Threading.Tasks.ValueTask<string> RenderAsync(Microsoft.Extensions.AI.ChatResponse response, System.Threading.CancellationToken cancellationToken);
abstract member RenderAsync : Microsoft.Extensions.AI.ChatResponse * System.Threading.CancellationToken -> System.Threading.Tasks.ValueTask<string>
override this.RenderAsync : Microsoft.Extensions.AI.ChatResponse * System.Threading.CancellationToken -> System.Threading.Tasks.ValueTask<string>
Protected Overridable Function RenderAsync (response As ChatResponse, cancellationToken As CancellationToken) As ValueTask(Of String)

Parameters

response
ChatResponse

Chat response being evaluated and that is to be rendered as part of the evaluation prompt.

cancellationToken
CancellationToken

A CancellationToken that can cancel the operation.

Returns

A string representation of the supplied response that can be included as part of the evaluation prompt.

Remarks

The default implementation uses RenderAsync(ChatMessage, CancellationToken) to render each message in the response.

Applies to