-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unexpected token : in JSON at position 426 #12
Comments
I'm pretty sure this is since openai does not guarantee that the function calls are valid json. Should probably implement a quick retry logic for it 🤔 |
Can you use the new JSON mode or tool choice or similar to force it?
|
I'm not sure what version of the SDK |
OpenAI API now guarantees structured output: https://openai.com/index/introducing-structured-outputs-in-the-api/ (should fix this issue properly) |
See also: |
After running the following command :
npm start -- --key="sk-_your-token_" -o deobfuscated.js obfuscated.js
I get the following error:
SyntaxError: Unexpected token : in JSON at position 426 at JSON.parse (<anonymous>) at codeToVariableRenames (file:///C:/Users/Alexander/Documents/GitHub/humanify/src/openai/openai.ts:76:59) at processTicksAndRejections (node:internal/process/task_queues:95:5) at async file:///C:/Users/Alexander/Documents/GitHub/humanify/src/openai/openai.ts:21:23 at async Promise.all (index 4) at async mapPromisesParallel (file:///C:/Users/Alexander/Documents/GitHub/humanify/src/openai/run-promises-in-parallel.ts:17:5) at async client.createChatCompletion.model (file:///C:/Users/Alexander/Documents/GitHub/humanify/src/openai/openai.ts:20:5) at async file:///C:/Users/Alexander/Documents/GitHub/humanify/src/index.ts:68:25
The text was updated successfully, but these errors were encountered: