apache_beam.ml.inference.typesafe_inference module
Optional TypeSafe adapter for Beam decision models.
- class apache_beam.ml.inference.typesafe_inference.JevDecisionModel(model='jev-latest', timeout=10.0)[source]
Bases:
DecisionModelEvaluate Beam decision questions with Jev through the TypeSafe SDK.
Install the optional SDK from
typesafe_tests_requirements.txtand setTYPESAFE_API_KEYon the workers. The client is created when Beam enters the adapter context; its HTTP pool is reused until teardown. Choice and Score map directly to the SDK primitives. Boolean maps to Noul, whosenoulfield becomesBooleanAnswer.probability.The SDK retries 429 and server errors with exponential backoff, jitter, and
Retry-Aftersupport. Calls and retries block the processing thread; they do not coordinate rate limits across workers. Invalid answer keys, types, labels, numeric ranges, or probability keys raiseValueError.- Parameters:
model – TypeSafe model identifier, defaulting to
jev-latest.timeout – Timeout in seconds for HTTP operations. The SDK handles retries.