bc0fcc4719
tools/ and tests/ are not in the package, so this release ships library code identical to 1.3.1 byte for byte. Anyone who only uses the library can skip it. Saying so up front is better than letting someone diff the wheel and wonder what they missed. What is in it: the retention script can now be told which table it may delete from, and the Postgres tests no longer touch the table three migration projects also write to. The --table entry documents the failure it prevents rather than just the flag. search_path starts with "$user", so the same command run as a different role can resolve to a different table, and the script's own printout of what it resolved lands in the same run as the DELETE.
86 lines
2.3 KiB
Python
86 lines
2.3 KiB
Python
"""PolyGateway: 实验室统一的大语言模型(LLM/VLM/OCR)调度与中转库。
|
|
|
|
治理单位是一次模型调用: 多源选择、限流、错误分类与重试、熔断、响应缓存、
|
|
流式活性看门狗、遥测。架构单一事实源见 research-wiki/ARCHITECTURE.md。
|
|
顶层导出即公共 API 面: 错误四分类必须从这里引用(ARCH §5.1 约定②)。
|
|
"""
|
|
|
|
from polygateway.client import GatewayClient, gather_bounded
|
|
from polygateway.config import EmbeddingSettings, GatewaySettings, OcrSettings
|
|
from polygateway.embedding import EmbeddingClient
|
|
from polygateway.errors import (
|
|
AllSourcesExhausted,
|
|
CircuitOpenError,
|
|
GatewayUnavailableError,
|
|
GovernanceBackendError,
|
|
PolyGatewayError,
|
|
RequestRejectedError,
|
|
ResultInvalidError,
|
|
SourceDeadError,
|
|
SourceNotConfiguredError,
|
|
TransientError,
|
|
)
|
|
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.thinking import (
|
|
ThinkingCapability,
|
|
ThinkingUnsupportedError,
|
|
get_capability,
|
|
register_capability,
|
|
resolve_thinking,
|
|
)
|
|
from polygateway.types import (
|
|
EmbeddingResponse,
|
|
LLMResponse,
|
|
OcrLayoutElement,
|
|
OcrLayoutResult,
|
|
OcrTextResult,
|
|
SourceConfig,
|
|
TelemetryStatus,
|
|
ThinkingObservation,
|
|
)
|
|
|
|
__version__ = "1.3.2"
|
|
|
|
__all__ = [
|
|
"DEFAULT_PROFILES",
|
|
"AllSourcesExhausted",
|
|
"CircuitOpenError",
|
|
"EmbeddingClient",
|
|
"EmbeddingResponse",
|
|
"EmbeddingSettings",
|
|
"GatewayClient",
|
|
"GatewaySettings",
|
|
"GatewayUnavailableError",
|
|
"GovernanceBackendError",
|
|
"LLMResponse",
|
|
"ModelPrice",
|
|
"OcrClient",
|
|
"OcrLayoutElement",
|
|
"OcrLayoutResult",
|
|
"OcrSettings",
|
|
"OcrTextResult",
|
|
"PolyGatewayError",
|
|
"PricingTable",
|
|
"ProviderProfile",
|
|
"RequestRejectedError",
|
|
"ResultInvalidError",
|
|
"SourceConfig",
|
|
"SourceDeadError",
|
|
"SourceNotConfiguredError",
|
|
"TelemetryStatus",
|
|
"ThinkingCapability",
|
|
"ThinkingObservation",
|
|
"ThinkingUnsupportedError",
|
|
"TransientError",
|
|
"__version__",
|
|
"gather_bounded",
|
|
"get_capability",
|
|
"register_capability",
|
|
"register_provider",
|
|
"resolve_thinking",
|
|
"telemetry_schema_sql",
|
|
]
|