Skip to content

Conversation

@kundadebdatta
Copy link
Member

Pull Request Template

Description

This PR adds the support for Float16 in VectorDataType. The Float16 value for the vector data type is now supported from the backend, Therefore, the goal of this PR is to add the support back in the VectorDataType.

{
    "indexingPolicy": {
        "automatic": true,
        "indexingMode": "Consistent",
        "includedPaths": [
            {
                "path": "/*",
                "indexes": []
            }
        ],
        "excludedPaths": [],
        "compositeIndexes": [],
        "spatialIndexes": [],
        "vectorIndexes": [
            {
                "path": "/vector1",
                "type": "flat"
            },
            {
                "path": "/vector2",
                "type": "quantizedFlat",
                "quantizationByteSize": 3,
                "vectorIndexShardKey": [
                    "/Country"
                ]
            },
            {
                "path": "/vector3",
                "type": "diskANN",
                "quantizationByteSize": 2,
                "indexingSearchListSize": 100,
                "vectorIndexShardKey": [
                    "/ZipCode"
                ]
            }
        ]
    },
    "vectorEmbeddingPolicy": {
        "vectorEmbeddings": [
            {
                "path": "/vector1",
                "dataType": "int8",
                "dimensions": 1200,
                "distanceFunction": "dotproduct"
            },
            {
                "path": "/vector2",
                "dataType": "uint8",
                "dimensions": 3,
                "distanceFunction": "cosine"
            },
            {
                "path": "/vector3",
                "dataType": "float32",
                "dimensions": 400,
                "distanceFunction": "euclidean"
            },
            {
                "path": "/vector4",
                "dataType": "float16",
                "dimensions": 3,
                "distanceFunction": "dotproduct"
            }
        ]
    },
    "id": "test_vector_container",
    "partitionKey": {
        "paths": [
            "/pk"
        ],
        "kind": "Hash"
    }
}

Type of change

Please delete options that are not relevant.

  • New feature (non-breaking change which adds functionality)

Closing issues

To automatically close an issue: closes #5367

@kundadebdatta kundadebdatta requested a review from Copilot August 20, 2025 18:04
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds support for the Float16 data type to the VectorDataType enum in the Azure Cosmos DB .NET SDK. The backend now supports Float16 vectors, so this change enables the SDK to utilize this new data type.

  • Adds Float16 enum value to VectorDataType with proper serialization attribute
  • Updates test data to include Float16 vector embedding examples
  • Updates API contract tests to verify the new enum member

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
VectorDataType.cs Adds Float16 enum value with EnumMember attribute
SettingsContractTests.cs Updates test data and assertions to include Float16 vector embedding
DotNetSDKAPI.json Updates API contract to include the new Float16 enum member

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@kundadebdatta kundadebdatta marked this pull request as ready for review August 20, 2025 18:23
Pilchie
Pilchie previously approved these changes Aug 20, 2025
@kundadebdatta kundadebdatta added the auto-merge Enables automation to merge PRs label Aug 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-merge Enables automation to merge PRs vector-similarity

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Vector Index] Add Support for Float16 Data Type for Embedding Contract

4 participants