Skip to content
This repository was archived by the owner on Mar 6, 2024. It is now read-only.

Optimize prompts to use fewer tokens #110

Merged
merged 25 commits into from
Apr 7, 2023
Merged

Optimize prompts to use fewer tokens #110

merged 25 commits into from
Apr 7, 2023

Conversation

karansohi
Copy link
Contributor

@karansohi karansohi commented Apr 4, 2023

Summary by OpenAI

Release Notes:

  • New Feature: Adds new inputs for OpenAI models and optimizes prompts to use fewer tokens. Updates descriptions of existing inputs and modifies default values.
  • Refactor: Simplifies logic for generating comments in src/review-comment.ts.
  • Documentation: Updates instructions for review_beginning and comment inputs in action.yml.

"Tokens optimized, models added,
Codebase now more flexible, less padded.
Review comments simplified,
Instructions clarified, no need to hide.
Celebrate this PR with joy and glee,
For better code we all shall see!"

@github-actions
Copy link
Contributor

github-actions bot commented Apr 4, 2023

🤖 OpenAI

Thank you for letting me participate in this code review. Overall, this pull request optimizes prompts to use fewer tokens and adds new inputs for OpenAI models. It also updates descriptions of existing inputs and modifies default values. The changes aim to improve the performance and flexibility of the code.

Here is a table summarizing the changes made to each file:

File Summary
action.yml Adds a new input openai_review_model and updates descriptions of existing inputs. Modifies default value of openai_summary_model. Asks to summarize within 50 words instead of 30. Updates review_beginning and comment inputs with additional instructions.
src/bot.ts Optimizes prompts to use fewer tokens by adding openaiOptions as a parameter to the constructor and using its properties to set maxModelTokens, maxResponseTokens, and model. Removes a debug statement.
src/commenter.ts Adds logging statements to update or create review comments based on whether a comment already exists or not.
src/main.ts Adds two new inputs for OpenAI models, openai_summary_model and openai_review_model, and creates two bots, one for summary and one for review. Updates function calls to use the new bots and options.
src/review-comment.ts Optimizes the handleReviewComment function by renaming the bot parameter to heavyBot, removing some unused variables, and simplifying the logic for generating comments. Uses the review_token_limits option instead of max_tokens_for_extra_content.

Overall, these changes should improve the performance and flexibility of the codebase.


Chat with 🤖 OpenAI Bot (@openai)

  • Reply on review comments left by this bot to ask follow-up questions. A review comment is a comment on a diff or a file.
  • Invite the bot into a review comment chain by tagging @openai in a reply.

Files ignored due to filter (1)

Ignored files

  • dist/index.js

@coderabbitai coderabbitai deleted a comment from github-actions bot Apr 7, 2023
@coderabbitai coderabbitai deleted a comment from github-actions bot Apr 7, 2023
@coderabbitai coderabbitai deleted a comment from github-actions bot Apr 7, 2023
@coderabbitai coderabbitai deleted a comment from github-actions bot Apr 7, 2023
@coderabbitai coderabbitai deleted a comment from github-actions bot Apr 7, 2023
@coderabbitai coderabbitai deleted a comment from github-actions bot Apr 7, 2023
@coderabbitai coderabbitai deleted a comment from github-actions bot Apr 7, 2023
@coderabbitai coderabbitai deleted a comment from github-actions bot Apr 7, 2023
@coderabbitai coderabbitai deleted a comment from github-actions bot Apr 7, 2023
@coderabbitai coderabbitai deleted a comment from github-actions bot Apr 7, 2023
@coderabbitai coderabbitai deleted a comment from github-actions bot Apr 7, 2023
@coderabbitai coderabbitai deleted a comment from github-actions bot Apr 7, 2023
@coderabbitai coderabbitai deleted a comment from github-actions bot Apr 7, 2023
@coderabbitai coderabbitai deleted a comment from github-actions bot Apr 7, 2023
@coderabbitai coderabbitai deleted a comment from github-actions bot Apr 7, 2023
@harjotgill harjotgill changed the title check Optimize prompts to use fewer tokens Apr 7, 2023
@harjotgill harjotgill marked this pull request as ready for review April 7, 2023 01:34
@harjotgill harjotgill merged commit 26d98cd into main Apr 7, 2023
@harjotgill harjotgill deleted the test-pr branch April 7, 2023 01:41
shoyuf pushed a commit to maybeLab/openai-mr-reviewer-gltlab that referenced this pull request Jun 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants