mirror of
https://github.com/PrefectHQ/fastmcp.git
synced 2026-08-09 15:19:10 +02:00
* Update repository references from jlowin/fastmcp to prefecthq/fastmcp * Retrigger CI after repo transfer * chore: Update SDK documentation * Only run deep triage on bug issues for jlowin --------- Co-authored-by: marvin-context-protocol[bot] <225465937+marvin-context-protocol[bot]@users.noreply.github.com>
44 lines
1.2 KiB
Text
44 lines
1.2 KiB
Text
---
|
|
title: timeout
|
|
sidebarTitle: timeout
|
|
---
|
|
|
|
# `fastmcp.utilities.timeout`
|
|
|
|
|
|
Timeout normalization utilities.
|
|
|
|
## Functions
|
|
|
|
### `normalize_timeout_to_timedelta` <sup><a href="https://github.com/PrefectHQ/fastmcp/blob/main/src/fastmcp/utilities/timeout.py#L8" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>
|
|
|
|
```python
|
|
normalize_timeout_to_timedelta(value: int | float | datetime.timedelta | None) -> datetime.timedelta | None
|
|
```
|
|
|
|
|
|
Normalize a timeout value to a timedelta.
|
|
|
|
**Args:**
|
|
- `value`: Timeout value as int/float (seconds), timedelta, or None
|
|
|
|
**Returns:**
|
|
- timedelta if value provided, None otherwise
|
|
|
|
|
|
### `normalize_timeout_to_seconds` <sup><a href="https://github.com/PrefectHQ/fastmcp/blob/main/src/fastmcp/utilities/timeout.py#L28" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>
|
|
|
|
```python
|
|
normalize_timeout_to_seconds(value: int | float | datetime.timedelta | None) -> float | None
|
|
```
|
|
|
|
|
|
Normalize a timeout value to seconds (float).
|
|
|
|
**Args:**
|
|
- `value`: Timeout value as int/float (seconds), timedelta, or None.
|
|
Zero values are treated as "disabled" and return None.
|
|
|
|
**Returns:**
|
|
- float seconds if value provided and non-zero, None otherwise
|
|
|