Open Parijat-18 opened 1 year ago
change the following from gpt-3.5-turbo to gpt-4 in constants.py
DEFAULT_MODEL = "gpt-4"
In 'filepaths_string = generate_response' prompt change 'return them as a python list of strings.' to 'return them as a python array of strings.'
I'm getting the same issue. changing to python array worked. Thanks!
Also, specify in the same prompt - "Use only camelCase naming convention and nothing else." as any other special characters like underscore also give error.
The script
main_no_modal.py
encounters aSyntaxError
when attempting to parse the string returned bygenerate_response
using Python'sast.literal_eval()
function.The AI's
generate_response
function currently returns a string representing a list of files in the following format:Unfortunately,
ast.literal_eval()
expects a string formatted as a valid Python expression, which the current output is not. The incompatibility leads to aSyntaxError
during the execution ofast.literal_eval(filepaths_string)
. The error message is as follows:The issue can potentially be resolved by modifying the output of
generate_response
to be a valid Python list string or by transforming the AI's output into a format thatast.literal_eval()
can process correctly before calling the function.Steps to reproduce:
SyntaxError
that is thrown when theast.literal_eval()
function is called with the output of thegenerate_response
function.Any additional information or suggestions to resolve this issue are appreciated.