-
Notifications
You must be signed in to change notification settings - Fork 0
feat: add openai implementation for generating summaries #25
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
Conversation
Warning Rate Limit Exceeded@xixas has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 10 minutes and 45 seconds before requesting another review. How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. WalkthroughThe recent updates to the Changes
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 6
Review Details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files ignored due to path filters (1)
apps/api/package-lock.json
is excluded by!**/package-lock.json
Files selected for processing (7)
- apps/api/package.json (2 hunks)
- apps/api/src/jobs/consumers/summary/summary.consumer.ts (3 hunks)
- apps/api/src/jobs/producers/summary/summary.producer.ts (1 hunks)
- apps/api/src/main.ts (2 hunks)
- apps/api/src/modules/summary/summarizer/summarizer.service.ts (1 hunks)
- apps/api/src/modules/summary/summary.module.ts (1 hunks)
- apps/api/src/modules/summary/summary.service.ts (1 hunks)
Additional comments not posted (19)
apps/api/src/modules/summary/summary.module.ts (3)
12-12
: Ensure the import path forMeetingSummaryService
is correct and consistent with the project structure.
23-23
: AddingMeetingSummaryService
to the providers array ensures it is available for dependency injection.
25-25
: AddingMeetingSummaryService
to the exports array makes it available for use in other modules.apps/api/src/main.ts (3)
11-11
: Importingjoin
from 'path' is necessary for constructing the upload directory path.
23-25
: Ensure theUPLOAD_FOLDER_PATH
environment variable is correctly set and sanitized.
27-28
: Creating the upload directory recursively ensures it exists before use.apps/api/src/jobs/consumers/summary/summary.consumer.ts (4)
8-13
: Ensure the import paths forMeetingSummaryService
,path
,fs/promises
, anduploadDir
are correct and consistent with the project structure.
23-23
: InjectingMeetingSummaryService
into the constructor ensures it is available for use in the class.
42-47
: Ensure the file paths and content reading logic are correct and handle potential errors.
48-53
: Generating the summary and updating the job status to SUCCESS is correctly handled.apps/api/package.json (3)
50-50
: Addingfs-extra
provides additional file system methods that are useful for handling files.
58-59
: Addingopenai
andopenai-api
dependencies is necessary for integrating OpenAI's API for generating summaries.
74-74
: Updating@types/jest
ensures compatibility with the latest version of Jest.apps/api/src/modules/summary/summary.service.ts (1)
43-43
: Ensure theUPLOAD_FOLDER_PATH
environment variable is correctly set and sanitized.apps/api/src/modules/summary/summarizer/summarizer.service.ts (5)
59-65
: LGTM!The
calculateDuration
method is simple and correctly calculates the duration based on the chunks.
134-157
: LGTM!The
createBatches
method correctly creates batches of chunks based on the maximum token limit.
159-164
: LGTM!The
parallelSummarize
method correctly generates summaries for each batch in parallel.
166-185
: LGTM!The
recursiveCombineSummaries
method correctly combines summaries recursively until only one summary remains.
188-205
: LGTM!The
generateMeetingSummary
method correctly orchestrates the entire process of generating a meeting summary, including error handling and logging.
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review Details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- apps/api/src/jobs/consumers/summary/summary.consumer.ts (3 hunks)
Files skipped from review as they are similar to previous changes (1)
- apps/api/src/jobs/consumers/summary/summary.consumer.ts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review Details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- apps/api/src/jobs/producers/summary/summary.producer.ts (1 hunks)
Files skipped from review as they are similar to previous changes (1)
- apps/api/src/jobs/producers/summary/summary.producer.ts
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
API PR Checklist
Pre-requisites
PR Details
PR details have been updated as per the given format (see below)
feat: add admin login endpoint
)Additional Information
ready for review
should be added if the PR is ready to be reviewed)Description:
Added openai implementation that works with chat gpt turbo engine. The implemented method create a formatted message from the input text file and get a summarized result from open ai.
Summary by CodeRabbit
New Features
Enhancements
Dependencies
fs-extra
,openai
, andopenai-api
.@types/jest
to version^29.5.12
.