-
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
wip(feat/paste): images dropzone #161
Conversation
… `multimodality_plus`
Conflicts: src/app/middleware.ts src/components/Chat/Chat.tsx On branch feat/paste-images-dropzone Your branch is up to date with 'origin/feat/paste-images-dropzone'. All conflicts fixed but you are still merging. Changes to be committed: modified: package-lock.json modified: package.json modified: src/app/middleware.ts modified: src/components/Chat/Chat.tsx modified: src/components/ChatContent/AssistantInput.tsx modified: src/components/ComboBox/ComboBox.tsx modified: src/components/Markdown/Markdown.module.css modified: src/components/Markdown/Markdown.tsx modified: src/events/index.ts modified: src/features/Chat/Chat.tsx modified: src/features/History/historySlice.ts modified: src/features/ThreadHistory/ThreadHistory.tsx modified: src/hooks/useEventBusForIDE.ts modified: src/hooks/usePatchActions.ts modified: src/services/refact/prompts.ts modified: src/utils/copyChatHistoryToClipboard.ts new file: src/utils/fallbackCopying.ts
src/components/Dropzone/Dropzone.tsx
Outdated
const err = file.errors.reduce<string>((acc, cur) => { | ||
return acc + `${cur.code} ${cur.message}\n`; | ||
}, ""); | ||
return `could not atttach ${file.file.name}: ${err}`; |
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.
src/features/History/historySlice.ts
Outdated
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.
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.
Or other workaround could be to transform firstUserMessage
within historyListener
in that way, that it's structure will become as old-structured message and will be sent to chatGenerateTitleThunk
Possible workaround
interface InputContent {
m_type: string;
m_content: string;
}
interface InputObject {
role: string;
content: InputContent[];
}
interface OutputObject {
role: string;
content: string;
}
function transformObject(input: InputObject): OutputObject {
// Extract the m_content of the first object in the content array
const firstContent = input.content[0].m_content;
// Construct the new object with in old-structured way
const output: OutputObject = {
role: input.role,
content: firstContent
};
return output;
}
src/components/ChatForm/ChatForm.tsx
Outdated
@@ -264,10 +265,12 @@ export const ChatForm: React.FC<ChatFormProps> = ({ | |||
size="1" | |||
type="submit" | |||
/> | |||
{/** TODO: disabled prop, title and size props */} | |||
<AttachFileButton /> |
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.
AttachFileButton
should be placed before PaperPlaneButton
, on the left side
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.
Comments are left above
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.
LGTM 👍🏻
* WIP(upload files): add a file drag and drop handler for chat. * wip(images): add some ui components for interaction. * wip(images): add attach button. * wip(ui attached images): add a simple ui to see attached files. * refactor(attached images): manage attached images in redux. * wip(images): add images to the user content. * wip(images): send images using kyok and an upstream branch of the lsp `multimodality_plus` * wip(image user messages): render only a string message for now. * wip(images): rendering user images in chat * wip(images): render multiple user images in chat. * wip(images): refactor to reuse the original component for the component is an array. * wip(image): add retry functionality * ui(retry): add buttons for adding and removing images when retrying a question. * ui(images): add a better button for removing the image * feat(images): add error messages for unsupported files. * feat(images): add error and warning handlers for adding files. * refactor(api reset): reset ping first. * typo(dropzone): atttach * ui(image button): change the order for send and attach buttons. * fix(BYOK): title generation response won't have `"metering_balance` when using BYOK. * refactor(images): place images before the user message
Add images to chat
Description
User can add images to chat by either clicking a button or drag and drop.
Reties also work
Allow the suer to drop images into chat.
Type of change
How to Test
repeat for drag and drop, but also include non-image files
Screenshots (if applicable)
Checklist
Linked Issues
Additional Notes
Merge once it works without needing byok