Skip to content

Conversation

@sourcery-ai
Copy link

@sourcery-ai sourcery-ai bot commented Dec 8, 2023

Branch main refactored by Sourcery.

If you're happy with these changes, merge this Pull Request using the Squash and merge strategy.

See our documentation here.

Run Sourcery locally

Reduce the feedback loop during development by using the Sourcery editor plugin:

Review changes via command line

To manually merge these changes, make sure you're on the main branch, then run:

git fetch origin sourcery/main
git merge --ff-only FETCH_HEAD
git reset HEAD^

Help us improve this pull request!

@sourcery-ai sourcery-ai bot requested a review from tooloca December 8, 2023 13:14
@cr-gpt
Copy link

cr-gpt bot commented Dec 8, 2023

Seems you are using me but didn't get OPENAI_API_KEY seted in Variables/Secrets for this repo. you could follow readme for more information


write_file(os.path.join(Agent.get_workspace(task.task_id), file_path), code)
path = Path("./" + file_path)
path = Path(f"./{file_path}")
Copy link
Author

Choose a reason for hiding this comment

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

Function _generate_code refactored with the following changes:

)
result = file_paths.from_response(completion)
return result
return file_paths.from_response(completion)
Copy link
Author

Choose a reason for hiding this comment

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

Function specify_file_paths refactored with the following changes:

chunk_message_dict = chunk["choices"][0]
chunk_message = chunk_message_dict["delta"] # extract the message
if chunk_message_dict["finish_reason"] is None:
chunk_message = chunk_message_dict["delta"] # extract the message
Copy link
Author

Choose a reason for hiding this comment

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

Function plan refactored with the following changes:

This removes the following comments ( why? ):

# if stream_handler and hasattr(stream_handler, "onComplete"): stream_handler.onComplete('done')

Comment on lines -163 to +161
chunk_message = chunk_message_dict["delta"] # extract the message
if chunk_message_dict["finish_reason"] is None:
chunk_message = chunk_message_dict["delta"] # extract the message
Copy link
Author

Choose a reason for hiding this comment

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

Function generate_code refactored with the following changes:

Comment on lines -6 to +8
if not os.path.exists(folder_path):
os.makedirs(folder_path)
else:
if os.path.exists(folder_path):
shutil.rmtree(folder_path)
os.makedirs(folder_path)
os.makedirs(folder_path)
Copy link
Author

Choose a reason for hiding this comment

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

Function generate_folder refactored with the following changes:

Comment on lines -61 to +69
messages = []
messages.append({"role": "system", "content": system_prompt})
messages.append({"role": "user", "content": user_prompt})
messages = [
{"role": "system", "content": system_prompt},
{"role": "user", "content": user_prompt},
]
Copy link
Author

Choose a reason for hiding this comment

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

Function generate_response refactored with the following changes:

This removes the following comments ( why? ):

# Get the reply from the API response

Comment on lines -43 to +44
directory= args.directory
model=args.model
directory = args.directory
Copy link
Author

Choose a reason for hiding this comment

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

Function main refactored with the following changes:

Comment on lines -75 to +77
messages = []
messages.append({"role": "system", "content": system_prompt})
messages.append({"role": "user", "content": user_prompt})
messages = [
{"role": "system", "content": system_prompt},
{"role": "user", "content": user_prompt},
]
Copy link
Author

Choose a reason for hiding this comment

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

Function generate_response refactored with the following changes:

This removes the following comments ( why? ):

# Get the reply from the API response


except ValueError:
print("Failed to parse result: " + result)
print(f"Failed to parse result: {result}")
Copy link
Author

Choose a reason for hiding this comment

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

Function main refactored with the following changes:

print(filecode)

file_path = directory + "/" + filename
file_path = f"{directory}/{filename}"
Copy link
Author

Choose a reason for hiding this comment

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

Function write_file refactored with the following changes:

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.

0 participants