Skip to main content

DEFAULT_READ_TIMEOUT

In seconds

DEFAULT_WRITE_TIMEOUT

In seconds

DEFAULT_CONNECT_TIMEOUT

In seconds

RequestsSettings Objects

The settings for all outgoing network requests. These apply for each individual request.

max_retries

Number of allowed retries when a request is sent. It only affects idempotent retryable requests.

backoff_factor

With each retry, there will be a sleep of backoff_factor * (2 ** (retry_number - 1) )

connection_retries

Number of allowed retries to establish TCP connection when a request is sent.

connect_timeout

Maximum number of seconds from connection establishment to the first byte of response received

read_timeout

Maximum number of seconds to obtain full response

write_timeout

Maximum number of seconds to send request payload

trace_id_provider

Function that supplies trace id for every request issued by the library. Random if not provided.

agent_run_token_provider

Function that supplies the agent run token for every request issued by the library, sent as the X-Encord-Agent-Run-Token header. An agent sets it to the token Encord sent with the run it is handling, so the changes it makes can be attributed to that run. Called for each request, so a client shared across runs sends the current run’s token; no header is sent when it is not set or returns None or an empty string.