From 7b49e580c0793d2b170c5e84788243dc815d6eef Mon Sep 17 00:00:00 2001 From: iomgaa Date: Wed, 19 Aug 2026 12:31:19 -0400 Subject: [PATCH] feat: expose the telemetry schema SQL to downstreams --- src/polygateway/__init__.py | 2 ++ tests/unit/test_package.py | 12 ++++++++++++ 2 files changed, 14 insertions(+) diff --git a/src/polygateway/__init__.py b/src/polygateway/__init__.py index a7bf20f..5a3cf9f 100644 --- a/src/polygateway/__init__.py +++ b/src/polygateway/__init__.py @@ -23,6 +23,7 @@ from polygateway.errors import ( from polygateway.ocr import OcrClient from polygateway.pricing import ModelPrice, PricingTable from polygateway.providers import DEFAULT_PROFILES, ProviderProfile, register_provider +from polygateway.telemetry.schema import telemetry_schema_sql from polygateway.types import ( EmbeddingResponse, LLMResponse, @@ -64,4 +65,5 @@ __all__ = [ "__version__", "gather_bounded", "register_provider", + "telemetry_schema_sql", ] diff --git a/tests/unit/test_package.py b/tests/unit/test_package.py index 2335bdc..fd33bcf 100644 --- a/tests/unit/test_package.py +++ b/tests/unit/test_package.py @@ -25,3 +25,15 @@ def test_ocr_public_surface_exported(): ): assert hasattr(polygateway, name), name assert name in polygateway.__all__, name + + +def test_telemetry_schema_sql_exported(): + """issue #13: manual 档下游需要主动索取"库要求的最小 schema"的顶层入口。 + + 同时钉住公共面**只增这一个名字**: `missing_columns_warning` 是 recorder 内部 + 共用的文案构造函数,导出它等于多一份永久承诺(库承诺公共面只增不删)。 + """ + assert "telemetry_schema_sql" in polygateway.__all__ + assert callable(polygateway.telemetry_schema_sql) + assert "missing_columns_warning" not in polygateway.__all__ + assert not hasattr(polygateway, "missing_columns_warning")