Improve progress reporting (#145)
* Improve progress reporting - Enable injecting an `IProgress<>` into a tool call to report progress when the client has supplied a progress token - Add a custom type for ProgressToken and ProgressNotification to map to the schema - Simplify RequestId to match ProgressToken's shape - Serialize StdioClientTransport's SendMessageAsync implementation - Add strongly-typed names for all request methods - Change all request IDs created by McpJsonRpcEndpoint to include a guid for that endpoint * Address PR feedback
This commit is contained in:
parent
0294c574a6
commit
2c75acded8
1 changed files with 627 additions and 228 deletions
14
src/ModelContextProtocol/ProgressNotificationValue.cs
Normal file
14
src/ModelContextProtocol/ProgressNotificationValue.cs
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
namespace ModelContextProtocol;
|
||||
|
||||
/// <summary>Provides a progress value that can be sent using <see cref="IProgress{ProgressNotificationValue}"/>.</summary>
|
||||
public record struct ProgressNotificationValue
|
||||
{
|
||||
/// <summary>Gets or sets the progress thus far.</summary>
|
||||
public required float Progress { get; init; }
|
||||
|
||||
/// <summary>Gets or sets the total number of items to process (or total progress required), if known.</summary>
|
||||
public float? Total { get; init; }
|
||||
|
||||
/// <summary>Gets or sets an optional message describing the current progress.</summary>
|
||||
public string? Message { get; init; }
|
||||
}
|
||||
Loading…
Reference in a new issue