Skip to content

bug: no validation of JSON object returned by LLM models #173

@IlamaranMagesh

Description

@IlamaranMagesh

Describe the bug

There are two files where json object is parsed from the model response with exception handling. These are the two files.

react.py ->

formatted_response = json.loads(rsp.choices[0].message.content)

formatted_response = json.loads(rsp.choices[0].message.content)

episodic_memory.py ->

formatted_response = json.loads(rsp.choices[0].message.content)

formatted_response = json.loads(rsp.choices[0].message.content)

This may throw errors when the returned response is not a json object or corrupted.

Fix

Add try-except block around the parser.

PR

I'll open a PR and link this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions