Azure / azure-sdk-for-net

This repository is for active development of the Azure SDK for .NET. For consumers of the SDK we recommend visiting our public developer docs at https://learn.microsoft.com/dotnet/azure/ or our versioned developer docs at https://azure.github.io/azure-sdk-for-net.
MIT License
5.47k stars 4.8k forks source link

[BUG] Error using vector search with ImageVectorFieldNames #46705

Open druidajes opened 3 weeks ago

druidajes commented 3 weeks ago

Library name and version

Azure.AI.OpenAI 2.0.0.0

Describe the bug

When I use vector search with ImageVectorFieldNames, an error occurs

Image

ChatCompletionOptions options = new();

options.AddDataSource(new AzureSearchChatDataSource()
{
    Endpoint = _optionsAzureAISearch.Endpoint,
    IndexName = _optionsAzureAISearch.IndexName,
    Authentication = DataSourceAuthentication.FromApiKey(_optionsAzureAISearch.Key),
    QueryType = DataSourceQueryType.VectorSemanticHybrid,
    SemanticConfiguration = _optionsAzureAISearch.IndexName + "-semantic-configuration",
    VectorizationSource =  DataSourceVectorizer.FromDeploymentName(_optionsAzureOpenAIOptions.EmbeddingsModelDeploymentName),
    InScope = true,
    TopNDocuments = 3,
    FieldMappings = new DataSourceFieldMappings()
    {
        ContentFieldNames = { "chunk" },
        FilePathFieldName = "metadata_storage_name",
        TitleFieldName = "title",
        UrlFieldName = "metadata_storage_path",
        VectorFieldNames = { "text_vector" },
        ImageVectorFieldNames = { "image_vector" }
    },

});

Image

However, if I don't use ImageVectorFieldNames, no error occurs.

Expected behavior

That you can search for image vectors

Actual behavior

Cannot search for image vectors

Reproduction Steps

The exception is raised from the code provided above

Environment

No response

github-actions[bot] commented 3 weeks ago

Thank you for your feedback. Tagging and routing to the team member best able to assist.

AngelosP commented 3 weeks ago

Hi @druidajes ,

Thank you for raising this issue! Please hang tight while we take a look and feel free to add more details if you have any.