Closed villesau closed 7 months ago
Hey @villesau, thanks for adding this but it doesn't seem to work. I think it worked first time, but later on I get the same error as https://github.com/freeedcom/ai-codereviewer/issues/56
Run freeedcom/ai-codereviewer@v2.7.0
Error: SyntaxError: Unexpected token ` in JSON at position 0
at JSON.parse (<anonymous>)
at /home/runner/work/_actions/freeedcom/ai-codereviewer/v2.7.0/webpack:/open-ai-reviewer/lib/main.js:151:1
at Generator.next (<anonymous>)
at fulfilled (/home/runner/work/_actions/freeedcom/ai-codereviewer/v2.7.0/webpack:/open-ai-reviewer/lib/main.js:28:1)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
Error: SyntaxError: Unexpected token ` in JSON at position 0
at JSON.parse (<anonymous>)
at /home/runner/work/_actions/freeedcom/ai-codereviewer/v2.7.0/webpack:/open-ai-reviewer/lib/main.js:151:1
at Generator.next (<anonymous>)
at fulfilled (/home/runner/work/_actions/freeedcom/ai-codereviewer/v2.7.0/webpack:/open-ai-reviewer/lib/main.js:28:1)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
Error: SyntaxError: Unexpected token ` in JSON at position 0
at JSON.parse (<anonymous>)
at /home/runner/work/_actions/freeedcom/ai-codereviewer/v2.7.0/webpack:/open-ai-reviewer/lib/main.js:151:1
at Generator.next (<anonymous>)
@lukehollenback I also tried your branch https://github.com/freeedcom/ai-codereviewer/pull/57, still the same error
Run lukehollenback/ai-codereviewer@issue-56_json-mode-on-more-models
Error: SyntaxError: Unexpected token ` in JSON at position 0
at JSON.parse (<anonymous>)
at /home/runner/work/_actions/lukehollenback/ai-codereviewer/issue-56_json-mode-on-more-models/webpack:/open-ai-reviewer/lib/main.js:151:1
at Generator.next (<anonymous>)
at fulfilled (/home/runner/work/_actions/lukehollenback/ai-codereviewer/issue-56_json-mode-on-more-models/webpack:/open-ai-reviewer/lib/main.js:28:1)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
@lukehollenback I also tried your branch #57, still the same error
Run lukehollenback/ai-codereviewer@issue-56_json-mode-on-more-models Error: SyntaxError: Unexpected token ` in JSON at position 0 at JSON.parse (<anonymous>) at /home/runner/work/_actions/lukehollenback/ai-codereviewer/issue-56_json-mode-on-more-models/webpack:/open-ai-reviewer/lib/main.js:151:1 at Generator.next (<anonymous>) at fulfilled (/home/runner/work/_actions/lukehollenback/ai-codereviewer/issue-56_json-mode-on-more-models/webpack:/open-ai-reviewer/lib/main.js:28:1) at processTicksAndRejections (node:internal/process/task_queues:96:5)
If you add this prompt after - Provide the response in following JSON format: {"reviews": [{"lineNumber": <line_number>, "reviewComment": "<review comment>"}]}
it will send json string without any prefix and json parse wont fail. (You can test it locally)
Support gpt-4-1106-preview and json mode