diff --git a/src/components/AgentActionDisplay.tsx b/src/components/AgentActionDisplay.tsx index d3d38f1..c16138a 100644 --- a/src/components/AgentActionDisplay.tsx +++ b/src/components/AgentActionDisplay.tsx @@ -2,7 +2,7 @@ import { useState } from 'react'; import { cn } from '@/lib/utils'; -import { ChevronDown, ChevronUp, Bot } from 'lucide-react'; +import { ChevronDown, ChevronUp, Bot, Search, Zap, Microscope } from 'lucide-react'; import { AgentActionEvent } from './ChatWindow'; interface AgentActionDisplayProps { @@ -21,6 +21,20 @@ const AgentActionDisplay = ({ events, messageId }: AgentActionDisplayProps) => { return action.replace(/_/g, ' ').toLocaleLowerCase(); }; + // Function to get appropriate icon based on action type + const getActionIcon = (action: string, size: number = 20) => { + switch (action) { + case 'ANALYZING_PREVIEW_CONTENT': + return ; + case 'PROCESSING_PREVIEW_CONTENT': + return ; + case 'PROCEEDING_WITH_FULL_ANALYSIS': + return ; + default: + return ; + } + }; + if (!latestEvent) { return null; } @@ -32,7 +46,7 @@ const AgentActionDisplay = ({ events, messageId }: AgentActionDisplayProps) => { className="w-full flex items-center justify-between px-4 py-3 text-black/90 dark:text-white/90 hover:bg-light-200 dark:hover:bg-dark-200 transition duration-200" >
- + {getActionIcon(latestEvent.action)} {latestEvent.action === 'SYNTHESIZING_RESPONSE' ? 'Agent Log' : formatActionName(latestEvent.action)} @@ -53,7 +67,7 @@ const AgentActionDisplay = ({ events, messageId }: AgentActionDisplayProps) => { className="flex flex-col space-y-1 p-3 bg-white/50 dark:bg-black/20 rounded-lg border border-light-200/50 dark:border-dark-200/50" >
- + {getActionIcon(event.action, 16)} {formatActionName(event.action)} @@ -108,6 +122,30 @@ const AgentActionDisplay = ({ events, messageId }: AgentActionDisplayProps) => { {event.details.searchInstructions}
)} + {event.details.previewCount !== undefined && ( +
+ Preview Sources: + {event.details.previewCount} +
+ )} + {event.details.processingType && ( +
+ Processing Type: + {event.details.processingType.replace('-', ' ')} +
+ )} + {event.details.insufficiencyReason && ( +
+ Reason: + {event.details.insufficiencyReason} +
+ )} + {event.details.reason && ( +
+ Reason: + {event.details.reason} +
+ )}
)} diff --git a/src/components/MessageSources.tsx b/src/components/MessageSources.tsx index 7d9afa1..32d42e9 100644 --- a/src/components/MessageSources.tsx +++ b/src/components/MessageSources.tsx @@ -1,6 +1,6 @@ /* eslint-disable @next/next/no-img-element */ import { Document } from '@langchain/core/documents'; -import { File } from 'lucide-react'; +import { File, Zap, Microscope } from 'lucide-react'; const MessageSources = ({ sources }: { sources: Document[] }) => { return ( @@ -37,6 +37,17 @@ const MessageSources = ({ sources }: { sources: Document[] }) => {
{i + 1} + {/* Processing type indicator */} + {source.metadata.processingType === 'preview-only' && ( + + + + )} + {source.metadata.processingType === 'full-content' && ( + + + + )}
diff --git a/src/lib/utils/summarizeWebContent.ts b/src/lib/utils/summarizeWebContent.ts index c423f4d..8128dd4 100644 --- a/src/lib/utils/summarizeWebContent.ts +++ b/src/lib/utils/summarizeWebContent.ts @@ -101,6 +101,7 @@ ${i === 0 ? content.metadata.html : content.pageContent}, metadata: { ...content.metadata, url: url, + processingType: 'full-content', }, }), notRelevantReason: undefined