Release reusable chat components #85

Closed
opened 2026-02-15 19:15:46 -05:00 by yindo · 0 comments
Owner

Originally created by @marcusschiesser on GitHub (Oct 17, 2024).

Why?

What?

Similar to the https://github.com/run-llama/pdf-viewer, we're extracting out reusable chat components. I started that already some time ago with https://ui.marcusschiesser.de/docs/components/chat. These components have been rarely updated though as they were not released to npm (we had to copy the components usually for usage).

How to cut the components

https://ui.marcusschiesser.de/docs/components/chat is just providing ChatInput and ChatMessages. For greater flexibility, we will export more components:

  1. ChatMessageContent:
  • Don't expose artifactVersion - move it into toolData and retrieve it from there
  • add clipboard property that shows the copy clipboard button (move it from ChatMessage to ChatMessageContent)
  • In our templates, we will use ChatMessageContent directly for flexibility (e.g. change rendering the avatar), but we provide ChatAvatar and ChatMessage for convenience to the NPM package user too
  1. ChatActions
  • provided for convenience but not used in our templates (so users can modify the chat actions easily)
  1. File services: useFile, FileUploader, UploadImagePreview (rename to ImagePreview), and DocumentPreview
  2. ChatInput (convenience - won't be used in our templates)

Don't export:

  1. LlamaCloudSelector - we either keep that in our templates or release a separate package

TBD: We probably can merge ImagePreview and DocumentPreview to FilePreview

Originally created by @marcusschiesser on GitHub (Oct 17, 2024). ## Why? - Reduce the complexity of the frontend code - Reuse the same components in LlamaCloud - Reuse the components in the upcoming Reflex template, see https://github.com/run-llama/create-llama/issues/375 ## What? Similar to the https://github.com/run-llama/pdf-viewer, we're extracting out reusable chat components. I started that already some time ago with https://ui.marcusschiesser.de/docs/components/chat. These components have been rarely updated though as they were not released to npm (we had to copy the components usually for usage). ### How to cut the components https://ui.marcusschiesser.de/docs/components/chat is just providing `ChatInput` and `ChatMessages`. For greater flexibility, we will export more components: 1. `ChatMessageContent`: - Don't expose `artifactVersion` - move it into `toolData` and retrieve it from there - add `clipboard` property that shows the copy clipboard button (move it from `ChatMessage` to `ChatMessageContent`) - In our templates, we will use `ChatMessageContent` directly for flexibility (e.g. change rendering the avatar), but we provide `ChatAvatar` and `ChatMessage` for convenience to the NPM package user too 2. `ChatActions` - provided for convenience but not used in our templates (so users can modify the chat actions easily) 3. File services: `useFile`, `FileUploader`, `UploadImagePreview` (rename to `ImagePreview`), and `DocumentPreview` 4. `ChatInput` (convenience - won't be used in our templates) Don't export: 1. `LlamaCloudSelector` - we either keep that in our templates or release a separate package TBD: We probably can merge `ImagePreview` and `DocumentPreview` to `FilePreview`
yindo closed this issue 2026-02-15 19:15:46 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: run-llama/create-llama#85