mirror of
https://github.com/jehna/humanify.git
synced 2026-04-27 09:35:58 +03:00
[GH-ISSUE #80] Flowchart of how this works #39
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#39
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 @neoOpus on GitHub (Sep 4, 2024).
Original GitHub issue: https://github.com/jehna/humanify/issues/80
Hi,
Could you provide in the readme a graph or flowchart illustrating how this works, or generate one using LLM to help me understand the code better? I'm particularly curious about whether multiple passes are made to enhance the final code. I tried with ChatGPT but I don't have the Plus, and it just failed to generate one...
@jehna commented on GitHub (Sep 4, 2024):
Sorry, what is it that you're trying to do? I'm wondering if you're trying to understand the code to educate/help or if you're trying to use the free ChatGPT to run Humanify?
In case it's the latter, there's unfortunately no way to use without paying to OpenAI. But you don't need the plus subscription, only a pay-as-you-go API access. Humanify uses some clever tricks on API level to force the output to include only the renames, so that's why it would not work with the basic chatgpt.com
@jehna commented on GitHub (Sep 4, 2024):
If it's the former, I'd love to refactor the code to make it easier to approach!
On pseudocode level humanify works about like this:
So at least one request to ChatGPT is made per variable. The actual rename is made without ChatGPT. Does this answer your question?
@neoOpus commented on GitHub (Sep 5, 2024):
No, my mistake for not being clear enough in my message, I wanted mainly to see how this works internally via a graph that explain the steps your tool do to deliver the finally result... a visual representation.
eg.
Input > unminification > code parsing > looking for patterns via (something) > beautification > ESLint > LLM variable replacement > Loop x times > OutputIf this still doesn't make sense, forget about this, I don't want to take up your development time.
@neoOpus commented on GitHub (Sep 5, 2024):
Yes that would be enough for the moment, I will have to examine the source-code, if I still have questions then I will comeback (I just wanted ChatGPT to generate the graph but I don't have the Plus and tried several times then told me that I reached the limit, I will try again today. As this can give anyone a clear idea of the workflow.
@0xdevalias commented on GitHub (Sep 12, 2024):
@neoOpus I sort of looked at this myself the other day to understand things better; I found it easiest to start at the CLI command, which call
unminifyand provides a pipeline of plugins to apply to it (babel,openaiRename,prettier):github.com/jehna/humanify@a51847171a/src/commands/openai.ts (L20-L30)You can see the definition for
unminifyhere:github.com/jehna/humanify@a51847171a/src/unminify.ts (L6-L27)You can see the
openaiRenameplugin code here:github.com/jehna/humanify@a51847171a/src/plugins/openai/openai-rename.ts (L6-L38)You can similarly follow the code flows for the local and gemini based CLI options.
@neoOpus commented on GitHub (Sep 12, 2024):
Thank you so much Glenn for your help! I really appreciate!
I have a clearer idea now, but I still have some reading to do, I am thinking about feeding the source-code to an LLM to make the flowchart from it, but I still didn't find that solution yet!
BTW, I've been reading your profile and I really liked it, we have a similar approach about learning and doing things!