-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Python: Does not support timeout in httpx. #6338
Comments
@yuichiromukaiyama let me have a look today. It is possible to pass in a custom httpx.AsyncClient. Would that help your use case? |
Thank you! Yes, it would be helpful if we could change settings like timeout. In our use case, we are developing an agent that calls multiple RAGs and LLMs from the semantic kernel. When calling LLMs, especially through plugins, it can take a long time to get the initial response. These plugins can have slightly longer wait times, so being able to set timeouts ourselves would be extremely beneficial. Additionally, we are implementing a use case similar to Autogen, where one Agent (Semantic Kernel) calls another Agent (Semantic Kernel). In such cases, having a longer timeout would be beneficial as well. |
@yuichiromukaiyama please go ahead and configure your custom httpx.AsyncClient as part of the OpenAPIFunctionExecutionParameters. That will give you the flexability to set the timeout and any other properties on the client. That client is passed all the way to the |
Closing this as a custom httpx.AsyncClient can be configured and passed through to the fetch method. |
Sorry. I didn't realize the feature existed. Thank you! |
Describe the bug
The following issue arises from using httpx as the HTTP client: it is not possible to change this parameter. The problem is that the default timeout duration is set to 5 seconds, which is relatively short. For instance, when an agent calls another agent or a RAG database, if it takes some time, the connection is quickly terminated. While a 5-second response time might be sufficient for general APIs, for generative AI, a longer timeout duration is often desirable.
AsIs:
semantic-kernel/python/semantic_kernel/connectors/openapi_plugin/openapi_manager.py
Line 602 in 3e19785
To Reproduce
Steps to reproduce the behavior:
Expected behavior
To be able to set an appropriate timeout duration.
Screenshots
none
Platform
Additional context
ToBe: It would be beneficial to be able to pass arguments flexibly as shown below, or to have a sufficiently long timeout setting, or to be able to specify it through environment variables.
The text was updated successfully, but these errors were encountered: