Skip to content

Issue while trying to create index with error The request is invalid. Details: An unexpected 'StartArray' node was found when reading from the JSON reader. A 'PrimitiveValue' node was expected. #262

Open
@avisheka93

Description

@avisheka93

index_client = SearchIndexClient(
endpoint=service_endpoint,
credential=cognitive_search_credential,
)

Index name to use

index_name = f"vs_spn_chatrules"

search_client = SearchClient(
endpoint=service_endpoint,
index_name=index_name,
credential=cognitive_search_credential,
)

Creating an Azure AI Search Vector Store

vector_store = AzureAISearchVectorStore(
search_or_index_client=index_client,
filterable_metadata_field_keys=metadata_fields,
index_name=index_name,
index_management=IndexManagement.CREATE_IF_NOT_EXISTS,
id_field_key="id",
chunk_field_key="chunk", #content
embedding_field_key="embedding", #content_vector
embedding_dimensionality=1536,
metadata_string_field_key="metadata",
doc_id_field_key="doc_id",
language_analyzer="en.lucene",
vector_algorithm_type="exhaustiveKnn", #HNSW focuses on approximate methods for efficiency, KNN ensures exactness through exhaustive searches.
)

Settings.llm = llm
Settings.embed_model = embed_model

storage_context = StorageContext.from_defaults(vector_store=vector_store)

VectorStoreIndex.from_documents

index = VectorStoreIndex.from_documents(
all_docs, storage_context=storage_context
)

all_docs is a list of documents with document metadata and documents

while im trying to create index its gives error

HttpResponseError: () The request is invalid. Details: An unexpected 'StartArray' node was found when reading from the JSON reader. A 'PrimitiveValue' node was expected.
Code:
Message: The request is invalid. Details: An unexpected 'StartArray' node was found when reading from the JSON reader. A 'PrimitiveValue' node was expected.

any guidance on this

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions