dynamo.health_check

Health-check payload types and environment-driven configuration.

View as Markdown

dynamo.health_check publishes 1 classes and 1 functions. Source: lib/bindings/python/src/dynamo/health_check.py

Base class for managing health check payloads.

1from dynamo.health_check import HealthCheckPayload
1HealthCheckPayload()

Each backend should extend this class and set self.default_payload in their init method.

Environment variable DYN_HEALTH_CHECK_PAYLOAD can override the default.

lib/bindings/python/src/dynamo/health_check.py#L75

Public methods

init

1__init__()

Initialize health check payload.

Subclasses should call super().init() after setting self.default_payload.

source

to_dict

1to_dict() -> Dict[str, Any]

Get the health check payload as a dictionary.

Returns the environment override if DYN_HEALTH_CHECK_PAYLOAD is set, otherwise returns the default payload.

source

Load health check payload from environment variable.

1from dynamo.health_check import load_health_check_from_env
1load_health_check_from_env(env_var: str = 'DYN_HEALTH_CHECK_PAYLOAD') -> Optional[Dict[str, Any]]

Supports two formats:

  1. JSON string: export DYN_HEALTH_CHECK_PAYLOAD=’{“prompt”: “test”, “max_tokens”: 1}’
  2. File path: export DYN_HEALTH_CHECK_PAYLOAD=’@/path/to/health_check.json’

Parameters

env_var
str

Name of the environment variable to check (default: DYN_HEALTH_CHECK_PAYLOAD)

Returns

  • Optional[Dict[str, Any]] — Dict containing the health check payload, or None if not set.

lib/bindings/python/src/dynamo/health_check.py#L33