+
    aKj                         ^ RI t ^ RIt]P                  ! R]P                  4      t]P                  ! R]P
                  4      tR R ltR# )    Nz^```(?:json)?\s*|\s*```$z\{.*\}c                0    V ^8  d   QhR\         R\        /# )   textreturn)strdict)formats   "@C:\xampp\htdocs\meridian\meridian-ai\app\providers\json_utils.py__annotate__r      s     * *c *d *    c                P   \         P                  RV P                  4       4      P                  4       p \        P                  ! V4      #   \        P
                   dG    \        P                  T4      pT'       g   h \        P                  ! TP                  ^ 4      4      u # i ; i)a  Parse a model's raw text output as a JSON object, tolerating the two ways
models routinely violate "JSON only": wrapping the object in a ```json fence, or
prefacing/trailing it with a sentence of commentary.

Not every provider supports a strict JSON-only response mode (OpenAI's
response_format does; Anthropic and local Ollama models rely on the system prompt
alone), so every provider implementation runs its output through this rather than
calling json.loads directly.
 )		_FENCE_REsubstripjsonloadsJSONDecodeError
_OBJECT_REsearchgroup)r   cleanedmatchs   &  r
   parse_json_responser      sy     mmB

-335G*zz'"" *!!'*zz%++a.))	*s   A
 
1B%<&B%$B%)r   recompile	MULTILINEr   DOTALLr   r    r   r
   <module>r       s9     	JJ2BLLA	ZZ	299-
*r   