-
Notifications
You must be signed in to change notification settings - Fork 101
Add retries for json parsing error #86
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
Open
rounak610
wants to merge
56
commits into
TransformerOptimus:main
Choose a base branch
from
rounak610:design_rebuild_fix
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 44 commits
Commits
Show all changes
56 commits
Select commit
Hold shift + click to select a range
09e4304
added template and prompt
rounak610 e94a988
changes in code for django template
rounak610 bb46786
Merge remote-tracking branch 'upstream/main'
rounak610 033cfc9
merge conflicts resolved
rounak610 4fc9caa
Merge branch 'main' of github.com:TransformerOptimus/SuperCoder # Ple…
rounak610 f3f47dc
Merge remote-tracking branch 'upstream/main'
rounak610 bd8ea52
Merge remote-tracking branch 'upstream/main'
rounak610 6f1df3e
Merge branch 'main' of github.com:TransformerOptimus/SuperCoder
rounak610 41049d1
fixes in django prompt
rounak610 a9b303f
resolve merge conflicts
rounak610 fe7a729
Merge branch 'main' of github.com:TransformerOptimus/SuperCoder
rounak610 80dfd37
Merge branch 'main' of github.com:TransformerOptimus/SuperCoder
rounak610 5cabd3a
fixes
rounak610 144ab4e
fixes
rounak610 43b35c1
fixes
rounak610 3839f2a
fixes
rounak610 fd98a04
removed unused loggers
rounak610 b3f6d00
Merge remote-tracking branch 'upstream/main'
rounak610 e6abe65
chnaged activity logs
rounak610 ef106c9
Merge remote-tracking branch 'upstream/main'
rounak610 b367470
fixes
rounak610 bb79997
fixes
rounak610 49a175d
fixes
rounak610 9befd0f
fixes
rounak610 b60f77b
Merge remote-tracking branch 'upstream/main'
rounak610 958391b
added retries in edit code
rounak610 da3e523
Merge remote-tracking branch 'upstream/main'
rounak610 50d0927
Merge branch 'main' into design_rebuild_fix
rounak610 5f26f68
resolved merge conflicts
rounak610 28a68af
resolved merge conflicts
rounak610 667b442
fixes
rounak610 166686f
fixes
rounak610 6535549
fixes
rounak610 c2854a2
minor fixes
rounak610 cd81b8a
fixes
rounak610 79edf24
fixes
rounak610 614b6b4
Merge remote-tracking branch 'upstream/main'
rounak610 28ac5fe
fixes
rounak610 d86c8bd
fixes
rounak610 744f650
fixes
rounak610 e3a891a
minor fix
rounak610 ec368c8
Merge remote-tracking branch 'upstream/main'
rounak610 8146648
Merge branch 'main' into design_rebuild_fix
rounak610 43f0a5b
merge conflicts resolved
rounak610 84607aa
fixes
rounak610 97a6b4b
fixes
rounak610 10e0f9c
fixes
rounak610 300267e
Merge remote-tracking branch 'upstream/main'
rounak610 98cb75f
Merge branch 'main' into design_rebuild_fix
rounak610 54987f8
fixes
rounak610 370d620
fixes
rounak610 fb75569
fixes
rounak610 40530c5
Update open_ai_next_js_code_generation_executor.go
rounak610 2644e20
added loggers
rounak610 9944783
fixes
rounak610 cb4f3ae
fixes
rounak610 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
73 changes: 73 additions & 0 deletions
73
app/prompts/nextjs/ai_frontend_developer_edit_code_retry.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
You are tasked with updating the frontend code to resolve build errors. You will be given information about a specific file, the error description, the current code, and the project's directory structure. Your job is to propose a solution by either editing existing code or inserting new code. | ||
|
||
Here's the file you need to work on: | ||
<file_name> | ||
{{FILE_NAME}} | ||
</file_name> | ||
|
||
The build error description is as follows: | ||
<error_description> | ||
{{ERROR_DESCRIPTION}} | ||
</error_description> | ||
|
||
Here's the current code in the file: | ||
<current_code> | ||
{{CURRENT_CODE}} | ||
</current_code> | ||
|
||
The directory structure of the project is: | ||
<directory_structure> | ||
{{DIRECTORY_STRUCTURE}} | ||
</directory_structure> | ||
|
||
Based on the error description and the current code, you must choose ONE of the following actions: | ||
|
||
1. Edit code: | ||
Replace the code in the given file path from `start_line` to `end_line` with `new_code`. | ||
|
||
2. Add code: | ||
Insert the code in the given file path below the `line_number`. | ||
|
||
Provide your response in JSON format, following one of these structures: | ||
|
||
For editing code: | ||
{ | ||
"type": "edit", | ||
"start_line": Starting Line number, | ||
"end_line": Ending Line number, | ||
"new_code": Code snippet | ||
} | ||
|
||
For inserting code: | ||
{ | ||
"type": "insert", | ||
"line_number": Line number, | ||
"new_code": Code snippet | ||
} | ||
|
||
Guidelines for code editing and inserting: | ||
- When editing, provide the code snippet from several lines before and after the actual edit to ensure proper context. Aim to edit complete sections of the code, covering at least 20-30 lines. | ||
- If multiple edits are needed, choose line numbers that cover all necessary changes. In extreme cases, you may edit the entire file by setting start_line = 1 and end_line = last line of code. | ||
- Do not include ```json and ``` in your response. | ||
- Ensure that the proposed code is syntactically correct. | ||
- Beware of any unescaped single quotes (') in the JSX code. Do not have unescaped single quotes in the code, use ' or " or other appropriate methods instead. | ||
|
||
Remember to provide only one edit or insert at a time. Your primary goal is to resolve the build error while maintaining the integrity of the code. | ||
|
||
Present your solution in the JSON format described above, without any additional explanation or commentary. | ||
|
||
The previous response was not valid JSON. Please provide the edit instructions in the specified JSON format. Here is the format: | ||
For editing code: | ||
{ | ||
"type": "edit", | ||
"start_line": Starting Line number, | ||
"end_line": Ending Line number, | ||
"new_code": Code snippet | ||
} | ||
|
||
For inserting code: | ||
{ | ||
"type": "insert", | ||
"line_number": Line number, | ||
"new_code": Code snippet | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
You are an AI assistant tasked with analyzing the build logs of a website's frontend and determining if the build was successful. If not, you'll need to suggest an action to resolve the issue. You'll be provided with the following information: | ||
|
||
<build_logs> | ||
{{BUILD_LOGS}} | ||
</build_logs> | ||
|
||
<directory_structure> | ||
{{DIRECTORY_STRUCTURE}} | ||
</directory_structure> | ||
|
||
Your task is to: | ||
1. Analyze the build logs carefully. | ||
2. Determine if the build was successful or not. | ||
3. If the build was not successful, suggest one of the following actions: | ||
a. Create a new file | ||
b. Edit an existing file | ||
|
||
To determine if the build was successful: | ||
- Look for phrases like "Build successful", "Build completed", or similar indications of success. | ||
- Check for error messages, warnings, or failed steps in the build process. | ||
- Pay attention to the final lines of the build logs, as they often contain the build status. | ||
|
||
If the build was not successful: | ||
1. Identify the root cause of the failure based on the error messages in the build logs. | ||
2. Consider the logs and directory structure when suggesting a solution. | ||
3. Choose the most appropriate action (create, or edit) to resolve the issue. | ||
4. Provide detailed information about the action, including file paths (relative to the root directory) or terminal commands. | ||
5. Include line numbers from the build logs in your description if available. | ||
|
||
Provide your response in the following JSON format: | ||
|
||
For a successful build: | ||
{ | ||
"build_successful": "Yes" | ||
} | ||
|
||
For an unsuccessful build: | ||
{ | ||
"build_successful": "No", | ||
"action": { | ||
"type": "create|edit", | ||
"file_path": "path/to/file", | ||
"description": "Detailed description of the action and why it's needed" | ||
} | ||
} | ||
Examples to clarify: | ||
{ | ||
"build_successful": "No", | ||
"action": { | ||
"type": "create", | ||
"file_path": "path/to/file", | ||
"description": "Detailed description of the action and why it's needed" | ||
} | ||
} | ||
|
||
{ | ||
"build_successful": "No", | ||
"action": { | ||
"type": "edit", | ||
"file_path": "path/to/file", | ||
"description": "Detailed description of the action and why it's needed" | ||
} | ||
} | ||
|
||
|
||
Remember to analyze the build logs thoroughly and provide a clear, concise explanation of the issue and the proposed solution in the "description" field. Do not include the ```json and ``` markers in your response. | ||
|
||
The previous response was not valid JSON. Please provide the edit instructions in the specified JSON format. Here is the format: | ||
Provide your response in the following JSON format: | ||
|
||
For a successful build: | ||
{ | ||
"build_successful": "Yes" | ||
} | ||
|
||
For an unsuccessful build: | ||
{ | ||
"build_successful": "No", | ||
"action": { | ||
"type": "create|edit", | ||
"file_path": "path/to/file", | ||
"description": "Detailed description of the action and why it's needed" | ||
} | ||
} | ||
Examples to clarify: | ||
{ | ||
"build_successful": "No", | ||
"action": { | ||
"type": "create", | ||
"file_path": "path/to/file", | ||
"description": "Detailed description of the action and why it's needed" | ||
} | ||
} | ||
|
||
{ | ||
"build_successful": "No", | ||
"action": { | ||
"type": "edit", | ||
"file_path": "path/to/file", | ||
"description": "Detailed description of the action and why it's needed" | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.