I have a simple prompt to analyze source code and generate flowchart diagram in Mermaid syntax.
– For source code in C# the prompt works fine.
– For source code in Python the prompt takes 2 mins in average and returns just a bunch of /r /n.
Analyze source code of a project.
The project consits of one or more source code files.
Combine the logic of all source code files.
Generate a high-level flow diagram of what the project does.
The diagram must be in the syntax of mermaid flow diagram.
The diagram must be short, not more than 20 steps in total.
The diagram must be high-level, without technical details, like Garbage Collection (GC), Exit Function.
The diagram must not include names of classes.
The diagram must not include the source code file name.
The diagram must not include comments.
Did not help - still garbage in response.
Tried to strip the comments - still garbage.
Presented the code as a text (wrapped into “”" … “”").
At lease received an error:
-“message”: "We could not parse the JSON body of your request. (HINT: This likely means you aren’t using your HTTP library correctly. The OpenAI API expects a JSON payload, but what was sent was not valid JSON. If you have trouble figuring out how to fix this, please contact us through our help center at help.openai.com.)
Dropped the idea with OpenAI, switched to Claude 3 Opus.
Claude Opus handles good, no unexplainable errors.