Skip to content

[FEATURE] Add support of CancellationToken #81

@osdemah

Description

@osdemah

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

  1. stop/cancel API for the AI app
  2. complex multi-agent systems where the orchestrator agent can decide to stop the child agents

Alternatives Solutions

No response

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-asyncRelated to asynchronous flows or multi-threadingenhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions