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

Enabling semantic ranking results in HTTP 500 errors #113

Closed
kikaragyozov opened this issue Jun 22, 2023 · 1 comment
Closed

Enabling semantic ranking results in HTTP 500 errors #113

kikaragyozov opened this issue Jun 22, 2023 · 1 comment

Comments

@kikaragyozov
Copy link

2023-06-22T07:25:06.592683253Z fail: Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware[1]
2023-06-22T07:25:06.592781202Z       An unhandled exception has occurred while executing the request.
2023-06-22T07:25:06.592813970Z       Azure.RequestFailedException: Highlighting is not supported for 'captions' parameter with 'none'.
2023-06-22T07:25:06.592858873Z       Parameter name: captions
2023-06-22T07:25:06.592863075Z       Status: 400 (Bad Request)
2023-06-22T07:25:06.592867453Z       ErrorCode: InvalidRequestParameter
2023-06-22T07:25:06.592871636Z       
2023-06-22T07:25:06.592875694Z       Content:
2023-06-22T07:25:06.592885155Z       {"error":{"code":"InvalidRequestParameter","message":"Highlighting is not supported for 'captions' parameter with 'none'.\r\nParameter name: captions","details":[{"code":"InvalidCaptionsOption","message":"Highlighting is not supported for 'captions' parameter with 'none'."}]}}
2023-06-22T07:25:06.592889568Z       
2023-06-22T07:25:06.592893559Z       Headers:
2023-06-22T07:25:06.593161545Z       Cache-Control: no-cache,no-store
2023-06-22T07:25:06.593171816Z       Pragma: no-cache
2023-06-22T07:25:06.593176598Z       Server: Microsoft-IIS/10.0
2023-06-22T07:25:06.593181519Z       client-request-id: 0ce20213-3a9e-4b1d-b956-63ebf179a5f8
2023-06-22T07:25:06.593186431Z       x-ms-client-request-id: 0ce20213-3a9e-4b1d-b956-63ebf179a5f8
2023-06-22T07:25:06.593190703Z       request-id: 0ce20213-3a9e-4b1d-b956-63ebf179a5f8
2023-06-22T07:25:06.593209231Z       elapsed-time: 54
2023-06-22T07:25:06.593213742Z       Strict-Transport-Security: REDACTED
2023-06-22T07:25:06.593220076Z       Date: Thu, 22 Jun 2023 07:25:06 GMT
2023-06-22T07:25:06.593224860Z       Content-Length: 277
2023-06-22T07:25:06.593227767Z       Content-Type: application/json; charset=utf-8
2023-06-22T07:25:06.593230589Z       Content-Language: REDACTED
2023-06-22T07:25:06.593233357Z       Expires: -1
2023-06-22T07:25:06.593236139Z       
2023-06-22T07:25:06.593240949Z          at Azure.Search.Documents.SearchClient.SearchInternal[T](SearchOptions options, String operationName, Boolean async, CancellationToken cancellationToken)
2023-06-22T07:25:06.593244524Z          at Azure.Search.Documents.SearchClient.SearchInternal[T](String searchText, SearchOptions options, Boolean async, CancellationToken cancellationToken)
2023-06-22T07:25:06.593247611Z          at Azure.Search.Documents.SearchClient.SearchAsync[T](String searchText, SearchOptions options, CancellationToken cancellationToken)
2023-06-22T07:25:06.593257855Z          at MinimalApi.Extensions.SearchClientExtensions.QueryDocumentsAsync(SearchClient searchClient, String query, RequestOverrides overrides, CancellationToken cancellationToken) in /src/backend/Extensions/SearchClientExtensions.cs:line 37
2023-06-22T07:25:06.593261229Z          at MinimalApi.Services.ReadRetrieveReadChatService.ReplyAsync(ChatTurn[] history, RequestOverrides overrides, CancellationToken cancellationToken) in /src/backend/Services/ReadRetrieveReadChatService.cs:line 91
2023-06-22T07:25:06.593264739Z          at MinimalApi.Extensions.WebApplicationExtensions.OnPostChatAsync(ChatRequest request, ReadRetrieveReadChatService chatService, CancellationToken cancellationToken) in /src/backend/Extensions/WebApplicationExtensions.cs:line 72
2023-06-22T07:25:06.593267766Z          at Microsoft.AspNetCore.Http.RequestDelegateFactory.ExecuteTaskResult[T](Task`1 task, HttpContext httpContext)
2023-06-22T07:25:06.593271490Z          at Microsoft.AspNetCore.Http.RequestDelegateFactory.<>c__DisplayClass90_2.<<HandleRequestBodyAndCompileRequestDelegateForJson>b__2>d.MoveNext()
2023-06-22T07:25:06.593275371Z       --- End of stack trace from previous location ---
2023-06-22T07:25:06.593279535Z          at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)
2023-06-22T07:25:06.593283903Z          at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddlewareImpl.<Invoke>g__Awaited|8_0(ExceptionHandlerMiddlewareImpl middleware, HttpContext context, Task task)

Those are my logs.

@kikaragyozov
Copy link
Author

After digging around, it seems the Azure Cognitive Search SDK for C# is responsible for this error. Passing QueryCaptionType.None gets serialized down to a value of none|highlight-False which is incorrect as the error explains. Is there really no workaround to this than ditching the whole SDK?

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

1 participant