Skip to content

Commit 72b640d

Browse files
committed
Fix core build breaks
1 parent 9656dcf commit 72b640d

7 files changed

Lines changed: 7 additions & 7 deletions

File tree

samples/EverythingServer/Tools/SampleLlmTool.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public static async Task<string> SampleLLM(
1515
CancellationToken cancellationToken)
1616
{
1717
var samplingParams = CreateRequestSamplingParams(prompt ?? string.Empty, "sampleLLM", maxTokens);
18-
var sampleResult = await server.SampleAsync(samplingParams, cancellationToken);
18+
var sampleResult = await server.SampleAsync(samplingParams, meta: null, cancellationToken);
1919

2020
return $"LLM sampling result: {sampleResult.Content.OfType<TextContentBlock>().FirstOrDefault()?.Text}";
2121
}

samples/TestServerWithHosting/Tools/SampleLlmTool.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public static async Task<string> SampleLLM(
1818
CancellationToken cancellationToken)
1919
{
2020
var samplingParams = CreateRequestSamplingParams(prompt ?? string.Empty, "sampleLLM", maxTokens);
21-
var sampleResult = await thisServer.SampleAsync(samplingParams, cancellationToken);
21+
var sampleResult = await thisServer.SampleAsync(samplingParams, meta: null, cancellationToken);
2222

2323
return $"LLM sampling result: {sampleResult.Content.OfType<TextContentBlock>().FirstOrDefault()?.Text}";
2424
}

src/ModelContextProtocol.Core/Server/McpServer.Methods.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,7 @@ private sealed class SamplingChatClient(McpServer server) : IChatClient
488488

489489
/// <inheritdoc/>
490490
public Task<ChatResponse> GetResponseAsync(IEnumerable<ChatMessage> messages, ChatOptions? options = null, CancellationToken cancellationToken = default) =>
491-
_server.SampleAsync(messages, options, cancellationToken);
491+
_server.SampleAsync(messages, options, meta: null, cancellationToken);
492492

493493
/// <inheritdoc/>
494494
async IAsyncEnumerable<ChatResponseUpdate> IChatClient.GetStreamingResponseAsync(

src/ModelContextProtocol.Core/Server/McpServerOptions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ public McpServerHandlers Handlers
158158
/// </summary>
159159
/// <remarks>
160160
/// <para>
161-
/// This value is used in <see cref="McpServer.SampleAsync(IEnumerable{Microsoft.Extensions.AI.ChatMessage}, Microsoft.Extensions.AI.ChatOptions?, CancellationToken)"/>
161+
/// This value is used in <see cref="McpServer.SampleAsync(IEnumerable{Microsoft.Extensions.AI.ChatMessage}, Microsoft.Extensions.AI.ChatOptions?, System.Text.Json.Nodes.JsonObject?, CancellationToken)"/>
162162
/// when <see cref="Microsoft.Extensions.AI.ChatOptions.MaxOutputTokens"/> is not set in the request options.
163163
/// </para>
164164
/// <para>

src/ModelContextProtocol.Core/TokenProgress.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ internal sealed class TokenProgress(McpSession session, ProgressToken progressTo
1111
/// <inheritdoc />
1212
public void Report(ProgressNotificationValue value)
1313
{
14-
_ = session.NotifyProgressAsync(progressToken, value, CancellationToken.None);
14+
_ = session.NotifyProgressAsync(progressToken, value, meta: null, CancellationToken.None);
1515
}
1616
}

tests/ModelContextProtocol.TestServer/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ private static void ConfigureTools(McpServerOptions options, string? cliArg)
193193
throw new McpProtocolException("Missing required arguments 'prompt' and 'maxTokens'", McpErrorCode.InvalidParams);
194194
}
195195
var sampleResult = await request.Server.SampleAsync(CreateRequestSamplingParams(prompt.ToString(), "sampleLLM", Convert.ToInt32(maxTokens.GetRawText())),
196-
cancellationToken);
196+
meta: null, cancellationToken);
197197

198198
return new CallToolResult
199199
{

tests/ModelContextProtocol.TestSseServer/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ static CreateMessageRequestParams CreateRequestSamplingParams(string context, st
187187
throw new McpProtocolException("Missing required arguments 'prompt' and 'maxTokens'", McpErrorCode.InvalidParams);
188188
}
189189
var sampleResult = await request.Server.SampleAsync(CreateRequestSamplingParams(prompt.ToString(), "sampleLLM", Convert.ToInt32(maxTokens.ToString())),
190-
cancellationToken);
190+
meta: null, cancellationToken);
191191

192192
return new CallToolResult
193193
{

0 commit comments

Comments
 (0)