Skip to content

fix(ai): normalize raw prompt response for consistent JSON parsing#1803

Merged
nmaguiar merged 1 commit intomasterfrom
t8
Apr 13, 2026
Merged

fix(ai): normalize raw prompt response for consistent JSON parsing#1803
nmaguiar merged 1 commit intomasterfrom
t8

Conversation

@nmaguiar
Copy link
Copy Markdown
Collaborator

This pull request refactors the jsonPromptWithStatsRaw method in js/owrap.ai.js to improve how the raw model output is normalized and parsed. The main change is to handle different possible response formats from the model, ensuring that the correct content is extracted and parsed as JSON.

Improvements to model output handling:

  • Updated jsonPromptWithStatsRaw to use rawPrompt instead of prompt, and added logic to normalize the model output by extracting the relevant content from nested objects before attempting JSON parsing. This improves robustness when handling different response formats from the model.

@nmaguiar nmaguiar self-assigned this Apr 13, 2026
@nmaguiar nmaguiar merged commit 73db604 into master Apr 13, 2026
1 check passed
@github-project-automation github-project-automation bot moved this from Backlog to Done in Continuous Enhancement Apr 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Development

Successfully merging this pull request may close these issues.

1 participant