-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
[Bug]: LLMSingleSelector - Got invalid JSON object #17396
Comments
Hey there, @tbuziak! I'm here to help you with any bugs, questions, or contributions you have. Let's squash this bug together! I found a similar closed issue that might be relevant to your problem: [Bug]: SelectionOutputParser incorrectly parsing Router Query Engine. This issue was resolved by a pull request that updated the In your case, the error message indicates that the JSON object is not being constructed correctly, specifically with unhashable keys and missing double quotes around property names. This suggests that the JSON output from the To continue talking to Dosu, mention @dosu. Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other |
Yea, and single selector can only select one choice. Use a multil selector if you expect user inputs to select multiple choices |
The same error occurs with LLMMultiSelector. |
In llama_index/llama-index-core/llama_index/core/output_parsers/selection.py, the escape_curly_braces function replaces the characters { } with double {{ }}. Without _escape_curly_braces, the selector works correctly. def _escape_curly_braces(input_string: str) -> str: |
Bug Description
I created a RouterQueryEngine with the LLMMultiSelector, and a few query_engine_tools. When querying, I get the following error. The engine either parses or builds the list of choices incorrectly.
With PydanticMultiSelector and Groq(), the error does not occur. I need to use the LLM model with Ollama(), and I must use LLMSingleSelector.
Version
0.12.8
Steps to Reproduce
The error occurs if query_engine_tools contains more than one choice and the user's question pertains to the second or subsequent choice. If the question pertains to the first choice, the error does not occur.
Relevant Logs/Tracbacks
The text was updated successfully, but these errors were encountered: