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

Prompt limit issue fixed #501

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

Infracloud-harsh
Copy link

@Infracloud-harsh Infracloud-harsh commented Nov 29, 2023

Summary by CodeRabbit

  • New Feature: Added splitPrompt function to handle large prompts that exceed the maximum token limit, improving the handling of large files and prompts.
  • Refactor: Updated the codeReview and doSummary function signatures for better code readability and maintainability.
  • Test: Introduced a new test suite for the splitPrompt function to ensure its correct functionality.
  • Chore: Modified the GitHub Actions workflow and README file structure for better organization and clarity.

…he prompt if exceeded number of tokens

Prompt limit increase with split the prompt if exceeded number of tokens
Copy link
Contributor

github-actions bot commented Nov 29, 2023

Image description CodeRabbit

Walkthrough

This update enhances the GitHub Actions workflow and README file, introduces a new function splitPrompt with its test suite for handling large prompts, and improves the handling of large files in the codeReview and doSummary functions. The changes aim to optimize performance and maintainability.

Changes

Files Summary
.github/workflows/openai-review.yml, README.md Updated the concurrency group configuration in the GitHub Actions workflow and restructured the README file for better organization.
__tests__/tokenizer.test.ts, src/tokenizer.ts Introduced a new function splitPrompt that splits a prompt into multiple pieces based on a maximum token count, along with a comprehensive test suite.
src/inputs.ts, src/prompts.ts, src/review.ts Added a new property fileIndex to the Inputs class and improved the handling of large files and prompts in the codeReview and doSummary functions.

🐰 "In the land of code, where logic is king,

We dance with tokens, in a ring.

Large files we split, with a swift rabbit's hop,

Making our codebase, rise to the top! 🎉"


Uplevel your code reviews with CodeRabbit Pro

CodeRabbit Pro

If you like this project, please support us by purchasing the Pro version. The Pro version has advanced context, superior noise reduction and several proprietary improvements compared to the open source version. Moreover, CodeRabbit Pro is free for open source projects.

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Image description CodeRabbit

Commits Files that changed from the base of the PR and between d5ec397 and a49ec52 commits.
Files selected (7)
  • .github/workflows/openai-review.yml (1)
  • README.md (2)
  • tests/tokenizer.test.ts (1)
  • src/inputs.ts (2)
  • src/prompts.ts (2)
  • src/review.ts (5)
  • src/tokenizer.ts (1)
Files ignored due to filter (2)
  • dist/index.js
  • dist/package.json
Files skipped from review due to trivial changes (2)
  • README.md
  • src/inputs.ts
Review comments generated (12)
  • Review: 12
  • LGTM: 0

Tips

Chat with Image description CodeRabbit Bot (@coderabbitai)

  • 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 @coderabbitai in a reply.

Code suggestions

  • The bot may make code suggestions, but please review them carefully before committing since the line number ranges may be misaligned.
  • You can edit the comment made by the bot and manually tweak the suggestion if it is slightly off.

Pausing incremental reviews

  • Add @coderabbitai: ignore anywhere in the PR description to pause further reviews from the bot.

.github/workflows/openai-review.yml Outdated Show resolved Hide resolved
src/tokenizer.ts Outdated Show resolved Hide resolved
src/prompts.ts Show resolved Hide resolved
src/prompts.ts Show resolved Hide resolved
__tests__/tokenizer.test.ts Show resolved Hide resolved
src/review.ts Show resolved Hide resolved
src/review.ts Show resolved Hide resolved
src/review.ts Show resolved Hide resolved
src/review.ts Show resolved Hide resolved
src/review.ts Show resolved Hide resolved
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Image description CodeRabbit

Commits Files that changed from the base of the PR and between a49ec52 and 44a12fb commits.
Files selected (1)
  • src/tokenizer.ts (1)
Review comments generated (1)
  • Review: 1
  • LGTM: 0

Tips

Chat with Image description CodeRabbit Bot (@coderabbitai)

  • 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 @coderabbitai in a reply.

Code suggestions

  • The bot may make code suggestions, but please review them carefully before committing since the line number ranges may be misaligned.
  • You can edit the comment made by the bot and manually tweak the suggestion if it is slightly off.

Pausing incremental reviews

  • Add @coderabbitai: ignore anywhere in the PR description to pause further reviews from the bot.

src/tokenizer.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Image description CodeRabbit

Commits Files that changed from the base of the PR and between 44a12fb and 4cf4e4d commits.
Files selected (1)
  • src/tokenizer.ts (1)
Review comments generated (1)
  • Review: 1
  • LGTM: 0

Tips

Chat with Image description CodeRabbit Bot (@coderabbitai)

  • 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 @coderabbitai in a reply.

Code suggestions

  • The bot may make code suggestions, but please review them carefully before committing since the line number ranges may be misaligned.
  • You can edit the comment made by the bot and manually tweak the suggestion if it is slightly off.

Pausing incremental reviews

  • Add @coderabbitai: ignore anywhere in the PR description to pause further reviews from the bot.

src/tokenizer.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Image description CodeRabbit

Commits Files that changed from the base of the PR and between 4cf4e4d and 9642c45 commits.
Files selected (1)
  • src/tokenizer.ts (1)
Review comments generated (1)
  • Review: 1
  • LGTM: 0

Tips

Chat with Image description CodeRabbit Bot (@coderabbitai)

  • 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 @coderabbitai in a reply.

Code suggestions

  • The bot may make code suggestions, but please review them carefully before committing since the line number ranges may be misaligned.
  • You can edit the comment made by the bot and manually tweak the suggestion if it is slightly off.

Pausing incremental reviews

  • Add @coderabbitai: ignore anywhere in the PR description to pause further reviews from the bot.

src/tokenizer.ts Show resolved Hide resolved
@Infracloud-harsh Infracloud-harsh marked this pull request as ready for review November 30, 2023 21:09
@Infracloud-harsh
Copy link
Author

Hello @harjotgill, I have worked on the issue of prompt limit for long PRs. It works properly for us. Can we please have a look on this PR.

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.

None yet

1 participant