diff --git a/fern/products/sdks/generators/python/configuration.mdx b/fern/products/sdks/generators/python/configuration.mdx index 47036fd15..be8bd7ace 100644 --- a/fern/products/sdks/generators/python/configuration.mdx +++ b/fern/products/sdks/generators/python/configuration.mdx @@ -211,6 +211,33 @@ Allow specifying arbitrary configuration to your packages `pyproject.toml` by ad When enabled, skips code formatting (like black) on the generated Python code. + +Opt in to platform-guarded TCP keepalive on the generated default `httpx` transport. Disabled by default, so existing generated SDKs are unchanged. When enabled, the transport applies `SO_KEEPALIVE` plus best-effort per-platform idle, interval, and probe-count settings, so long, non-streaming requests survive idle-connection reaping by a firewall or load balancer. + +```yaml +config: + tcp_keepalive: + enabled: true + idle_seconds: 60 + interval_seconds: 30 + count: 5 +``` + +Requires `httpx>=0.25`. A user-supplied `httpx_client`, or a `custom_transport` `http_client`, always takes precedence over the keepalive default, which only affects the generated default transport. + + + Whether to enable TCP keepalive on the generated default transport. + + + Seconds a connection is idle before the first keepalive probe. + + + Seconds between keepalive probes. + + + Number of failed probes before the connection is dropped. + + Sets the client timeout in seconds, or `infinity` to disable timeouts.