अपने application के policy, plan capabilities, और dimensions के साथ read-only introspection client.get_config / get_capabilities / get_dimensions। कोई credits consumed नहीं।
SDK 2.6.0 में added। हर API key एक application से bound है जिसका governance policy centrally dashboard में configured है। ये तीन methods आपके code को runtime पर वह configuration को read करने देते हैं — startup checks, dashboards, और monitoring के लिए useful। ये read-only हैं और कोई credits consume नहीं करते।
get_config() application को return करता है जिससे key bound है, इसका governance policy, और क्या enforcement actively responses को shape कर रहा है या केवल इन्हें observe कर रहा है।
from rail_score_sdk import RailScoreClientclient = RailScoreClient(api_key="YOUR_RAIL_API_KEY")cfg = client.get_config()print(f"Application: {cfg.application.id} ({cfg.application.environment})")print(f"Plan: {cfg.application.plan}")print(f"Enforcement: {cfg.policy.enforcement}") # log_only | block | regenerateprint(f"Eval mode: {cfg.policy.eval_mode}") # basic | deepprint(f"Threshold: {cfg.policy.overall_threshold}")print(f"Mode: {cfg.enforcement.mode}") # enforce | monitorif cfg.policy.locked: print("Policy is locked by an administrator; per-request overrides are ignored.")
get_capabilities() यह report करता है कि key का plan क्या access कर सकता है — evaluation modes, compliance frameworks, agent और DPDP features, और request limits। इसे use करें behavior को adapt करने के लिए बिना plan assumptions को hard-code किए।
get_dimensions() आठ RAIL dimensions को return करता है weight और threshold के साथ जो आपके application के लिए configured है, plus score bands जिसमें एक result fall होता है।
dims = client.get_dimensions()for d in dims.dimensions: print(f"{d.get('name'):14} weight={d.get('weight')} threshold={d.get('threshold')}")for band in dims.score_bands: print(band.get("band"), ">=", band.get("min"))
हर typed result भी एक .raw dict को expose करता है unmodified response के साथ, तो नए fields हमेशा reachable होते हैं भले ही SDK ने अभी एक typed accessor add नहीं किया।