Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add documentation and raise exception when registering async reply function in sync chat #1208

Conversation

davorrunje
Copy link
Collaborator

@davorrunje davorrunje commented Jan 11, 2024

Why are these changes needed?

Current state:

  1. If you register a sync reply function and initiate an async chat, the reply function will be triggered.
  2. If you register an async reply function and initiate a sync chat, the reply function will not be triggered.
  3. and 4. if the reply function and chat initiation are either both sync or both async, then the reply function would be triggered.

Proposed change:

  1. If you register an async reply function and initiate a sync chat, a RunTime exception will be raised unless we explicitly specify that the function should be ignored in sync chat.

Related issue number

Closes #1195

Checks

@codecov-commenter
Copy link

codecov-commenter commented Jan 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (2e519b0) 30.63% compared to head (d548a29) 50.30%.

Additional details and impacted files
@@             Coverage Diff             @@
##             main    #1208       +/-   ##
===========================================
+ Coverage   30.63%   50.30%   +19.67%     
===========================================
  Files          32       32               
  Lines        4365     4381       +16     
  Branches     1015     1077       +62     
===========================================
+ Hits         1337     2204      +867     
+ Misses       2932     1964      -968     
- Partials       96      213      +117     
Flag Coverage Δ
unittests 50.21% <100.00%> (+19.63%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Co-authored-by: Chi Wang <wang.chi@microsoft.com>
@sonichi sonichi added this pull request to the merge queue Jan 13, 2024
Merged via the queue into main with commit 2589ae8 Jan 13, 2024
82 of 87 checks passed
@sonichi sonichi deleted the 1195-feature-request-add-documentation-for-registering-async-reply-function-in-sync-chat branch January 13, 2024 07:39
joshkyh pushed a commit that referenced this pull request Jan 17, 2024
…nction in sync chat (#1208)

* documentation update and added tests for register_reply function

* added raising an exception on an async reply function in sync chat

* big fixing

* test expanded

* Update autogen/agentchat/conversable_agent.py

Co-authored-by: Chi Wang <wang.chi@microsoft.com>

* Update autogen/agentchat/conversable_agent.py

Co-authored-by: Chi Wang <wang.chi@microsoft.com>

* refactorization

---------

Co-authored-by: Chi Wang <wang.chi@microsoft.com>
whiskyboy pushed a commit to whiskyboy/autogen that referenced this pull request Apr 17, 2024
…nction in sync chat (microsoft#1208)

* documentation update and added tests for register_reply function

* added raising an exception on an async reply function in sync chat

* big fixing

* test expanded

* Update autogen/agentchat/conversable_agent.py

Co-authored-by: Chi Wang <wang.chi@microsoft.com>

* Update autogen/agentchat/conversable_agent.py

Co-authored-by: Chi Wang <wang.chi@microsoft.com>

* refactorization

---------

Co-authored-by: Chi Wang <wang.chi@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature Request]: Add documentation for registering async reply function in sync chat
4 participants