-
Notifications
You must be signed in to change notification settings - Fork 160
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bump: chat-ui and tailwind v4 (#509)
- Loading branch information
Showing
16 changed files
with
142 additions
and
162 deletions.
There are no files selected for viewing
This file contains 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,5 @@ | ||
--- | ||
"create-llama": patch | ||
--- | ||
|
||
bump: chat-ui and tailwind v4 |
This file contains 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 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 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 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
49 changes: 12 additions & 37 deletions
49
templates/types/streaming/nextjs/app/components/ui/chat/chat-message-content.tsx
This file contains 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,44 +1,19 @@ | ||
import { | ||
ChatMessage, | ||
ContentPosition, | ||
getSourceAnnotationData, | ||
useChatMessage, | ||
useChatUI, | ||
} from "@llamaindex/chat-ui"; | ||
import { ChatMessage } from "@llamaindex/chat-ui"; | ||
import { DeepResearchCard } from "./custom/deep-research-card"; | ||
import { Markdown } from "./custom/markdown"; | ||
import { ToolAnnotations } from "./tools/chat-tools"; | ||
|
||
export function ChatMessageContent() { | ||
const { isLoading, append } = useChatUI(); | ||
const { message } = useChatMessage(); | ||
const customContent = [ | ||
{ | ||
// override the default markdown component | ||
position: ContentPosition.MARKDOWN, | ||
component: ( | ||
<Markdown | ||
content={message.content} | ||
sources={getSourceAnnotationData(message.annotations)?.[0]} | ||
/> | ||
), | ||
}, | ||
// add the deep research card | ||
{ | ||
position: ContentPosition.CHAT_EVENTS, | ||
component: <DeepResearchCard message={message} />, | ||
}, | ||
{ | ||
// add the tool annotations after events | ||
position: ContentPosition.AFTER_EVENTS, | ||
component: <ToolAnnotations message={message} />, | ||
}, | ||
]; | ||
return ( | ||
<ChatMessage.Content | ||
content={customContent} | ||
isLoading={isLoading} | ||
append={append} | ||
/> | ||
<ChatMessage.Content> | ||
<ChatMessage.Content.Event /> | ||
<ChatMessage.Content.AgentEvent /> | ||
<DeepResearchCard /> | ||
<ToolAnnotations /> | ||
<ChatMessage.Content.Image /> | ||
<ChatMessage.Content.Markdown /> | ||
<ChatMessage.Content.DocumentFile /> | ||
<ChatMessage.Content.Source /> | ||
<ChatMessage.Content.SuggestedQuestions /> | ||
</ChatMessage.Content> | ||
); | ||
} |
This file contains 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 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 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 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 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 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 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 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 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,6 +1,5 @@ | ||
module.exports = { | ||
plugins: { | ||
tailwindcss: {}, | ||
autoprefixer: {}, | ||
"@tailwindcss/postcss": {}, | ||
}, | ||
}; |
Oops, something went wrong.