-
Notifications
You must be signed in to change notification settings - Fork 2
Devt 54 augment notes llm response #63
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
base: main
Are you sure you want to change the base?
Conversation
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.
Pull Request Overview
This PR introduces basic functionality for extracting text lines from an uploaded file, augmenting the notes via an LLM, and displaying the changes as diffs. Key changes include:
- New functions for downloading documents and determining MIME types in the dataset client.
- Additions to chat configurations and a dedicated augment component/template for note revisions.
- Enhancements to UI components and pages for file upload, preview, and notes augmentation with diff visualization.
Reviewed Changes
Copilot reviewed 15 out of 16 changed files in this pull request and generated 3 comments.
Show a summary per file
File | Description |
---|---|
shared/lib/ragflow/dataset-client.ts | Added downloadDocument function and MIME type utility |
shared/lib/ragflow/chat/chat-configs.ts | Introduced AugmentConfigTemplate for note augmentation |
app/classrooms/page.tsx | Added augment notes button with FileText icon |
app/classrooms/[classroomId]/upload/uploadComponent.tsx | Refactored asynchronous function declarations in file upload |
app/classrooms/[classroomId]/upload/preview/page.tsx | Updated document preview to use base64 embedded content |
app/classrooms/[classroomId]/upload/page.tsx | Changed error handling to use notFound() for 404 responses |
app/classrooms/[classroomId]/manage/_components/inviteMember.tsx | Simplified toast error message formatting |
app/classrooms/[classroomId]/augment/page.tsx | Added a new page for notes augmentation with proper error handling |
app/classrooms/[classroomId]/augment/NotesViewer.tsx | Introduced diff viewer for augmented notes with customization |
app/classrooms/[classroomId]/augment/AugumentActions.ts | Added server actions for setting up and revising notes with LLM |
app/classrooms/[classroomId]/augment/AugmentNotes.tsx | Implemented file upload and note processing interface for augmentation |
app/chatrooms/[chatroomId]/components/message-area.tsx | Updated inline comments and fixed spelling error |
app/api/document/[datasetId]/[documentId]/route.ts | Removed unused API route for document preview |
Files not reviewed (1)
- package.json: Language not supported
Comments suppressed due to low confidence (1)
app/classrooms/[classroomId]/augment/AugumentActions.ts:1
- The file name 'AugumentActions.ts' appears to contain a typo; consider renaming it to 'AugmentActions.ts' to maintain consistency with other augment-related files.
"use server";
// resolving some duplicate augmentation issues | ||
const [augmentedCount, setAugmentedCount] = useState(0); | ||
|
||
DoAugmentation(); |
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.
Invoking DoAugmentation directly in the render body can trigger repeated side effects and potential infinite re-renders; consider moving this call into a useEffect hook with an appropriate dependency array.
Copilot uses AI. Check for mistakes.
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Basic functionality of: extracting text lines from uploaded file, asking LLM for augmentation and reasons, displaying changes as diff