You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
The AI keeps going in circles:
Uses Python interpreter to write code, gets it working
I ask it to write that code to disk for later use.
It uses Python interpreter to write a multiline string containing that python code to a .py file
It screws up the newline escaping, resulting in this error:
cleaned_coordinates = gps_coordinates.split('
^
SyntaxError: unterminated string literal (detected at line 12)
It uses Python interpreter to look at the file it created:
It appears that the newline handling issue remains unresolved in the integrated_scraping_and_export.py file. Let's check the contents of
the file again to identify the exact error and correct it properly. I'll read the file now.
# Read the contents of the integrated_scraping_and_export.py to check the source for issues
with open('integrated_scraping_and_export.py', 'r') as file:
contents = file.read()
contents
It identifies the escaping error and fixes it.
I will adjust this line to use the correct escape sequence for the newline character, changing it to:
cleaned_coordinates = gps_coordinates.split('\\n')[0].strip()
# Write the fixed integrated script code to the .py file
with open('integrated_scraping_and_export.py', 'w') as file:
file.write(final_fixed_full_integrated_script)
It finally works
Describe the solution you'd like
However the AI is able to call commands or call python code (function calling?) should be extended so that it can also read and write files directly, without using the Python interpreter as an intermediate step. Probably should be able to see hex dumps or other representations of files too.
Describe alternatives you've considered
No response
Additional context
No response
The text was updated successfully, but these errors were encountered:
I have similar issue but it is trying to create files using bash cat wheredoc and there is a bug preventing this working. #1485
While your issue with the escaping and my issue with the malformed file should still be resolved seperatly I think direct file access would be a great feature to avoid these kind methods to create a new file.
I'm not sure if your issue is a bug with interpreter or just the ai not getting the code right. Have you tried adding instruction to your prompt on how to create files using correct escaping? I added instruction to mine not to use heredoc so it now avoids that method.
Is your feature request related to a problem? Please describe.
The AI keeps going in circles:
Describe the solution you'd like
However the AI is able to call commands or call python code (function calling?) should be extended so that it can also read and write files directly, without using the Python interpreter as an intermediate step. Probably should be able to see hex dumps or other representations of files too.
Describe alternatives you've considered
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: