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

Randomatic error in OpenaiRagQueryExecutor #11

Open
alkampfergit opened this issue Nov 15, 2024 · 1 comment
Open

Randomatic error in OpenaiRagQueryExecutor #11

alkampfergit opened this issue Nov 15, 2024 · 1 comment

Comments

@alkampfergit
Copy link
Owner

It seems that we had some error in the enumerateArray, probably the api did not respond something useful, but the problem is that we have a generic error and absolutely no clue on what really happened.

[12:07:07 ERR][Jarvis.AI.Host.Controllers.RagController] Internal error answering question: Exception in handler KernelMemory.Extensions.QueryPipeline.OpenaiRagQueryExecutor - System.InvalidOperationException: The requested operation requires an element of type 'Array', but the target element has type 'Number'.
   at System.Text.Json.ThrowHelper.ThrowJsonElementWrongTypeException(JsonTokenType expectedType, JsonTokenType actualType)
   at System.Text.Json.JsonElement.EnumerateArray()
   at KernelMemory.Extensions.QueryPipeline.OpenaiRagQueryExecutor.GenerateAnswerAsync(String question, String documents, CancellationToken token)
   at KernelMemory.Extensions.QueryPipeline.OpenaiRagQueryExecutor.OnHandleAsync(UserQuestion userQuestion, CancellationToken cancellationToken)
   at KernelMemory.Extensions.UserQuestionPipeline.ExecuteQuery(UserQuestion userQuestion, CancellationToken cancellationToken)
@alkampfergit
Copy link
Owner Author

Error seems to be related to this line

var citations = ((JsonElement)toolCall.Arguments["documents"]).EnumerateArray().Select(e => e.GetInt32() - 1).ToHashSet();

Probably when there is no any citations the arguments passed to documents it is not an empty array, but has a type number, do not know why it happens, but to replicate it is possible to ask several time for question that cannot be answered by the memory.

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