Add McpClient/Session methods using .Protocol types (#1063)
This commit is contained in:
parent
d76bc16bd1
commit
4a84412331
5 changed files with 1116 additions and 639 deletions
|
|
@ -391,7 +391,7 @@ public sealed class ElicitRequestParams : RequestParams
|
|||
return psd;
|
||||
}
|
||||
|
||||
private static IList<EnumSchemaOption> DeserializeEnumOptions(ref Utf8JsonReader reader)
|
||||
private static List<EnumSchemaOption> DeserializeEnumOptions(ref Utf8JsonReader reader)
|
||||
{
|
||||
if (reader.TokenType != JsonTokenType.StartArray)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ public readonly struct ProgressToken : IEquatable<ProgressToken>
|
|||
{
|
||||
/// <summary>Initializes a new instance of the <see cref="ProgressToken"/> with a specified value.</summary>
|
||||
/// <param name="value">The required ID value.</param>
|
||||
/// <exception cref="ArgumentNullException"><paramref name="value"/> is <see langword="null"/>.</exception>
|
||||
public ProgressToken(string value)
|
||||
{
|
||||
Throw.IfNull(value);
|
||||
|
|
|
|||
|
|
@ -12,8 +12,8 @@ namespace ModelContextProtocol.Protocol;
|
|||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>
|
||||
/// References are commonly used with <see cref="McpClient.CompleteAsync"/> to request completion suggestions for arguments,
|
||||
/// and with other methods that need to reference resources or prompts.
|
||||
/// References are commonly used with <see cref="McpClient.CompleteAsync(Reference, string, string, ModelContextProtocol.RequestOptions?, CancellationToken)"/>
|
||||
/// to request completion suggestions for arguments, and with other methods that need to reference resources or prompts.
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// See the <see href="https://github.com/modelcontextprotocol/specification/blob/main/schema/">schema</see> for details.
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ public readonly struct RequestId : IEquatable<RequestId>
|
|||
{
|
||||
/// <summary>Initializes a new instance of the <see cref="RequestId"/> with a specified value.</summary>
|
||||
/// <param name="value">The required ID value.</param>
|
||||
/// <exception cref="ArgumentNullException"><paramref name="value"/> is <see langword="null"/>.</exception>
|
||||
public RequestId(string value)
|
||||
{
|
||||
Throw.IfNull(value);
|
||||
|
|
|
|||
|
|
@ -94,6 +94,8 @@ public abstract partial class TransportBase : ITransport
|
|||
throw new InvalidOperationException("Transport is not connected.");
|
||||
}
|
||||
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
|
||||
if (_logger.IsEnabled(LogLevel.Debug))
|
||||
{
|
||||
var messageId = (message as JsonRpcMessageWithId)?.Id.ToString() ?? "(no id)";
|
||||
|
|
|
|||
Loading…
Reference in a new issue