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

HttpResponseError while creating indexer #239

Open
smaddinieni opened this issue May 28, 2024 · 6 comments
Open

HttpResponseError while creating indexer #239

smaddinieni opened this issue May 28, 2024 · 6 comments

Comments

@smaddinieni
Copy link

HttpResponseError: () Error with data source: Unexpected character encountered while parsing value: �. Path '', line 0, position 0. Please adjust your data source definition in order to proceed.
Code:
Message: Error with data source: Unexpected character encountered while parsing value: �. Path '', line 0, position 0. Please adjust your data source definition in order to proceed.

@smaddinieni
Copy link
Author

I was able to create the data source, skillset and index.

@mattgotteiner
Copy link
Member

Sorry - it's hard to reproduce this issue without any code or HTTP request shared

@smaddinieni
Copy link
Author

Im trying demo-python/code/e2e-demos/azure-ai-search-multimodal-build-demo.ipynb

this is the code I'm trying to execute to create image indexer

def create_and_run_indexer(
indexer_client, indexer_name, skillset_name, index_name, data_source_name
):
indexer = SearchIndexer(
name=indexer_name,
description="Indexer to index documents and generate embeddings",
skillset_name=skillset_name,
target_index_name=index_name,
data_source_name=data_source_name,
parameters=IndexingParameters(
configuration=IndexingParametersConfiguration(
parsing_mode=BlobIndexerParsingMode.JSON_ARRAY,
query_timeout=None,
),
),
field_mappings=[FieldMapping(source_field_name="id", target_field_name="id")],
output_field_mappings=[
FieldMapping(
source_field_name="/document/captionVector",
target_field_name="captionVector",
),
FieldMapping(
source_field_name="/document/imageVector",
target_field_name="imageVector",
),
],
)

indexer_client.create_or_update_indexer(indexer)
print(f"{indexer_name} created or updated.")

indexer_client.run_indexer(indexer_name)
print(
    f"{indexer_name} is running. If queries return no results, please wait a bit and try again."
)

indexer_client = SearchIndexerClient(
endpoint=SEARCH_SERVICE_ENDPOINT, credential=azure_search_credential
)
data_source_name = f"{INDEX_NAME}-blob"
indexer_name = f"{INDEX_NAME}-indexer"

create_and_run_indexer(indexer_client, indexer_name, skillset_name, INDEX_NAME, data_source_name)

@smaddinieni
Copy link
Author

INFO:azure.core.pipeline.policies.http_logging_policy:Request URL: 'https://cognitivesearch-openai-semantic.search.windows.net/indexers('build-multimodal-demo-indexer')?api-version=REDACTED'
Request method: 'PUT'
Request headers:
'Content-Type': 'application/json'
'Content-Length': '1050'
'api-key': 'REDACTED'
'Prefer': 'REDACTED'
'Accept': 'application/json;odata.metadata=minimal'
'x-ms-client-request-id': 'd9a2bc71-1db0-11ef-840f-145afc07673a'
'User-Agent': 'azsdk-python-search-documents/11.6.0b4 Python/3.11.7 (Windows-10-10.0.19045-SP0)'
A body is sent with the request
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): cognitivesearch-openai-semantic.search.windows.net:443
DEBUG:urllib3.connectionpool:https://cognitivesearch-openai-semantic.search.windows.net:443 "PUT /indexers('build-multimodal-demo-indexer')?api-version=2024-05-01-preview HTTP/1.1" 400 209
INFO:azure.core.pipeline.policies.http_logging_policy:Response status: 400
Response headers:
'Cache-Control': 'no-cache,no-store'
'Pragma': 'no-cache'
'Content-Length': '209'
'Content-Type': 'application/json; charset=utf-8'
'Content-Language': 'REDACTED'
'Expires': '-1'
'Server': 'Microsoft-IIS/10.0'
'request-id': 'd9a2bc71-1db0-11ef-840f-145afc07673a'
'elapsed-time': 'REDACTED'
'Strict-Transport-Security': 'REDACTED'
'Date': 'Wed, 29 May 2024 11:44:48 GMT'

@mattgotteiner
Copy link
Member

Can you try this notebook and see if it works?

https://github.com/Azure/azure-search-vector-samples/blob/main/demo-python/code/embeddings/multimodal-embeddings/multimodal-embeddings.ipynb

You'll need azd as it also sets up a sample service and AI services with an indexer for you

@Xu-Ruixin
Copy link

Hi, have you found a solution to this error? I’m encountering the same issue with this demo. haha

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

3 participants