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

Pipeline: Add a pipeline for course level inquiries #101

Closed
wants to merge 12 commits into from

Conversation

kaancayli
Copy link
Contributor

@kaancayli kaancayli commented Apr 29, 2024

Motivation

In the future we want IRIS to answer course-related questions

Description

CourseChatPipeline receives information about the course and answers students' questions about organizational aspects of the course and the course content.

Summary by CodeRabbit

  • New Features
    • Enhanced competency data model with additional fields for soft due date, optional status, and mastery threshold.
    • Expanded competency progress model with fields for competency ID, progress, confidence, and configuration settings.
    • Introduced Pydantic models for exercise student metrics, lecture unit information, and student metrics.
    • Implemented a Course Chat Pipeline for managing course-related questions using a Langchain chat model.

Copy link
Contributor

coderabbitai bot commented Apr 29, 2024

Walkthrough

The recent changes involve enhancing the educational system's data representation and management by introducing new data transfer objects (DTOs) and models related to competencies, exercises, lecture units, and student metrics. These changes aim to provide a more comprehensive view of student progress, competency levels, and exercise completion within the system.

Changes

File Change Summary
app/domain/data/competency_dto.py Added CompetencyTaxonomy enum class and CompetencyDTO class with various fields for competency representation.
.../metrics/competency_information_dto.py Updated CompetencyInformationDTO with additional fields for soft due date, optional status, and mastery threshold.
.../competency_progress_dto.py Enhanced CompetencyProgressDTO with fields for competency ID, progress, confidence, and configuration settings.
.../competency_student_metrics_dto.py Introduced CompetencyStudentMetricsDTO with fields for student metrics related to competencies, exercises, and progress.
.../exercise_student_metrics_dto.py Added attributes to ExerciseStudentMetricsDTO for exercise student metrics, including a set of completed exercises.
.../lecture_unit_information_dto.py Defined LectureUnitInformationDTO for modeling lecture unit information with specific fields like name and release date.
.../lecture_unit_student_metrics_dto.py Added LectureUnitStudentMetricsDTO for student metrics related to lecture units, including completion status.
.../map_entry_dto.py Updated MapEntryDTO class with attributes for key-value pairs typically used in mapping data structures.
.../student_metrics_dto.py Introduced StudentMetricsDTO for student metrics, including exercise, lecture unit, and competency metrics.
app/pipeline/chat/course_chat_pipeline.py Added CourseChatPipeline class for managing course-related questions using a Langchain chat model.

Recent Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between 3b9892f and aec416b.
Files selected for processing (9)
  • app/domain/data/metrics/competency_information_dto.py (1 hunks)
  • app/domain/data/metrics/competency_progress_dto.py (1 hunks)
  • app/domain/data/metrics/competency_student_metrics_dto.py (1 hunks)
  • app/domain/data/metrics/exercise_student_metrics_dto.py (1 hunks)
  • app/domain/data/metrics/lecture_unit_information_dto.py (1 hunks)
  • app/domain/data/metrics/lecture_unit_student_metrics_dto.py (1 hunks)
  • app/domain/data/metrics/map_entry_dto.py (1 hunks)
  • app/domain/data/metrics/student_metrics_dto.py (1 hunks)
  • app/pipeline/chat/course_chat_pipeline.py (1 hunks)
Files skipped from review due to trivial changes (1)
  • app/domain/data/metrics/lecture_unit_information_dto.py
Files skipped from review as they are similar to previous changes (8)
  • app/domain/data/metrics/competency_information_dto.py
  • app/domain/data/metrics/competency_progress_dto.py
  • app/domain/data/metrics/competency_student_metrics_dto.py
  • app/domain/data/metrics/exercise_student_metrics_dto.py
  • app/domain/data/metrics/lecture_unit_student_metrics_dto.py
  • app/domain/data/metrics/map_entry_dto.py
  • app/domain/data/metrics/student_metrics_dto.py
  • app/pipeline/chat/course_chat_pipeline.py

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?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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

Out of diff range and nitpick comments (1)
app/domain/__init__.py (1)

Line range hint 1-9: Consider managing unused imports to prevent potential confusion and maintain cleaner code.

+ __all__ = [
+     "IrisErrorResponseDTO",
+     "PipelineExecutionDTO",
+     "PipelineExecutionSettingsDTO",
+     "TutorChatPipelineExecutionDTO",
+     "CourseChatPipelineExecutionDTO",
+     "PyrisMessage",
+     "IrisMessageRole"
+ ]

@kaancayli kaancayli requested review from Hialus and yassinsws April 29, 2024 08:17
@kaancayli kaancayli self-assigned this Apr 29, 2024
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 4

Out of diff range and nitpick comments (3)
app/domain/__init__.py (3)

Line range hint 1-1: Consider removing or using the IrisErrorResponseDTO import.

This import is currently unused. If it's not needed, it should be removed to clean up the codebase. If it's intended for external use, consider adding it to the __all__ list to explicitly indicate its purpose.


Line range hint 2-2: Consider removing or using the PipelineExecutionDTO import.

Similar to the previous comment, this import is unused. Removing it or adding it to __all__ would help clarify its role in the module.


Line range hint 3-3: Consider removing or using the PipelineExecutionSettingsDTO import.

This import is unused and should either be removed or added to __all__ if it's meant to be available for external modules.

coderabbitai[bot]
coderabbitai bot previously approved these changes May 6, 2024
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

Out of diff range and nitpick comments (3)
app/domain/pipeline_execution_dto.py (3)

Line range hint 1-1: Remove unused imports (List, Optional) to clean up the code.

- from typing import List, Optional

Line range hint 3-3: Remove unused import (Field) to clean up the code.

- from pydantic import BaseModel, Field
+ from pydantic import BaseModel

Line range hint 5-6: Remove unused imports (PipelineExecutionSettingsDTO, StageDTO) to clean up the code.

- from app.domain.pipeline_execution_settings_dto import PipelineExecutionSettingsDTO
- from app.domain.status.stage_dto import StageDTO

Comment on lines 1 to 14
from .error_response_dto import IrisErrorResponseDTO
from .pipeline_execution_dto import PipelineExecutionDTO
from .pyris_message import PyrisMessage
from .pipeline_execution_settings_dto import PipelineExecutionSettingsDTO
from app.domain.tutor_chat.tutor_chat_pipeline_execution_dto import (
from .chat.chat_pipeline_execution_dto import ChatPipelineExecutionDTO
from .chat.chat_pipeline_execution_base_data_dto import ChatPipelineExecutionBaseDataDTO
from app.domain.chat.tutor_chat.tutor_chat_pipeline_execution_dto import (
TutorChatPipelineExecutionDTO,
)
from app.domain.chat.course_chat.course_chat_pipeline_execution_dto import (
CourseChatPipelineExecutionDTO,
)
from .pyris_message import PyrisMessage, IrisMessageRole
from app.domain.data import image_message_content_dto
Copy link
Contributor

Choose a reason for hiding this comment

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

Several imports in this file are marked as unused. Consider either removing these or explicitly including them in __all__ if they are intended for external use. This will clarify their purpose and maintain clean code.

- from .error_response_dto import IrisErrorResponseDTO
- from .pipeline_execution_dto import PipelineExecutionDTO
- from .pipeline_execution_settings_dto import PipelineExecutionSettingsDTO
- from .chat.chat_pipeline_execution_dto import ChatPipelineExecutionDTO
- from .chat.chat_pipeline_execution_base_data_dto import ChatPipelineExecutionBaseDataDTO
- from app.domain.chat.tutor_chat.tutor_chat_pipeline_execution_dto import TutorChatPipelineExecutionDTO
- from app.domain.chat.course_chat.course_chat_pipeline_execution_dto import CourseChatPipelineExecutionDTO
- from .pyris_message import PyrisMessage, IrisMessageRole
- from app.domain.data import image_message_content_dto

Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
from .error_response_dto import IrisErrorResponseDTO
from .pipeline_execution_dto import PipelineExecutionDTO
from .pyris_message import PyrisMessage
from .pipeline_execution_settings_dto import PipelineExecutionSettingsDTO
from app.domain.tutor_chat.tutor_chat_pipeline_execution_dto import (
from .chat.chat_pipeline_execution_dto import ChatPipelineExecutionDTO
from .chat.chat_pipeline_execution_base_data_dto import ChatPipelineExecutionBaseDataDTO
from app.domain.chat.tutor_chat.tutor_chat_pipeline_execution_dto import (
TutorChatPipelineExecutionDTO,
)
from app.domain.chat.course_chat.course_chat_pipeline_execution_dto import (
CourseChatPipelineExecutionDTO,
)
from .pyris_message import PyrisMessage, IrisMessageRole
from app.domain.data import image_message_content_dto
from .pyris_message import PyrisMessage

Comment on lines +10 to +11
from fastapi import FastAPI, Request, status
from fastapi.exceptions import RequestValidationError
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove the redundant imports of FastAPI and RequestValidationError as they are already imported at the beginning of the file. This will prevent confusion and keep the import section clean.

- from fastapi import FastAPI, Request, status
- from fastapi.exceptions import RequestValidationError

Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
from fastapi import FastAPI, Request, status
from fastapi.exceptions import RequestValidationError

Comment on lines +4 to +8
from urllib.request import Request

from fastapi import APIRouter, status, Response, Depends, FastAPI
from fastapi.exceptions import RequestValidationError
from starlette.responses import JSONResponse
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove the unused imports to clean up the code. These imports are not utilized in the file and clutter the import section.

- from urllib.request import Request
- from fastapi import FastAPI
- from fastapi.exceptions import RequestValidationError
- from starlette.responses import JSONResponse

Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
from urllib.request import Request
from fastapi import APIRouter, status, Response, Depends, FastAPI
from fastapi.exceptions import RequestValidationError
from starlette.responses import JSONResponse
from fastapi import APIRouter, status, Response, Depends

@bassner bassner self-assigned this May 14, 2024
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Comment on lines 1 to 17
# app/domain/data/metrics/competency_student_metrics_dto.py

from pydantic import BaseModel, Field
from typing import Dict, Set, Optional

from app.domain.data.metrics.competency_information_dto import CompetencyInformationDTO


class CompetencyStudentMetricsDTO(BaseModel):
competency_information: Dict[int, CompetencyInformationDTO] = Field(alias="competencyInformation")
exercises: Dict[int, Set[int]]
lecture_units: Dict[int, Set[int]] = Field(alias="lectureUnits")
progress: Dict[int, float]
confidence: Dict[int, float]

class Config:
allow_population_by_field_name = True
Copy link
Contributor

Choose a reason for hiding this comment

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

LGTM! The CompetencyStudentMetricsDTO class is well-defined and follows best practices. However, the Optional import is unused and can be removed.

- from typing import Dict, Set, Optional
+ from typing import Dict, Set

Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
# app/domain/data/metrics/competency_student_metrics_dto.py
from pydantic import BaseModel, Field
from typing import Dict, Set, Optional
from app.domain.data.metrics.competency_information_dto import CompetencyInformationDTO
class CompetencyStudentMetricsDTO(BaseModel):
competency_information: Dict[int, CompetencyInformationDTO] = Field(alias="competencyInformation")
exercises: Dict[int, Set[int]]
lecture_units: Dict[int, Set[int]] = Field(alias="lectureUnits")
progress: Dict[int, float]
confidence: Dict[int, float]
class Config:
allow_population_by_field_name = True
# app/domain/data/metrics/competency_student_metrics_dto.py
from pydantic import BaseModel, Field
from typing import Dict, Set
from app.domain.data.metrics.competency_information_dto import CompetencyInformationDTO
class CompetencyStudentMetricsDTO(BaseModel):
competency_information: Dict[int, CompetencyInformationDTO] = Field(alias="competencyInformation")
exercises: Dict[int, Set[int]]
lecture_units: Dict[int, Set[int]] = Field(alias="lectureUnits")
progress: Dict[int, float]
confidence: Dict[int, float]
class Config:
allow_population_by_field_name = True

@bassner bassner closed this Jun 21, 2024
@bassner bassner deleted the feature/course-chat branch June 21, 2024 10:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants