Obsolete Roots, Sampling, and Logging surface area per SEP-2577 (#1651)
Co-authored-by: Tarek Mahmoud Sayed <tarekms@ntdev.microsoft.com>
This commit is contained in:
parent
9b783d7a3b
commit
8ddb3cc36f
1 changed files with 122 additions and 3 deletions
|
|
@ -67,6 +67,7 @@ public abstract partial class McpServer : McpSession
|
|||
/// then returns to <see cref="McpTaskStatus.Working"/> when the response is received.
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
[Obsolete(Obsoletions.DeprecatedSampling_Message, DiagnosticId = Obsoletions.Deprecated_DiagnosticId, UrlFormat = Obsoletions.Deprecated_Url)]
|
||||
public ValueTask<CreateMessageResult> SampleAsync(
|
||||
CreateMessageRequestParams requestParams,
|
||||
CancellationToken cancellationToken = default)
|
||||
|
|
@ -107,6 +108,7 @@ public abstract partial class McpServer : McpSession
|
|||
/// <exception cref="ArgumentNullException"><paramref name="messages"/> is <see langword="null"/>.</exception>
|
||||
/// <exception cref="InvalidOperationException">The client does not support sampling.</exception>
|
||||
/// <exception cref="McpException">The request failed or the client returned an error response.</exception>
|
||||
[Obsolete(Obsoletions.DeprecatedSampling_Message, DiagnosticId = Obsoletions.Deprecated_DiagnosticId, UrlFormat = Obsoletions.Deprecated_Url)]
|
||||
public async Task<ChatResponse> SampleAsync(
|
||||
IEnumerable<ChatMessage> messages, ChatOptions? chatOptions = default, JsonSerializerOptions? serializerOptions = null, CancellationToken cancellationToken = default)
|
||||
{
|
||||
|
|
@ -243,6 +245,7 @@ public abstract partial class McpServer : McpSession
|
|||
/// <see cref="JsonRpcMessageContext.RelatedTransport"/>, which is always open for the duration of
|
||||
/// the request, rather than relying on the optional standalone GET SSE stream.
|
||||
/// </remarks>
|
||||
[Obsolete(Obsoletions.DeprecatedSampling_Message, DiagnosticId = Obsoletions.Deprecated_DiagnosticId, UrlFormat = Obsoletions.Deprecated_Url)]
|
||||
public IChatClient AsSamplingChatClient(JsonSerializerOptions? serializerOptions = null)
|
||||
{
|
||||
ThrowIfSamplingUnsupported();
|
||||
|
|
@ -252,6 +255,7 @@ public abstract partial class McpServer : McpSession
|
|||
|
||||
/// <summary>Gets an <see cref="ILogger"/> on which logged messages will be sent as notifications to the client.</summary>
|
||||
/// <returns>An <see cref="ILogger"/> that can be used to log to the client.</returns>
|
||||
[Obsolete(Obsoletions.DeprecatedLogging_Message, DiagnosticId = Obsoletions.Deprecated_DiagnosticId, UrlFormat = Obsoletions.Deprecated_Url)]
|
||||
public ILoggerProvider AsClientLoggerProvider() =>
|
||||
new ClientLoggerProvider(this);
|
||||
|
||||
|
|
@ -271,6 +275,7 @@ public abstract partial class McpServer : McpSession
|
|||
/// <see cref="JsonRpcMessageContext.RelatedTransport"/>, which is always open for the duration of
|
||||
/// the request, rather than relying on the optional standalone GET SSE stream.
|
||||
/// </remarks>
|
||||
[Obsolete(Obsoletions.DeprecatedRoots_Message, DiagnosticId = Obsoletions.Deprecated_DiagnosticId, UrlFormat = Obsoletions.Deprecated_Url)]
|
||||
public ValueTask<ListRootsResult> RequestRootsAsync(
|
||||
ListRootsRequestParams requestParams,
|
||||
CancellationToken cancellationToken = default)
|
||||
|
|
|
|||
Loading…
Reference in a new issue