Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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 opened this issue Aug 6, 2024 · 1 comment

Comments

@avisheka93
Copy link

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

@farzad528
Copy link
Collaborator

can you ensure you are using azure-search-documents==11.4.0 since that is the version that's integrated within llamaindex.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants