prefactor_http.config module
prefactor_http.config module
Section titled “prefactor_http.config module”Configuration for Prefactor HTTP Client.
class prefactor_http.config.HttpClientConfig(api_url: str, api_token: str, request_timeout: float = 30.0, connect_timeout: float = 10.0, max_retries: int = 3, initial_retry_delay: float = 1.0, max_retry_delay: float = 60.0, retry_multiplier: float = 2.0, retry_on_status_codes: tuple[int, …] = (429, 500, 502, 503, 504), default_idempotency_key: str | None = None)
Section titled “class prefactor_http.config.HttpClientConfig(api_url: str, api_token: str, request_timeout: float = 30.0, connect_timeout: float = 10.0, max_retries: int = 3, initial_retry_delay: float = 1.0, max_retry_delay: float = 60.0, retry_multiplier: float = 2.0, retry_on_status_codes: tuple[int, …] = (429, 500, 502, 503, 504), default_idempotency_key: str | None = None)”Bases: object
Configuration for the HTTP client.
api_url
Section titled “api_url”Base URL for the Prefactor API. Example: ‘https://api.prefactor.ai’
- Type: str
api_token
Section titled “api_token”Bearer token for API authentication.
- Type: str
request_timeout
Section titled “request_timeout”Total timeout for requests in seconds (default: 30.0).
- Type: float
connect_timeout
Section titled “connect_timeout”Connection timeout in seconds (default: 10.0).
- Type: float
max_retries
Section titled “max_retries”Maximum number of retry attempts (default: 3).
- Type: int
initial_retry_delay
Section titled “initial_retry_delay”Initial delay between retries in seconds (default: 1.0).
- Type: float
max_retry_delay
Section titled “max_retry_delay”Maximum delay between retries in seconds (default: 60.0).
- Type: float
retry_multiplier
Section titled “retry_multiplier”Multiplier for exponential backoff (default: 2.0).
- Type: float
retry_on_status_codes
Section titled “retry_on_status_codes”HTTP status codes to retry on (default: 429, 500, 502, 503, 504).
- Type: tuple[int, …]
default_idempotency_key
Section titled “default_idempotency_key”Optional default idempotency key prefix.
- Type: str | None