Jaa


ChatConversationEvaluator.CanRenderAsync Method

Definition

Determines if there is sufficient tokenBudget remaining to render the supplied message as part of the evaluation prompt that this IEvaluator uses.

protected:
 virtual System::Threading::Tasks::ValueTask<bool> CanRenderAsync(Microsoft::Extensions::AI::ChatMessage ^ message, int % tokenBudget, Microsoft::Extensions::AI::Evaluation::ChatConfiguration ^ chatConfiguration, System::Threading::CancellationToken cancellationToken);
protected virtual System.Threading.Tasks.ValueTask<bool> CanRenderAsync (Microsoft.Extensions.AI.ChatMessage message, ref int tokenBudget, Microsoft.Extensions.AI.Evaluation.ChatConfiguration chatConfiguration, System.Threading.CancellationToken cancellationToken);
abstract member CanRenderAsync : Microsoft.Extensions.AI.ChatMessage * int * Microsoft.Extensions.AI.Evaluation.ChatConfiguration * System.Threading.CancellationToken -> System.Threading.Tasks.ValueTask<bool>
override this.CanRenderAsync : Microsoft.Extensions.AI.ChatMessage * int * Microsoft.Extensions.AI.Evaluation.ChatConfiguration * System.Threading.CancellationToken -> System.Threading.Tasks.ValueTask<bool>
Protected Overridable Function CanRenderAsync (message As ChatMessage, ByRef tokenBudget As Integer, chatConfiguration As ChatConfiguration, cancellationToken As CancellationToken) As ValueTask(Of Boolean)

Parameters

message
ChatMessage

A 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.

tokenBudget
Int32

The remaining number of tokens available for the rendering additional content as part of the evaluation prompt.

chatConfiguration
ChatConfiguration

A ChatConfiguration that specifies the IChatClient and the IEvaluationTokenCounter that this IEvaluator uses to perform the evaluation.

cancellationToken
CancellationToken

A CancellationToken that can cancel the operation.

Returns

true if there is sufficient tokenBudget remaining to render the supplied message as part of the evaluation prompt; false otherwise.

Applies to