Asynchronous Python SDK version #1416

Closed
opened 2026-02-21 17:33:23 -05:00 by yindo · 0 comments
Owner

Originally created by @olehchenusha on GitHub (Mar 17, 2024).

Self Checks

  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • Pleas do not modify this template :) and fill in all the required fields.

1. Is this request related to a challenge you're experiencing?

Yes, the current synchronous nature of the DifyClient in the Python dify-client SDK is causing thread blocking when one thread makes a request to the API. This is particularly problematic when using asynchronous frameworks.

2. Describe the feature you'd like to see

I propose the creation of new classes in the SDK called AsyncDifyClient, AsyncCompletionClient, AsyncChatClient. These classes would contain only asynchronous functions and would utilize the aiohttp framework. This would allow for non-blocking operations and better compatibility with asynchronous frameworks.

3. How will this feature improve your workflow or experience?

The addition of an asynchronous version of the DifyClient will significantly improve the efficiency of program workflows by preventing thread blocking. This is particularly beneficial for those who use asynchronous frameworks, as the current SDK can block their threads and disrupt program workflow.

4. Additional context or comments

I have an idea of a solution for this feature and am willing to collaborate on its implementation to ensure it meets the needs of those using asynchronous frameworks with the Python dify-client SDK.

5. Can you help us with this feature?

  • I am interested in contributing to this feature.
Originally created by @olehchenusha on GitHub (Mar 17, 2024). ### Self Checks - [X] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [X] I confirm that I am using English to submit this report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). - [X] Pleas do not modify this template :) and fill in all the required fields. ### 1. Is this request related to a challenge you're experiencing? Yes, the current synchronous nature of the DifyClient in the Python dify-client SDK is causing thread blocking when one thread makes a request to the API. This is particularly problematic when using asynchronous frameworks. ### 2. Describe the feature you'd like to see I propose the creation of new classes in the SDK called AsyncDifyClient, AsyncCompletionClient, AsyncChatClient. These classes would contain only asynchronous functions and would utilize the aiohttp framework. This would allow for non-blocking operations and better compatibility with asynchronous frameworks. ### 3. How will this feature improve your workflow or experience? The addition of an asynchronous version of the DifyClient will significantly improve the efficiency of program workflows by preventing thread blocking. This is particularly beneficial for those who use asynchronous frameworks, as the current SDK can block their threads and disrupt program workflow. ### 4. Additional context or comments I have an idea of a solution for this feature and am willing to collaborate on its implementation to ensure it meets the needs of those using asynchronous frameworks with the Python dify-client SDK. ### 5. Can you help us with this feature? - [X] I am interested in contributing to this feature.
yindo added the 💪 enhancement label 2026-02-21 17:33:23 -05:00
yindo closed this issue 2026-02-21 17:33:23 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#1416