Hide buttons on welcome assistant message
| @@ -1,3 +1,7 @@ | ||
| 1 | +#chat .mes[type="assistant_message"] .mes_button { | |
| 2 | + display: none; | |
| 3 | +} | |
| 4 | + | |
| 1 | 5 | .welcomePanel { |
| 2 | 6 | display: flex; |
| 3 | 7 | flex-direction: column; |
| @@ -638,6 +638,7 @@ export const system_message_types = { | ||
| 638 | 638 | MACROS: 'macros', |
| 639 | 639 | WELCOME_PROMPT: 'welcome_prompt', |
| 640 | 640 | ASSISTANT_NOTE: 'assistant_note', |
| 641 | + ASSISTANT_MESSAGE: 'assistant_message', | |
| 641 | 642 | }; |
| 642 | 643 | |
| 643 | 644 | /** |
| @@ -2298,6 +2299,7 @@ function getMessageFromTemplate({ | ||
| 2298 | 2299 | timestamp, |
| 2299 | 2300 | tokenCount, |
| 2300 | 2301 | extra, |
| 2302 | + type, | |
| 2301 | 2303 | }) { |
| 2302 | 2304 | const mes = messageTemplate.clone(); |
| 2303 | 2305 | mes.attr({ |
| @@ -2309,6 +2311,7 @@ function getMessageFromTemplate({ | ||
| 2309 | 2311 | 'bookmark_link': bookmarkLink, |
| 2310 | 2312 | 'force_avatar': !!forceAvatar, |
| 2311 | 2313 | 'timestamp': timestamp, |
| 2314 | + ...(type ? { type } : {}), | |
| 2312 | 2315 | }); |
| 2313 | 2316 | mes.find('.avatar img').attr('src', avatarImg); |
| 2314 | 2317 | mes.find('.ch_name .name_text').text(characterName); |
| @@ -2520,6 +2523,7 @@ export function addOneMessage(mes, { type = 'normal', insertAfter = null, scroll | ||
| 2520 | 2523 | timestamp: timestamp, |
| 2521 | 2524 | extra: mes.extra, |
| 2522 | 2525 | tokenCount: mes.extra?.token_count ?? 0, |
| 2526 | + type: mes.extra?.type ?? '', | |
| 2523 | 2527 | ...formatGenerationTimer(mes.gen_started, mes.gen_finished, mes.extra?.token_count, mes.extra?.reasoning_duration, mes.extra?.time_to_first_token), |
| 2524 | 2528 | }; |
| 2525 | 2529 | |
| @@ -71,7 +71,9 @@ function sendAssistantMessage() { | ||
| 71 | 71 | mes: t`If you're connected to an API, try asking me something!` + '\n***\n' + t`**Hint:** Set any character as your welcome page assistant from their "More..." menu.`, |
| 72 | 72 | is_system: false, |
| 73 | 73 | is_user: false, |
| 74 | 74 | extra: {}, |
| 75 | + type: system_message_types.ASSISTANT_MESSAGE, | |
| 76 | + }, | |
| 75 | 77 | }; |
| 76 | 78 | |
| 77 | 79 | chat.push(message); |