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

[Feature Request]: Add documentation for registering async reply function in sync chat #1195

Closed
davorrunje opened this issue Jan 10, 2024 · 3 comments · Fixed by #1208
Closed
Assignees
Labels
enhancement New feature or request

Comments

@davorrunje
Copy link
Collaborator

davorrunje commented Jan 10, 2024

Is your feature request related to a problem? Please describe.

  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.

Describe the solution you'd like

I understand the limitation of calling the async reply function from a sync chat and why it is not supported, but it is not properly documented. We might raise an Exception in sync chat if an async reply function is registered.

Additional context

No response

@davorrunje davorrunje added the enhancement New feature or request label Jan 10, 2024
@davorrunje davorrunje self-assigned this Jan 10, 2024
@ekzhu
Copy link
Collaborator

ekzhu commented Jan 10, 2024

Do you think we might want to raise exception when (2) happens?

@davorrunje
Copy link
Collaborator Author

Do you think we might want to raise exception when (2) happens?

I am not sure is it safe to raise it, we might break the code for many people.

@davorrunje
Copy link
Collaborator Author

Actually, raising an exception is probably the best way to go. Silently not using a function is worse.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
2 participants