|
582 | 582 | ...message, |
583 | 583 | is_chat_message: false, |
584 | 584 | is_dummy: true, |
585 | | - meta_data: { |
586 | | - ...(message.meta_data || {}), |
587 | | - thinking_text: message.meta_data?.thinking_text || '' |
| 585 | + thought: { |
| 586 | + ...(message.thought || {}), |
| 587 | + thinking_text: message.thought?.thinking_text || '' |
588 | 588 | } |
589 | 589 | }); |
590 | 590 | } |
|
602 | 602 | && lastMsg?.is_dummy |
603 | 603 | ) { |
604 | 604 | setTimeout(() => { |
605 | | - const thinkingText = message.meta_data?.thinking_text || ''; |
| 605 | + const thinkingText = message.thought?.thinking_text || ''; |
606 | 606 | if (thinkingText) { |
607 | | - if (!dialogs[dialogs.length - 1].meta_data) { |
608 | | - dialogs[dialogs.length - 1].meta_data = { thinking_text: '' }; |
| 607 | + if (!dialogs[dialogs.length - 1].thought) { |
| 608 | + dialogs[dialogs.length - 1].thought = { thinking_text: '' }; |
609 | 609 | } |
610 | | - dialogs[dialogs.length - 1].meta_data.thinking_text += thinkingText; |
| 610 | + dialogs[dialogs.length - 1].thought.thinking_text += thinkingText; |
611 | 611 | } |
612 | 612 | dialogs[dialogs.length - 1].text += message.text; |
613 | 613 | refreshDialogs(); |
|
638 | 638 | } |
639 | 639 |
|
640 | 640 | try { |
641 | | - const thinkingText = item.meta_data?.thinking_text || ''; |
| 641 | + const thinkingText = item.thought?.thinking_text || ''; |
642 | 642 | if (thinkingText) { |
643 | | - if (!dialogs[dialogs.length - 1].meta_data) { |
644 | | - dialogs[dialogs.length - 1].meta_data = { thinking_text: '' }; |
| 643 | + if (!dialogs[dialogs.length - 1].thought) { |
| 644 | + dialogs[dialogs.length - 1].thought = { thinking_text: '' }; |
645 | 645 | } |
646 | 646 | for (const tt of thinkingText) { |
647 | | - dialogs[dialogs.length - 1].meta_data.thinking_text += tt; |
| 647 | + dialogs[dialogs.length - 1].thought.thinking_text += tt; |
648 | 648 | refreshDialogs(); |
649 | 649 | await delay(10); |
650 | 650 | } |
|
2014 | 2014 | {#if message.sender.role == UserRole.Client} |
2015 | 2015 | <img src="images/users/user-dummy.jpg" class="rounded-circle avatar-sm" style="margin-bottom: -15px;" alt="avatar"> |
2016 | 2016 | {:else} |
2017 | | - {@const isShowIcon = (message?.rich_content?.message?.text || message?.text || message?.meta_data?.thinking_text) || message?.uuid !== lastBotMsg?.uuid} |
| 2017 | + {@const isShowIcon = (message?.rich_content?.message?.text || message?.text || message?.thought?.thinking_text) || message?.uuid !== lastBotMsg?.uuid} |
2018 | 2018 | <img |
2019 | 2019 | class="rounded-circle avatar-sm" |
2020 | 2020 | style={`display: ${isShowIcon ? 'block' : 'none'}; margin-bottom: -15px;`} |
|
0 commit comments