ChatConversationEvaluator.CanRenderAsync Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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.