MCPcopy Create free account
hub / github.com/commandoperator/cmdop-sdk / ClientConfig

Class ClientConfig

python/src/cmdop/config.py:25–81  ·  view source on GitHub ↗

Resolved, immutable per-client configuration.

Source from the content-addressed store, hash-verified

23 timeout_ms: int = DEFAULT_TIMEOUT_MS
24
25 @classmethod
26 def resolve(
27 cls,
28 *,
29 token: str | None = None,
30 base_url: str | None = None,
31 timeout_ms: int | None = None,
32 ) -> ClientConfig:
33 resolved_timeout = timeout_ms
34 if resolved_timeout is None:
35 value = os.environ.get("CMDOP_TIMEOUT_MS")
36 resolved_timeout = int(value) if value else DEFAULT_TIMEOUT_MS
37 if resolved_timeout <= 0:
38 raise ValueError("timeout_ms must be greater than zero")
39 resolved_base = base_url or os.environ.get("CMDOP_BASE_URL") or None
40 return cls(
41 token=token or os.environ.get("CMDOP_TOKEN") or None,
42 base_url=resolved_base.rstrip("/") if resolved_base else None,
43 timeout_ms=resolved_timeout,
44 )

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected