-
Notifications
You must be signed in to change notification settings - Fork 203
Multimodality: Upload PDFs and Images #135
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
Merged
Merged
Changes from all commits
Commits
Show all changes
35 commits
Select commit
Hold shift + click to select a range
ee1c084
feat : Support file uploads #56
Neulhan aa59470
feat: support drag and drop file upload
wuhaolei455 635d635
Merge pull request #2 from wuhaolei455/main
Neulhan d8c8a85
init pdf images branch
starmorph 5d86187
implementing pdf upload, text blob pdf-parse
starmorph aa32e58
converting image + file upload to Base64ContentBlock Mime_type standa…
starmorph 9ac2228
lint and format
starmorph 1cac35f
major refactor
starmorph fcaa963
format && remove graph
starmorph 79a28d1
fix file upload schema to match python langchain multimodality docs
starmorph 855d8c5
Anthropic pdf uploads working w metadata filename
starmorph 5e7a8ee
handleFileUpload, images working
starmorph 217fd43
support different image filetypes
starmorph f1b6aab
show image thumbnails and pdf filenames in chat, allow for fileupload…
starmorph 198d13d
format
starmorph 2197ce3
update pnpm lock
starmorph 24c5e2d
bump langgraph-checkpoint and langgraph-sdk to same versions as main
starmorph f618f0a
Merge branch 'main' into upload-images-and-pdfs
starmorph 28cee32
fix thread index
starmorph 1002273
lint format
starmorph 2df2067
remove un-needed util
starmorph 1e51243
CR: drop un-needed pkgs
starmorph 224d0ba
minor syntax hotfix
starmorph f3b6165
CR: multimodal preview component, drop pdf-parse dep
starmorph 087587d
CR: check for supported image types, duplicate filenames
starmorph 52379f5
CR fixes
starmorph 2884683
CR: use-file-upload-hook
starmorph d358222
format
starmorph 8534f4a
CR: ContentBlock abstraction
starmorph 1fbef48
fix artifact code
starmorph 25b2473
CR: cn utility, refactor accepted files, nextImage
starmorph f29b505
format
starmorph d3e5534
add file upload code from main thread/index
starmorph 752fd11
format
starmorph cb2d216
fix pdf duplicate file upload handler
starmorph File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,10 @@ | ||
/** @type {import('next').NextConfig} */ | ||
const nextConfig = {}; | ||
const nextConfig = { | ||
experimental: { | ||
serverActions: { | ||
bodySizeLimit: "10mb", | ||
}, | ||
}, | ||
}; | ||
|
||
export default nextConfig; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -53,7 +53,7 @@ | |
"tailwind-merge": "^3.0.2", | ||
"tailwindcss-animate": "^1.0.7", | ||
"use-stick-to-bottom": "^1.0.46", | ||
"uuid": "^11.0.5", | ||
"uuid": "^11.1.0", | ||
"zod": "^3.24.2" | ||
}, | ||
"devDependencies": { | ||
|
@@ -64,6 +64,7 @@ | |
"@types/react": "^19.0.8", | ||
"@types/react-dom": "^19.0.3", | ||
"@types/react-syntax-highlighter": "^15.5.13", | ||
"@types/uuid": "^10.0.0", | ||
"autoprefixer": "^10.4.20", | ||
"dotenv": "^16.4.7", | ||
"eslint": "^9.19.0", | ||
|
@@ -81,8 +82,7 @@ | |
"typescript-eslint": "^8.22.0" | ||
}, | ||
"overrides": { | ||
"react-is": "^19.0.0-rc-69d4b800-20241021", | ||
"@langchain/langgraph-checkpoint": "^0.0.16" | ||
"react-is": "^19.0.0-rc-69d4b800-20241021" | ||
}, | ||
"packageManager": "[email protected]" | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import React from "react"; | ||
import type { Base64ContentBlock } from "@langchain/core/messages"; | ||
import { MultimodalPreview } from "../ui/MultimodalPreview"; | ||
import { cn } from "@/lib/utils"; | ||
|
||
interface ContentBlocksPreviewProps { | ||
blocks: Base64ContentBlock[]; | ||
onRemove: (idx: number) => void; | ||
size?: "sm" | "md" | "lg"; | ||
className?: string; | ||
} | ||
|
||
/** | ||
* Renders a preview of content blocks with optional remove functionality. | ||
* Uses cn utility for robust class merging. | ||
*/ | ||
export const ContentBlocksPreview: React.FC<ContentBlocksPreviewProps> = ({ | ||
blocks, | ||
onRemove, | ||
size = "md", | ||
className, | ||
}) => { | ||
if (!blocks.length) return null; | ||
return ( | ||
<div className={cn("flex flex-wrap gap-2 p-3.5 pb-0", className)}> | ||
{blocks.map((block, idx) => ( | ||
<MultimodalPreview | ||
key={idx} | ||
block={block} | ||
removable | ||
onRemove={() => onRemove(idx)} | ||
size={size} | ||
/> | ||
))} | ||
</div> | ||
); | ||
}; |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. also, the diff is way to large in the JSX portion. i assume this is because you didn't merge with main properly so we're overwriting a lot of David's stuff, but we should aim to have as little changes as possible |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
looks like you deleted all of the stuff around artifacts. can you please redo that merge commit to properly merge this with what already exists? We shouldn't have to make david go do this merge, and def dont want to delete his artifacts stuff