honeyhive.config.models.http_client
HTTP client configuration models for HoneyHive SDK.
This module provides Pydantic models for HTTP client configuration including connection pooling, timeouts, retry behavior, proxy settings, and SSL configuration.
HTTPClientConfig
Bases: BaseHoneyHiveConfig
HTTP client configuration settings.
This class extends BaseHoneyHiveConfig with HTTP-specific settings for connection pooling, timeouts, retry behavior, proxy settings, and SSL configuration. Supports both HH_ and standard HTTP_ environment variables.
Example
config = HTTPClientConfig( ... timeout=30.0, ... max_connections=50, ... http_proxy="http://proxy.company.com:8080" ... )
Or load from environment variables:
export HH_TIMEOUT=30.0
export HH_MAX_CONNECTIONS=50
config = HTTPClientConfig()
Source code in src/honeyhive/config/models/http_client.py
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 | |
timeout
class-attribute
instance-attribute
timeout: float = Field(
default=30.0,
description="Request timeout in seconds",
validation_alias=AliasChoices("HH_TIMEOUT", "timeout"),
examples=[30.0, 60.0, 120.0],
)
max_connections
class-attribute
instance-attribute
max_connections: int = Field(
default=10,
description="Maximum connections in pool",
validation_alias=AliasChoices(
"HH_MAX_CONNECTIONS", "max_connections"
),
examples=[10, 50, 100],
)
max_keepalive_connections
class-attribute
instance-attribute
max_keepalive_connections: int = Field(
default=20,
description="Maximum keepalive connections",
validation_alias=AliasChoices(
"HH_MAX_KEEPALIVE_CONNECTIONS",
"max_keepalive_connections",
),
examples=[20, 50, 100],
)
keepalive_expiry
class-attribute
instance-attribute
keepalive_expiry: float = Field(
default=30.0,
description="Keepalive expiry time in seconds",
validation_alias=AliasChoices(
"HH_KEEPALIVE_EXPIRY", "keepalive_expiry"
),
examples=[30.0, 60.0, 300.0],
)
pool_timeout
class-attribute
instance-attribute
pool_timeout: float = Field(
default=10.0,
description="Pool timeout in seconds",
validation_alias=AliasChoices(
"HH_POOL_TIMEOUT", "pool_timeout"
),
examples=[10.0, 30.0, 60.0],
)
rate_limit_calls
class-attribute
instance-attribute
rate_limit_calls: int = Field(
default=100,
description="Maximum calls per time window",
validation_alias=AliasChoices(
"HH_RATE_LIMIT_CALLS", "rate_limit_calls"
),
examples=[100, 200, 500],
)
rate_limit_window
class-attribute
instance-attribute
rate_limit_window: float = Field(
default=60.0,
description="Rate limit time window in seconds",
validation_alias=AliasChoices(
"HH_RATE_LIMIT_WINDOW", "rate_limit_window"
),
examples=[60.0, 300.0, 3600.0],
)
max_retries
class-attribute
instance-attribute
max_retries: int = Field(
3,
description="Maximum retry attempts",
validation_alias=AliasChoices(
"HH_MAX_RETRIES", "max_retries"
),
examples=[3, 5, 10],
)
http_proxy
class-attribute
instance-attribute
http_proxy: Optional[str] = Field(
None,
description="HTTP proxy URL",
validation_alias=AliasChoices(
"HH_HTTP_PROXY", "http_proxy"
),
examples=["http://proxy.company.com:8080"],
)
https_proxy
class-attribute
instance-attribute
https_proxy: Optional[str] = Field(
None,
description="HTTPS proxy URL",
validation_alias=AliasChoices(
"HH_HTTPS_PROXY", "https_proxy"
),
examples=["https://proxy.company.com:8080"],
)
no_proxy
class-attribute
instance-attribute
no_proxy: Optional[str] = Field(
None,
description="Comma-separated list of hosts to bypass proxy",
validation_alias=AliasChoices(
"HH_NO_PROXY", "no_proxy"
),
examples=["localhost,127.0.0.1,.local"],
)
verify_ssl
class-attribute
instance-attribute
verify_ssl: bool = Field(
True,
description="Verify SSL certificates",
validation_alias=AliasChoices(
"HH_VERIFY_SSL", "verify_ssl"
),
)
follow_redirects
class-attribute
instance-attribute
follow_redirects: bool = Field(
True,
description="Follow HTTP redirects",
validation_alias=AliasChoices(
"HH_FOLLOW_REDIRECTS", "follow_redirects"
),
)
validate_positive_float
classmethod
Validate that float values are positive with graceful degradation.
Source code in src/honeyhive/config/models/http_client.py
228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 | |
validate_positive_int
classmethod
Validate that integer values are positive with graceful degradation.
Source code in src/honeyhive/config/models/http_client.py
264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 | |
validate_proxy_url
classmethod
Validate proxy URL format with graceful degradation.
Source code in src/honeyhive/config/models/http_client.py
303 304 305 306 307 308 | |