Open
Description
Problem Statement
As we're refactoring and adding asyncio support, it'd be great to add support of a "CancellationToken" throughout the SDK. This allows for convenient support of features like adding a stop/cancel button to the AI app. Sample implementation in autogen can be found here.
Proposed Solution
- requirement for this feature is to have asyncio support.
- Add CancellationToken to the agent entrypoint and pass it throughout the sdk (sample reference).
- Link the futures to the token.
Use Case
- stop/cancel API for the AI app
- complex multi-agent systems where the orchestrator agent can decide to stop the child agents
Alternatives Solutions
No response
Additional Context
No response