mirror of
https://github.com/jehna/humanify.git
synced 2026-04-27 09:35:58 +03:00
[GH-ISSUE #12] Unexpected token : in JSON at position 426 #12
Labels
No labels
bug
enhancement
pull-request
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/humanify#12
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @AtzaMan on GitHub (Apr 4, 2024).
Original GitHub issue: https://github.com/jehna/humanify/issues/12
After running the following command :
npm start -- --key="sk-_your-token_" -o deobfuscated.js obfuscated.jsI 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@jehna commented on GitHub (Jun 19, 2024):
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 🤔
@0xdevalias commented on GitHub (Jun 20, 2024):
Can you use the new JSON mode or tool choice or similar to force it?
@0xdevalias commented on GitHub (Jun 24, 2024):
Potentially related:
@0xdevalias commented on GitHub (Jul 3, 2024):
I'm not sure what version of the SDK
response_format: { "type": "json_object" }/tool_choicebecame available in. This project seems to currently be usingopenai3.3.0, whereas the latest version is4.52.3(at time of writing). I created a more specific issue about upgrading the library, which may end up being a prerequisite to usingtool_choice/similar:@jehna commented on GitHub (Aug 7, 2024):
OpenAI API now guarantees structured output:
https://openai.com/index/introducing-structured-outputs-in-the-api/
(should fix this issue properly)
@0xdevalias commented on GitHub (Aug 12, 2024):
See also: