Azure Cognitive Search vector field must be Collection(Edm.Single) type when using with OpenAI integration

I’m working on connecting Azure Cognitive Search with OpenAI’s gpt-4o-128k model for vector search functionality. When I make requests to the API, I keep getting an error about the vector field type.

API URL I’m using:
https:///openai/deployments/gpt-4o-128k/chat/completions?api-version=2024-10-21

My request payload:

{
    "model": "gpt-4o-128k",
    "messages": [
        {
            "role": "user",
            "content": "how do I establish a company?"
        },
        {
            "role": "system",
            "content": "You are a helpful support agent focused on delivering clear and helpful responses to users. Please analyze the user question and respond with accurate details"
        }
    ],
    "data_sources": [
        {
            "type": "azure_search",
            "parameters": {
                "index_name": "company_index",
                "query_type": "vector",
                "embedding_dependency": {
                    "type": "deployment_name",
                    "deployment_name": "text-embedding-ada-002"
                },
                "fields_mapping": {
                    "content_fields": [
                        "document_text",
                        "combined_data"
                    ],
                    "vector_fields": [
                        "document_text",
                        "combined_data"
                    ]
                }
            }
        }
    ]
}

Error response I get:

{
    "error": {
        "requestid": "a15bc892-7d4f-3e88-92dd",
        "code": 400,
        "message": "An error occurred when calling Azure Cognitive Search: Azure Search: Please assign a proper column/field for vector search. It should be of type Collection(Edm.Single)"
    }
}

Any help would be great!

yea, looks like ur vector_fields need to be set to Collection(Edm.Single). they cant just be normal text types, make sure u configure em right in ur Azure index.

This topic was automatically closed 4 days after the last reply. New replies are no longer allowed.