Python for AIBeginner16 August 2026
Why should a Python application set a timeout when calling an external AI API?
Pick an answer to see the explanation.
Answer
To prevent the application from waiting indefinitely when the service is slow or unavailable
A timeout limits how long the application waits for an external service to respond. Without one, a slow or unavailable service can leave requests hanging and consume application resources. Timeouts are normally combined with controlled retries and clear error handling.
Learn more: Explore AI automation with Python →