Skip to content

Initial code for adding compiler error feedback#29

Open
KE7 wants to merge 3 commits intomainfrom
compiler
Open

Initial code for adding compiler error feedback#29
KE7 wants to merge 3 commits intomainfrom
compiler

Conversation

@KE7
Copy link
Copy Markdown
Owner

@KE7 KE7 commented Jan 25, 2024

Still need to run tests, check.sh, and add the GPT side

#give it back to the LLM to try again
scenic_program = claude_response.completion
for _ in range(max_compiler_errors):
success, output = self.run_scenic_program(scenic_program)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note for later: once we update the Scenic compiler stage used should make sure this is consistent with it

try:
# Using subprocess.run to execute the command
# The command will run for up to 10 seconds
result = subprocess.run(['scenic', temp_file_name, '--2d'],
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment as before @devanshanker switch this to ast/compilation so filenames/etc. don't trigger errors

return False, result.stdout.decode()

except subprocess.TimeoutExpired:
# If the command times out after 10 seconds
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Once we switch this to compilation instead of execution we can cut the delay since it compiles ~instantly

Copy link
Copy Markdown
Collaborator

@devanshanker devanshanker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good looks much cleaner than what i had

KE7 added 2 commits January 25, 2024 10:10
…tter results this way)

2. Add complier feedback loop
3. Code to remove LLM "helpful" jiberish
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants