Skip to content

Commit

Permalink
Render Block parts
Browse files Browse the repository at this point in the history
  • Loading branch information
enricoros committed Feb 25, 2025
1 parent 31da502 commit e48b3f0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ import { useOverlayComponents } from '~/common/layout/overlays/useOverlayCompone

// configuration
// const REASONING_COLOR = '#ca74b8'; // '#f22a85' (folder-aligned), '#ca74b8' (emoji-aligned)
const ANTHROPIC_REDACTED_EXPLAINER = // https://docs.anthropic.com/en/docs/build-with-claude/extended-thinking#example-streaming-with-redacted-thinking
'Some of Claude\'s internal reasoning has been automatically encrypted for safety reasons. This doesn\'t affect the quality of responses.';


const _styles = {
Expand Down Expand Up @@ -75,6 +77,8 @@ export function BlockPartModelAux(props: {
fragmentId: DMessageFragmentId,
auxType: 'reasoning' | string,
auxText: string,
auxHasSignature: boolean,
auxRedactedDataCount: number,
zenMode: boolean,
contentScaling: ContentScaling,
onFragmentReplace?: (fragmentId: DMessageFragmentId, newFragment: DMessageContentFragment) => void,
Expand Down Expand Up @@ -141,7 +145,7 @@ export function BlockPartModelAux(props: {
Show {typeText}
</Chip>

{expanded && showInline && (
{expanded && showInline && !!props.auxText && (
<Chip
color='success'
variant='soft'
Expand All @@ -161,7 +165,10 @@ export function BlockPartModelAux(props: {

{!neverExpanded && (
<Typography sx={textSx}>
{props.auxText}
<span>
{props.auxText}
{!!props.auxRedactedDataCount && <Box component='span' sx={{ color: 'text.disabled' }}> {ANTHROPIC_REDACTED_EXPLAINER}{'.'.repeat(props.auxRedactedDataCount % 5)}</Box>}
</span>
</Typography>
)}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@ export function ContentFragments(props: {
fragmentId={fId}
auxType={part.aType}
auxText={part.aText}
auxHasSignature={part.textSignature !== undefined}
auxRedactedDataCount={part.redactedData?.length ?? 0}
zenMode={props.uiComplexityMode === 'minimal'}
contentScaling={props.contentScaling}
onFragmentReplace={props.onFragmentReplace}
Expand Down

0 comments on commit e48b3f0

Please sign in to comment.