microsoft/semantic-kernel · error · VectorStoreOperationException

Unsupported dtype '{dtype}' for field '{field.name}'. Suppor

Error message

Unsupported dtype '{dtype}' for field '{field.name}'. Supported dtypes: {', '.join(KIND_MAP.keys())}

What it means

Thrown in OracleCollection.__init__ when a vector field's dtype (field.type_) is not one of the KIND_MAP keys: float32, float, float64, int8, uint8, binary. The default is float32 when type_ is unset, so this only fires for explicitly unsupported dtypes.

Source

Thrown at python/semantic_kernel/connectors/oracle.py:384

            if field.type_ == "UUID"
        ]

        # Validate key/data/vector field once per life-cycle
        key_field = self.definition.key_field
        key_field_name = key_field.storage_name or key_field.name
        self._validate_identifiers(key_field_name)

        for field in self.definition.data_fields:
            data_field_name = field.storage_name or field.name
            self._validate_identifiers(data_field_name)

        for field in self.definition.vector_fields:
            vector_field_name = field.storage_name or field.name
            self._validate_identifiers(vector_field_name)

            dtype = field.type_ or "float32"
            if dtype not in KIND_MAP:
                raise VectorStoreOperationException(
                    f"Unsupported dtype '{dtype}' for field '{field.name}'. "
                    f"Supported dtypes: {', '.join(KIND_MAP.keys())}"
                )

    @override
    async def __aenter__(self) -> "OracleCollection":
        return self

    @override
    async def __aexit__(self, *args: Any) -> None:
        # Only close the connection pool if it was created by the collection itself.
        if self.managed_client and self.connection_pool:
            try:
                await self.connection_pool.close()
            except Exception as e:
                logger.warning("Error closing Oracle connection pool: %s", e)
            finally:
                self.connection_pool = None

View on GitHub (pinned to c028a0c7dc)

Solutions

  1. Set the vector field type_ to one of: float32, float, float64, int8, uint8, binary
  2. Match the dtype to your embedding model's output (almost always float32)
  3. For binary embeddings use type_='binary' or 'uint8' as appropriate

Example fix

# before
VectorStoreField(name='embedding', type_='float16', dimensions=768)  # raises 1511

# after
VectorStoreField(name='embedding', type_='float32', dimensions=768)  # default, safe
Defensive patterns

Strategy: type-guard

Validate before calling

SUPPORTED_VECTOR_DTYPES = {'float32', 'float', 'float64', 'int8', 'uint8', 'binary'}

def valid_vector_dtype(dtype: str | None) -> bool:
    return (dtype or 'float32') in SUPPORTED_VECTOR_DTYPES

for vf in definition.vector_fields:
    if not valid_vector_dtype(vf.type_):
        raise ValueError(f'Vector field {vf.name} has unsupported dtype {vf.type_}')

Type guard

SUPPORTED_VECTOR_DTYPES = {'float32', 'float', 'float64', 'int8', 'uint8', 'binary'}

def is_supported_vector_dtype(dtype: str | None) -> bool:
    return isinstance(dtype, str) and dtype in SUPPORTED_VECTOR_DTYPES

Try / catch

from semantic_kernel.exceptions import VectorStoreOperationException

try:
    collection = OracleCollection(record_type=MyModel, definition=definition)
except VectorStoreOperationException as e:
    if 'Unsupported dtype' in str(e):
        # set the offending vector field type_ to 'float32'
        ...

Prevention

When it happens

Trigger: Defining a vector field with type_='float16', type_='int32', type_='int64', or any string outside KIND_MAP. Fires at collection construction.

Common situations: Using an embedding/quantization output type the connector does not support; typo in the dtype string; mismatch between embedding model output and the connector's supported vector element types.

Related errors


AI-assisted analysis of microsoft/semantic-kernel@c028a0c7dc (2026-08-13). Data as JSON: /api/errors/cd23590a18abe62f. Report an issue: GitHub.