prompttools.requests package#
Submodules#
prompttools.requests.request_queue module#
- class prompttools.requests.request_queue.RequestQueue#
Bases:
objectA generic queue for processing requests in the prompttools library. It can be used to handle and time requests to any LLM asynchronously.
- enqueue(callable, args)#
Adds another request to the queue.
- get_input_args()#
Joins the queue and gets input args that lead to the result.
- shutdown()#
Stops the worker thread from executed and joins it.
- Return type:
None
prompttools.requests.retries module#
- prompttools.requests.retries.generate_retry_decorator(wait_lower_bound=3, wait_upper_bound=12, max_retry_attempts=5)#
Creates a retry decorator that can be used for requests. It looks for specific exceptions and waits for certain about of time before retrying. This improves the reliability of the request queue.