Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,12 @@
/docs/ @dotnet/dotnet-extensions-infra
/eng/ @dotnet/dotnet-extensions-infra

/src/Libraries/Microsoft.Extensions.AI.Evaluation @dotnet/dotnet-extensions-ai-evaluation
/src/Libraries/Microsoft.Extensions.AI.Evaluation.* @dotnet/dotnet-extensions-ai-evaluation
/test/Libraries/Microsoft.Extensions.AI.Evaluation.* @dotnet/dotnet-extensions-ai-evaluation

/src/Libraries/Microsoft.Extensions.AI @dotnet/dotnet-extensions-ai
/src/Libraries/Microsoft.Extensions.AI.Evaluation @dotnet/dotnet-extensions-ai-evaluation
/src/Libraries/Microsoft.Extensions.AI.* @dotnet/dotnet-extensions-ai
/test/Libraries/Microsoft.Extensions.AI @dotnet/dotnet-extensions-ai
/src/Libraries/Microsoft.Extensions.AI.Evaluation.* @dotnet/dotnet-extensions-ai-evaluation
/test/Libraries/Microsoft.Extensions.AI.* @dotnet/dotnet-extensions-ai
/test/Libraries/Microsoft.Extensions.AI.Evaluation.* @dotnet/dotnet-extensions-ai-evaluation

/src/Libraries/Microsoft.Extensions.Caching.Hybrid @dotnet/dotnet-extensions-caching-hybrid
/src/Libraries/Microsoft.Extensions.Caching.Hybrid.* @dotnet/dotnet-extensions-caching-hybrid
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,18 +214,20 @@ await ParseEvaluationResponseAsync(
/// as part of the evaluation prompt.
/// </param>
/// <param name="tokenBudget">
/// The remaining number of tokens available for the rendering additional content as part of the evaluation prompt.
/// The number of tokens available for the rendering additional content as part of the evaluation prompt.
/// </param>
/// <param name="chatConfiguration">
/// A <see cref="ChatConfiguration"/> that specifies the <see cref="IChatClient"/> and the
/// <see cref="IEvaluationTokenCounter"/> that this <see cref="IEvaluator"/> uses to perform the evaluation.
/// </param>
/// <param name="cancellationToken">A <see cref="CancellationToken"/> that can cancel the operation.</param>
/// <returns>
/// A tuple containing a boolean indicating if there is sufficient <paramref name="tokenBudget"/> remaining to render the supplied
/// <paramref name="message"/> as part of the evaluation prompt and an int returning the remaining token budget.
/// A tuple containing a <see langword="bool"/> indicating whether there is sufficient
/// <paramref name="tokenBudget"/> remaining to render the supplied <paramref name="message"/> as part of the
/// evaluation prompt, and an <see langword="int"/> containing the remaining token budget that would be available
/// once this <paramref name="message"/> is rendered.
/// </returns>
protected virtual ValueTask<(bool tokenBudgetSufficient, int tokenBudgetRemaining)> CanRenderAsync(
protected virtual ValueTask<(bool canRender, int remainingTokenBudget)> CanRenderAsync(
ChatMessage message,
int tokenBudget,
ChatConfiguration chatConfiguration,
Expand Down Expand Up @@ -265,8 +267,7 @@ await ParseEvaluationResponseAsync(
}
else
{
tokenBudget -= tokenCount;
return new ValueTask<(bool, int)>((true, tokenBudget));
return new ValueTask<(bool, int)>((true, tokenBudget - tokenCount));
}
}

Expand Down