-
Notifications
You must be signed in to change notification settings - Fork 0
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
Development
: Add Sentry reporting for the pipelines
#135
Conversation
Warning Review failedThe pull request is closed. WalkthroughThis update enhances error handling and logging across several modules in the application. Exception details are now included in error messages, and Changes
Sequence Diagram(s)ExerciseChatPipeline Error Handling sequenceDiagram
participant User
participant ChatPipeline as ExerciseChatPipeline
participant Status as StatusUpdater
participant Sentry as Sentry SDK
User->>ChatPipeline: Execute Pipeline
ChatPipeline->>ChatPipeline: _run_exercise_chat_pipeline()
ChatPipeline->>ChatPipeline: Generates Exception (e)
ChatPipeline->>Status: error("Failed to generate response: {e}", exception=e)
Status->>Sentry: capture_exception(e)
Status->>User: Return Error Response
LectureIngestionPipeline Error Handling sequenceDiagram
participant User
participant LecturePipeline as LectureIngestionPipeline
participant Status as StatusUpdater
participant Sentry as Sentry SDK
User->>LecturePipeline: Start Ingestion
LecturePipeline->>LecturePipeline: __call__()
LecturePipeline->>LecturePipeline: Generates Exception (e)
LecturePipeline->>Status: error("Failed to ingest lectures: {e}", exception=e)
Status->>Sentry: capture_exception(e)
Status->>User: Return Error Response
Tip AI model upgrade
|
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
Outside diff range and nitpick comments (4)
app/pipeline/lecture_ingestion_pipeline.py (4)
Line range hint
129-129
: Rename unused loop control variable.The loop control variable
i
is not used within the loop body. Renamei
to_i
to indicate it is unused.- for i, lecture_unit in enumerate(self.dto.lecture_units): + for _i, lecture_unit in enumerate(self.dto.lecture_units):
Line range hint
162-163
: Use a singlewith
statement for multiple contexts.Use a single
with
statement with multiple contexts instead of nestedwith
statements.- with self.collection.batch.rate_limit(requests_per_minute=600) as batch: - try: - for index, chunk in enumerate(chunks): + with self.collection.batch.rate_limit(requests_per_minute=600) as batch, batch: + try: + for _index, chunk in enumerate(chunks):
Line range hint
165-165
: Rename unused loop control variable.The loop control variable
index
is not used within the loop body. Renameindex
to_index
to indicate it is unused.- for index, chunk in enumerate(chunks): + for _index, chunk in enumerate(chunks):
Line range hint
263-263
: Remove unnecessary open mode parameters.The open mode parameters are unnecessary and can be removed.
- with open(prompt_file_path, "r") as file: + with open(prompt_file_path) as 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.
Great, thank you for implementing this
# Conflicts: # app/pipeline/chat/course_chat_pipeline.py
1b05599
Summary by CodeRabbit
Bug Fixes
Chores
capture_exception
fromsentry_sdk
for better error monitoring and reporting.