diff --git a/apps/dbagent/src/components/chats/chats-ui.tsx b/apps/dbagent/src/components/chats/chats-ui.tsx index 24562830..0bafe4fd 100644 --- a/apps/dbagent/src/components/chats/chats-ui.tsx +++ b/apps/dbagent/src/components/chats/chats-ui.tsx @@ -18,7 +18,7 @@ import { Textarea } from '@internal/components'; import { useChat } from 'ai/react'; -import { Bot, Clock, Send, User } from 'lucide-react'; +import { Bot, Clock, Lightbulb, Send, User, Wrench } from 'lucide-react'; import { useSearchParams } from 'next/navigation'; import { useEffect, useRef, useState } from 'react'; import ReactMarkdown from 'react-markdown'; @@ -159,44 +159,66 @@ export function ChatsUI({ connections }: { connections: DbConnection[] }) { )} {messages.map((message) => ( -
- - - {message.role === 'assistant' ? : } - - -
-

{children}

, - ul: ({ children }) =>
    {children}
, - ol: ({ children }) =>
    {children}
, - li: ({ children }) =>
  • {children}
  • , - h1: ({ children }) =>

    {children}

    , - h2: ({ children }) =>

    {children}

    , - h3: ({ children }) =>

    {children}

    , - code: ({ children }) => ( - {children} - ) - }} +
    + {message.parts.map((part, index) => ( +
    - {message.content} - - {message.toolInvocations && - message.toolInvocations.map((tool, index) => ( -
    - - Tool called: {tool.toolName} -
    - ))} -
    + + + {part.type === 'text' && message.role === 'user' ? ( + + ) : part.type === 'text' ? ( + + ) : part.type === 'tool-invocation' ? ( + + ) : part.type === 'reasoning' ? ( + + ) : null} + + + +
    + {part.type === 'text' ? ( +

    {children}

    , + ul: ({ children }) =>
      {children}
    , + ol: ({ children }) => ( +
      {children}
    + ), + li: ({ children }) =>
  • {children}
  • , + h1: ({ children }) =>

    {children}

    , + h2: ({ children }) =>

    {children}

    , + h3: ({ children }) =>

    {children}

    , + code: ({ children }) => ( + + {children} + + ) + }} + > + {message.content} +
    + ) : part.type === 'tool-invocation' ? ( +
    + + Tool called: {part.toolInvocation.toolName} +
    + ) : part.type === 'reasoning' ? ( +
    + + {part.type} +
    + ) : null} +
    +
    + ))}
    ))} {isLoading && (