ClientConfigResponse
class mint.types.ClientConfigResponse ( BaseModel )¶
为当前调用方解析出的服务端特性开关。
使用 BaseModel(extra="ignore"),因此服务端新增的开关在 SDK 加入对应字段前会被静默丢弃。
字段:
- pjwt_auth_enabled ( bool )
- credential_default_source ( str )
- sample_dispatch_bytes_semaphore_size ( int )
- inflight_response_bytes_semaphore_size ( int )
- parallel_fwdbwd_chunks ( bool )
- proto_write_fwdbwd ( bool ) – 为 true 时,SDK 将 ForwardBackwardRequest 序列化为 proto 字节,并以 Content-Type: application/x-protobuf 发送。为 false(默认)或请求无法编码为 proto 时回退到 JSON。
- proto_compress_fwdbwd ( bool ) – 为 true(且 proto_write_fwdbwd 也为 true)时,SDK 会对 proto fwd/bwd 请求体做 zstd 压缩并设置 Content-Encoding: zstd。实际的 fwd/bwd 载荷压缩率超过 10 倍——API 服务器通过 ASGI 中间件透明解压。在 JSON 路径上不生效。
- fwd_via_fwdbwd ( bool ) – 为 true(且 proto_write_fwdbwd 也为 true)时,TrainingClient.forward() 会经由 /api/v1/forward_backward(带 forward_only=True)通过 proto 走,而非 /api/v1/forward。当 proto_write_fwdbwd 为 false(即 JSON /forward 路径)时不生效。
- billing_exception_max_pause_duration_sec ( int )
- sample_no_retries ( bool )
- sample_enable_stuck_detection ( bool ) – 为 true 时,SDK 会运行重试处理器的进度超时检查:当在
RetryConfig.progress_timeout内没有进展时抛出APIConnectionError("...Requests appear to be stuck.")。 - sample_max_concurrent_requests ( int ) – SamplingClient 允许的最大在途采样请求数(即其重试处理器信号量的大小)。始终作为采样的
RetryConfig.max_connections应用,覆盖调用方传入的retry_config中的任何值。 - use_pyqwest_transport ( bool ) – 为 true 时,SDK 在 pyqwest(基于 reqwest/hyper)传输适配器之上构建默认的 httpx 异步客户端。服务端设为 false 可强制所有客户端回退到 httpx 默认传输。