base
Class info¶
Classes¶
| Name | Children | Inherits |
|---|---|---|
| CodexBaseModel codexed.models.base Base model for all Codex API models. |
||
| JsonRpcError codexed.models.base JSON-RPC 2.0 error object. |
||
| JsonRpcNotification codexed.models.base JSON-RPC 2.0 notification message (no id). |
||
| JsonRpcRequest codexed.models.base JSON-RPC 2.0 request message. |
||
| JsonRpcResponse codexed.models.base JSON-RPC 2.0 response message. |
🛈 DocStrings¶
IS_DEV
module-attribute
¶
Strict models (extra="forbid"): set in this repo's tests (tests/conftest.py).
Not inferred from "pytest" in sys.modules: any process that imported pytest (another
project's tests, a notebook) would reject events with fields newer than the schema.
CodexBaseModel
¶
Bases: BaseModel
Base model for all Codex API models.
Provides:
- Strict validation in tests (CODEXED_STRICT_MODELS=1: forbids extra fields to catch
schema changes)
- Lenient validation in production (ignores extra fields for forward compat)
- Snake_case Python fields with camelCase JSON aliases
- Both field names and aliases accepted for parsing (populate_by_name=True)
Source code in src/codexed/models/base.py
JsonRpcError
¶
JsonRpcNotification
¶
Bases: CodexBaseModel
JSON-RPC 2.0 notification message (no id).