nv_ingest_api.internal.schemas package#

Subpackages#

Submodules#

nv_ingest_api.internal.schemas.mixins module#

Shared mixins for Pydantic schemas.

pydantic model nv_ingest_api.internal.schemas.mixins.LowercaseProtocolMixin[source]#

Bases: BaseModel

Mixin that automatically lowercases any field ending with ‘_infer_protocol’.

This ensures case-insensitive handling of protocol values (e.g., “HTTP” -> “http”). Apply this mixin to any schema that has protocol fields to normalize user input.

Examples

>>> class MyConfigSchema(LowercaseProtocolMixin):
...     yolox_infer_protocol: str = ""
...     ocr_infer_protocol: str = ""
>>>
>>> config = MyConfigSchema(yolox_infer_protocol="GRPC", ocr_infer_protocol="HTTP")
>>> config.yolox_infer_protocol
'grpc'
>>> config.ocr_infer_protocol
'http'

Show JSON schema
{
   "title": "LowercaseProtocolMixin",
   "description": "Mixin that automatically lowercases any field ending with '_infer_protocol'.\n\nThis ensures case-insensitive handling of protocol values (e.g., \"HTTP\" -> \"http\").\nApply this mixin to any schema that has protocol fields to normalize user input.\n\nExamples\n--------\n>>> class MyConfigSchema(LowercaseProtocolMixin):\n...     yolox_infer_protocol: str = \"\"\n...     ocr_infer_protocol: str = \"\"\n>>>\n>>> config = MyConfigSchema(yolox_infer_protocol=\"GRPC\", ocr_infer_protocol=\"HTTP\")\n>>> config.yolox_infer_protocol\n'grpc'\n>>> config.ocr_infer_protocol\n'http'",
   "type": "object",
   "properties": {}
}

Validators:
  • _lowercase_protocol_fields » all fields

Module contents#