Skip to content
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

refactor(llm): return feedbacks as json for better processing and formatting #23

Merged
merged 2 commits into from
Jul 19, 2023

Conversation

fabienzucchet
Copy link
Collaborator

@fabienzucchet fabienzucchet commented Jul 19, 2023

Closes issue #22

@fabienzucchet fabienzucchet force-pushed the feat/22/model-response-in-JSON branch from 22c4fc5 to 448a67f Compare July 19, 2023 11:31
@github-actions
Copy link
Contributor

github-actions bot commented Jul 19, 2023

LOGAF Level 2 - /home/runner/work/code-review-gpt/code-review-gpt/src/review/prompt/constructPrompt.ts

The appendToLastPrompt function could be improved by using string concatenation instead of creating a new array each time. This would improve performance and readability.


LOGAF Level 3 - /home/runner/work/code-review-gpt/code-review-gpt/src/review/llm/feedbackProcessor.ts

  1. The collectAndLogFeedback function is not handling the error properly. It's better to let the error propagate up to the caller instead of throwing it again. This way, the caller can decide how to handle the error.

  2. The pickBestFeedbacks function could be improved by using a sorting function instead of a priority queue. This would simplify the code and potentially improve performance.


LOGAF Level 1 - /home/runner/work/code-review-gpt/code-review-gpt/src/review/llm/AIModel.ts

The apiKey is exposed in the IAIModel interface. This is a security risk. Consider using environment variables to store sensitive information. For example, you can use process.env.API_KEY instead of directly including the key in your code.


📝🚀🔒


Powered by Code Review GPT

@fabienzucchet fabienzucchet force-pushed the feat/22/model-response-in-JSON branch from 448a67f to c091224 Compare July 19, 2023 11:33
@fabienzucchet fabienzucchet force-pushed the feat/22/model-response-in-JSON branch from c091224 to 6bbf9d4 Compare July 19, 2023 11:36
@mattzcarey
Copy link
Owner

So good

@fabienzucchet fabienzucchet force-pushed the feat/22/model-response-in-JSON branch from ff5d247 to f01f51c Compare July 19, 2023 14:32
@fabienzucchet fabienzucchet merged commit 2197b49 into main Jul 19, 2023
1 check passed
@mattzcarey mattzcarey deleted the feat/22/model-response-in-JSON branch July 19, 2023 21:27
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.

None yet

2 participants