upgraded personality

This commit is contained in:
Saifeddine ALOUI 2024-02-09 00:44:29 +01:00
parent e6fbc6b1f0
commit c952f5cca1

View File

@ -327,6 +327,22 @@ Date: {{date}}
if callback:
callback(full_text, MSG_TYPE.MSG_TYPE_FULL_INVISIBLE_TO_USER)
def add_collapsible_entry(self, title, content):
return "\n".join(
[
f'<details class="flex w-fit rounded-xl border border-gray-200 bg-white shadow-sm dark:border-gray-800 dark:bg-gray-900 mb-3.5 max-w-full svelte-1escu1z" open="">',
f' <summary class="grid min-w-72 select-none grid-cols-[40px,1fr] items-center gap-2.5 p-2 svelte-1escu1z">',
f' <dl class="leading-4">',
f' <dd class="text-sm">{title}</dd>',
f' <dt class="flex items-center gap-1 truncate whitespace-nowrap text-[.82rem] text-gray-400">.Completed</dt>',
f' </dl>',
f' </summary>',
f' <div class="content px-5 pb-5 pt-4">',
content,
f' </div>',
f' </details>\n'
])
def step_start(self, step_text, callback: Callable[[str, MSG_TYPE, dict, list], bool]=None):
"""This triggers a step start
@ -2046,7 +2062,28 @@ class APScript(StateMachine):
prompt_parts[sacrifice_id] = sacrifice_text
return "\n".join([s for s in prompt_parts if s!=""])
# ================================================= Sending commands to ui ===========================================
def add_collapsible_entry(self, title, content, subtitle=""):
return "\n".join(
[
f'<details class="flex w-full rounded-xl border border-gray-200 bg-white shadow-sm dark:border-gray-800 dark:bg-gray-900 mb-3.5 max-w-full svelte-1escu1z" open="">',
f' <summary class="grid w-full select-none grid-cols-[40px,1fr] items-center gap-2.5 p-2 svelte-1escu1z">',
f' <dl class="leading-4">',
f' <dd class="text-sm"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-arrow-right">',
f' <line x1="5" y1="12" x2="19" y2="12"></line>',
f' <polyline points="12 5 19 12 12 19"></polyline>',
f' </svg>',
f' </dd>',
f' </dl>',
f' <dl class="leading-4">',
f' <dd class="text-sm"><h3>{title}</h3></dd>',
f' <dt class="flex items-center gap-1 truncate whitespace-nowrap text-[.82rem] text-gray-400">{subtitle}</dt>',
f' </dl>',
f' </summary>',
f' <div class="content px-5 pb-5 pt-4">',
content,
f' </div>',
f' </details>\n'
])
def step_start(self, step_text, callback: Callable[[str, MSG_TYPE, dict, list], bool]=None):
"""This triggers a step start