-
Notifications
You must be signed in to change notification settings - Fork 113
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding ContentFragment for Slack (#2003)
* [WIP] Adding ContentFragment for Slack * Working content Fragment * Clean up after self review * Clean up CF names * Clean up * Content Fragment working, a few things missing * Self clean up * Adjusting content framework title * Fix content Fragment rendering on createConversation API endpoint * Adding ContentFragment.contentType * Fixes * Fix call to <Citation> * Add channel name in content fragment title * Bumping Sparkle to 0.2.7 in front
- Loading branch information
Showing
16 changed files
with
428 additions
and
133 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
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
23 changes: 23 additions & 0 deletions
23
front/components/assistant/conversation/ContentFragment.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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { Citation } from "@dust-tt/sparkle"; | ||
|
||
import { assertNever } from "@app/lib/utils"; | ||
import { ContentFragmentType } from "@app/types/assistant/conversation"; | ||
|
||
export function ContentFragment({ message }: { message: ContentFragmentType }) { | ||
let logoType: "document" | "slack" = "document"; | ||
switch (message.contentType) { | ||
case "slack_thread_content": | ||
logoType = "slack"; | ||
break; | ||
|
||
default: | ||
assertNever(message.contentType); | ||
} | ||
return ( | ||
<Citation | ||
title={message.title} | ||
type={logoType} | ||
href={message.url || undefined} | ||
/> | ||
); | ||
} |
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
Oops, something went wrong.