mistral_common.utils.download
resolve_download_timeout(timeout)
Resolve a caller-provided timeout, falling back to the environment default.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
timeout
|
TimeoutType | None
|
Seconds to wait. If |
required |
Returns:
| Type | Description |
|---|---|
float
|
The timeout as a positive finite float. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If |
Source code in src/mistral_common/utils/download.py
resolve_env_download_timeout()
Return the default download timeout from the environment.
Reads MISTRAL_COMMON_DOWNLOAD_TIMEOUT (seconds). Unset or empty uses 10.
Raises:
| Type | Description |
|---|---|
ValueError
|
If the variable is set but not a positive finite number. |
Source code in src/mistral_common/utils/download.py
validate_download_timeout(timeout, *, error_message)
Convert a timeout to a positive finite float or raise.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
timeout
|
TimeoutType
|
The timeout value in seconds. |
required |
error_message
|
str
|
The error message used when the value is invalid. |
required |
Returns:
| Type | Description |
|---|---|
float
|
The timeout as a positive finite float. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If |