mem0 icon indicating copy to clipboard operation
mem0 copied to clipboard

Json output for different models varies

Open PranavPuranik opened this issue 1 year ago • 2 comments

🐛 Describe the bug

Some models output json response that starts with ```

This doesn't get loaded in json.loads() and throws an error.

A better prompt could solve it for now, but we should look for model specific prompt solutions.

PranavPuranik avatar Sep 19 '24 02:09 PranavPuranik

IMO this 'flaw' could be useful for parsing generated JSON and code, especially when there is some inconsistency between model output. Personally I can see a lot of benefit using the triple backtick as a flag for something to be parsed, seeing as these models arent designed explicitly to output parsable data. even better when the model uses correct MD syntax and lists the content type after the opening ticks. This could make finding data tokens in outputs easier and (hopefully) less likely to be parsed incorrectly when read. i.e, if closing ticks arent found, the block could be disregarded as it is unlikely to contain valid data.

Morgandri1 avatar Sep 19 '24 16:09 Morgandri1

Duplicate -> #1854

spike-spiegel-21 avatar Sep 19 '24 17:09 spike-spiegel-21

Closing this issue as it's duplicate and fixed.

parshvadaftari avatar Sep 20 '25 13:09 parshvadaftari