Update AI response parsing for JSON reasoning

This commit is contained in:
Jordan Wages 2026-01-07 03:32:29 -06:00
commit 42d013fccd
Notes: Jordan Wages 2026-01-07 13:52:38 -06:00
Generalizes parsing of response messages to account for multiple model response formats. Related to #1.
7 changed files with 114 additions and 18 deletions

View file

@ -5,8 +5,8 @@ Email:
Criterion: {{query}}
Remember, return ONLY a JSON object on a single line of the form:
{"match": true} - if the email satisfies the criterion
{"match": false} - otherwise
{"match": true, "reason": "<short explanation>"} - if the email satisfies the criterion
{"match": false, "reason": "<short explanation>"} - otherwise
Do not add any other keys, text, or formatting.
[/INST]

View file

@ -7,8 +7,8 @@
```
Classification Criterion: {{query}}
Remember, return ONLY a JSON object on a single line of the form:
{"match": true} - if the email satisfies the criterion
{"match": false} - otherwise
{"match": true, "reason": "<short explanation>"} - if the email satisfies the criterion
{"match": false, "reason": "<short explanation>"} - otherwise
Do not add any other keys, text, or formatting.<|im_end|>
<|im_start|>assistant

View file

@ -7,8 +7,8 @@ Email:
Criterion: {{query}}
Remember, return ONLY a JSON object on a single line of the form:
{"match": true} - if the email satisfies the criterion
{"match": false} - otherwise
{"match": true, "reason": "<short explanation>"} - if the email satisfies the criterion
{"match": false, "reason": "<short explanation>"} - otherwise
Do not add any other keys, text, or formatting.
<|im_end|>