OmniParser icon indicating copy to clipboard operation
OmniParser copied to clipboard

Failed to parse json response of LLM

Open GavinZha0 opened this issue 8 months ago • 2 comments

json.decoder.JSONDecodeError: Expecting property name enclosed in double quotes

{
    "Reasoning": "The current screen shows the  login page with the username and password fields filled. The 'Please wait...' message indicates that the system is processing the login request. Therefore, the next step should be to wait for the login process to complete.",
    "Next Action": "wait",
}

This is a format issue. There is a unexpected comma at end of the json string. The issue doesn't happen frequently. But sometimes. Of course, this should be fixed by LLM. I just think it would be better if OmniParser can be enhanced to ignore some json issues like this.

GavinZha0 avatar Mar 14 '25 20:03 GavinZha0

maybe using https://pypi.org/project/json5/

cjen07 avatar Mar 21 '25 02:03 cjen07

Or https://github.com/mangiucugna/json_repair/

abrichr avatar Mar 24 '25 02:03 abrichr