Skip to content

Claude: Failed to parse facts from LLM response: SyntaxError: Unexpected end of JSON input #4108

@exa-pub

Description

@exa-pub

🐛 Describe the bug

Claude ignores https://github.com/mem0ai/mem0/blob/main/mem0-ts/src/oss/src/prompts/index.ts#L262 and answered like:

{
  "type": "message",
  "role": "assistant",
  "content": [
    {
      "type": "text",
      "text": "```json\n{\n  \"facts\": [\n    \"<saved fact here>"\n  ]\n}\n```"
    }
  ],
  "stop_reason": null,
  "stop_sequence": null,
  "usage": {
    "cache_creation_input_tokens": 0,
    "cache_read_input_tokens": 0,
    "output_tokens": null
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions