feat: Enhance agent selection and conversation handling

- Added functionality to select agents in the Navigation component, allowing users to reset conversations and set the selected agent.
- Updated the MessageInput component to conditionally show source and tool buttons based on the selected agent.
- Modified the Conversation component to handle agent-specific queries and manage file uploads.
- Improved conversation fetching logic to include agent IDs and handle attachments.
- Introduced new types for conversation summaries and results to streamline API responses.
- Refactored Redux slices to manage selected agent state and improve overall state management.
- Enhanced error handling and loading states across components for better user experience.
This commit is contained in:
Siddhant Rai
2025-04-15 11:53:53 +05:30
parent fa1f9d7009
commit 7c69e99914
16 changed files with 445 additions and 237 deletions

View File

@@ -23,6 +23,7 @@ interface ConversationMessagesProps {
handleFeedback?: (query: Query, feedback: FEEDBACK, index: number) => void;
queries: Query[];
status: Status;
showHeroOnEmpty?: boolean;
}
export default function ConversationMessages({
@@ -31,6 +32,7 @@ export default function ConversationMessages({
queries,
status,
handleFeedback,
showHeroOnEmpty = true,
}: ConversationMessagesProps) {
const [isDarkTheme] = useDarkTheme();
const { t } = useTranslation();
@@ -141,7 +143,7 @@ export default function ConversationMessages({
ref={conversationRef}
onWheel={handleUserInterruption}
onTouchMove={handleUserInterruption}
className="flex justify-center w-full overflow-y-auto h-screen sm:pt-12"
className="flex justify-center w-full overflow-y-auto h-full sm:pt-12"
>
{queries.length > 0 && !hasScrolledToLast && (
<button
@@ -161,7 +163,6 @@ export default function ConversationMessages({
{queries.length > 0 ? (
queries.map((query, index) => (
<Fragment key={index}>
<ConversationBubble
className={'first:mt-5'}
key={`${index}QUESTION`}
@@ -175,9 +176,9 @@ export default function ConversationMessages({
{prepResponseView(query, index)}
</Fragment>
))
) : (
) : showHeroOnEmpty ? (
<Hero handleQuestion={handleQuestion} />
)}
) : null}
</div>
</div>
);