Add tools support to sampling (#976)

This commit is contained in:
Stephen Toub 2025-11-20 09:52:23 -05:00 • committed by GitHub
commit 15139cc569
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -249,7 +249,7 @@ internal sealed partial class AIFunctionMcpServerTool : McpServerTool
{
AIContent aiContent => new()
{
Content = [aiContent.ToContent()],
Content = [aiContent.ToContentBlock()],
StructuredContent = structuredContent,
IsError = aiContent is ErrorContent
},
@ -491,7 +491,7 @@ internal sealed partial class AIFunctionMcpServerTool : McpServerTool
foreach (var item in contentItems)
{
contentList.Add(item.ToContent());
contentList.Add(item.ToContentBlock());
hasAny = true;
if (allErrorContent && item is not ErrorContent)