Simplified client progress_callback support #632
+177
−6
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add support for an optional callback to be called during tool execution to inform of progress
Motivation and Context
Tracking progress on the client is useful for long running tasks, the low level primitives are available via the protocol however they're a little complex to setup. This patch adds an optional calllback to to the call_tool request and does the heavy lifting for the caller so they don't have to do this.
The soluiton is implemented on the BaseSession object so the approach can be used for both client->server and server->client requests. Currently the only top level method that supports this is clientsession.call_tool which seems like the most common use case. If there are other are other use cases they can be added easilly.
How Has This Been Tested?
Unit testing only
Breaking Changes
None expected
Types of changes
Checklist
Additional context
If this looks useful I can add documentation to the patch