index.tsx 499 B

12345678910111213141516171819
  1. import { EChatRole, TChatRole } from "@/types/bot";
  2. import Message from "./Message";
  3. import MessageRobot from "./MessageRobot";
  4. import { TAgentDetail } from "@/types/agent";
  5. interface Props {
  6. agent?: TAgentDetail,
  7. role: TChatRole,
  8. text: string
  9. textReasoning?: string
  10. }
  11. export default ({agent, text, role, textReasoning=''}:Props) => {
  12. if(role === EChatRole.User ){
  13. return <Message text={text}/>
  14. }
  15. return <MessageRobot textReasoning={textReasoning} text={text} agent={agent}/>
  16. }