nv_ingest_api.internal.schemas.transform package#

Submodules#

nv_ingest_api.internal.schemas.transform.transform_image_caption_schema module#

pydantic model nv_ingest_api.internal.schemas.transform.transform_image_caption_schema.ImageCaptionExtractionSchema[source]#

Bases: BaseModel

Show JSON schema
{
   "title": "ImageCaptionExtractionSchema",
   "type": "object",
   "properties": {
      "api_key": {
         "default": "",
         "title": "Api Key",
         "type": "string"
      },
      "endpoint_url": {
         "default": "https://integrate.api.nvidia.com/v1/chat/completions",
         "title": "Endpoint Url",
         "type": "string"
      },
      "prompt": {
         "default": "Caption the content of this image:",
         "title": "Prompt",
         "type": "string"
      },
      "model_name": {
         "default": "nvidia/llama-3.1-nemotron-nano-vl-8b-v1",
         "title": "Model Name",
         "type": "string"
      },
      "raise_on_failure": {
         "default": false,
         "title": "Raise On Failure",
         "type": "boolean"
      }
   },
   "additionalProperties": false
}

Config:
  • extra: str = forbid

Fields:
Validators:
  • _coerce_api_key_none » api_key

  • _coerce_none_to_empty » all fields

field api_key: str = ''#
Validated by:
  • _coerce_api_key_none

  • _coerce_none_to_empty

field endpoint_url: str = 'https://integrate.api.nvidia.com/v1/chat/completions'#
Validated by:
  • _coerce_none_to_empty

field model_name: str = 'nvidia/llama-3.1-nemotron-nano-vl-8b-v1'#
Validated by:
  • _coerce_none_to_empty

field prompt: str = 'Caption the content of this image:'#
Validated by:
  • _coerce_none_to_empty

field raise_on_failure: bool = False#
Validated by:
  • _coerce_none_to_empty

nv_ingest_api.internal.schemas.transform.transform_image_filter_schema module#

pydantic model nv_ingest_api.internal.schemas.transform.transform_image_filter_schema.ImageFilterSchema[source]#

Bases: BaseModel

Show JSON schema
{
   "title": "ImageFilterSchema",
   "type": "object",
   "properties": {
      "raise_on_failure": {
         "default": false,
         "title": "Raise On Failure",
         "type": "boolean"
      },
      "cpu_only": {
         "default": false,
         "title": "Cpu Only",
         "type": "boolean"
      }
   },
   "additionalProperties": false
}

Config:
  • extra: str = forbid

Fields:
field cpu_only: Annotated[bool, Strict(strict=True)] = False#
Constraints:
  • strict = True

field raise_on_failure: Annotated[bool, Strict(strict=True)] = False#
Constraints:
  • strict = True

nv_ingest_api.internal.schemas.transform.transform_text_embedding_schema module#

pydantic model nv_ingest_api.internal.schemas.transform.transform_text_embedding_schema.TextEmbeddingSchema[source]#

Bases: BaseModel

Show JSON schema
{
   "title": "TextEmbeddingSchema",
   "type": "object",
   "properties": {
      "api_key": {
         "default": "",
         "title": "Api Key",
         "type": "string"
      },
      "batch_size": {
         "default": 4,
         "title": "Batch Size",
         "type": "integer"
      },
      "embedding_model": {
         "default": "nvidia/llama-3.2-nv-embedqa-1b-v2",
         "title": "Embedding Model",
         "type": "string"
      },
      "embedding_nim_endpoint": {
         "default": "http://embedding:8000/v1",
         "title": "Embedding Nim Endpoint",
         "type": "string"
      },
      "encoding_format": {
         "default": "float",
         "title": "Encoding Format",
         "type": "string"
      },
      "httpx_log_level": {
         "$ref": "#/$defs/LogLevel",
         "default": "WARNING"
      },
      "input_type": {
         "default": "passage",
         "title": "Input Type",
         "type": "string"
      },
      "raise_on_failure": {
         "default": false,
         "title": "Raise On Failure",
         "type": "boolean"
      },
      "truncate": {
         "default": "END",
         "title": "Truncate",
         "type": "string"
      },
      "text_elements_modality": {
         "default": "text",
         "title": "Text Elements Modality",
         "type": "string"
      },
      "image_elements_modality": {
         "default": "text",
         "title": "Image Elements Modality",
         "type": "string"
      },
      "structured_elements_modality": {
         "default": "text",
         "title": "Structured Elements Modality",
         "type": "string"
      },
      "audio_elements_modality": {
         "default": "text",
         "title": "Audio Elements Modality",
         "type": "string"
      }
   },
   "$defs": {
      "LogLevel": {
         "enum": [
            "DEFAULT",
            "DEBUG",
            "INFO",
            "WARNING",
            "ERROR",
            "CRITICAL"
         ],
         "title": "LogLevel",
         "type": "string"
      }
   },
   "additionalProperties": false
}

Config:
  • extra: str = forbid

Fields:
Validators:
  • _coerce_api_key_none » api_key

  • _coerce_none_to_empty » all fields

field api_key: str = ''#
Validated by:
  • _coerce_api_key_none

  • _coerce_none_to_empty

field audio_elements_modality: str = 'text'#
Validated by:
  • _coerce_none_to_empty

field batch_size: int = 4#
Validated by:
  • _coerce_none_to_empty

field embedding_model: str = 'nvidia/llama-3.2-nv-embedqa-1b-v2'#
Validated by:
  • _coerce_none_to_empty

field embedding_nim_endpoint: str = 'http://embedding:8000/v1'#
Validated by:
  • _coerce_none_to_empty

field encoding_format: str = 'float'#
Validated by:
  • _coerce_none_to_empty

field httpx_log_level: LogLevel = LogLevel.WARNING#
Validated by:
  • _coerce_none_to_empty

field image_elements_modality: str = 'text'#
Validated by:
  • _coerce_none_to_empty

field input_type: str = 'passage'#
Validated by:
  • _coerce_none_to_empty

field raise_on_failure: bool = False#
Validated by:
  • _coerce_none_to_empty

field structured_elements_modality: str = 'text'#
Validated by:
  • _coerce_none_to_empty

field text_elements_modality: str = 'text'#
Validated by:
  • _coerce_none_to_empty

field truncate: str = 'END'#
Validated by:
  • _coerce_none_to_empty

nv_ingest_api.internal.schemas.transform.transform_text_splitter_schema module#

pydantic model nv_ingest_api.internal.schemas.transform.transform_text_splitter_schema.TextSplitterSchema[source]#

Bases: BaseModel

Show JSON schema
{
   "title": "TextSplitterSchema",
   "type": "object",
   "properties": {
      "tokenizer": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Tokenizer"
      },
      "chunk_size": {
         "default": 1024,
         "exclusiveMinimum": 0,
         "title": "Chunk Size",
         "type": "integer"
      },
      "chunk_overlap": {
         "default": 150,
         "minimum": 0,
         "title": "Chunk Overlap",
         "type": "integer"
      },
      "raise_on_failure": {
         "default": false,
         "title": "Raise On Failure",
         "type": "boolean"
      }
   },
   "additionalProperties": false
}

Config:
  • extra: str = forbid

Fields:
Validators:
field chunk_overlap: int = 150#
Constraints:
  • ge = 0

Validated by:
field chunk_size: int = 1024#
Constraints:
  • gt = 0

field raise_on_failure: bool = False#
field tokenizer: str | None = None#
validator check_chunk_overlap  »  chunk_overlap[source]#

Module contents#