Skip to content

Episodes: improve Anthropic JSON mode with explicit schema instruction #201

@abbudjoe

Description

@abbudjoe

From PR #196 review (Issue #11).

The LLM client uses a generic "Respond with valid JSON only." instruction for Anthropic's Claude models. Claude responds better to explicit JSON schema instructions.

Current:

if json_mode:
    prompt += "\n\nRespond with valid JSON only."

Recommended:

if json_mode:
    prompt += "\n\nYour response must be valid JSON matching this exact format:\n{...schema...}"

Provider-specific JSON handling would improve classification reliability.

Part of Episode Memories (#190).

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions