This commit is contained in:
Saifeddine ALOUI 2024-05-19 00:05:42 +02:00
parent c680f0de07
commit 525ad7da4f

View File

@ -350,6 +350,8 @@ class AudioRecorder:
self.block_listening = True
try:
if filename:
user_name = self.lc.config.user_name if self.lc.config.use_user_name_in_discussions else "user"
user_description = "\n!@>user information:" + self.lc.config.user_description if self.lc.config.use_user_informations_in_discussion else ""
# TODO: send signal
# self.transcription_signal.update_status.emit("Transcribing")
ASCIIColors.green("<<TRANSCRIBING>>")
@ -364,9 +366,9 @@ class AudioRecorder:
if result["text"]!="":
# TODO : send the output
# self.transcription_signal.new_user_transcription.emit(filename, result["text"])
self.discussion.add_message(MSG_TYPE.MSG_TYPE_FULL.value, SENDER_TYPES.SENDER_TYPES_USER.value, "user",result["text"])
self.discussion.add_message(MSG_TYPE.MSG_TYPE_FULL.value, SENDER_TYPES.SENDER_TYPES_USER.value, user_name, result["text"])
discussion = self.discussion.format_discussion(self.context_size)
full_context = self.personality.personality_conditioning +"\n" + discussion+f"\n!@>{self.personality.name}:"
full_context = self.personality.personality_conditioning + user_description +"\n" + discussion+f"\n!@>{self.personality.name}:"
ASCIIColors.red(" ---------------- Discussion ---------------------")
ASCIIColors.yellow(full_context)
ASCIIColors.red(" -------------------------------------------------")
@ -377,9 +379,9 @@ class AudioRecorder:
if len(function_calls)>0:
responses = self.fn.execute_function_calls(function_calls=function_calls)
if self.image_shot:
lollms_text = self.lc.generate_with_images(full_context+f"!@>{self.personality.name}: "+ lollms_text + "\n!@>functions outputs:\n"+ "\n".join(responses) +"!@>lollms:", [self.image_shot])
lollms_text = self.tl.fast_gen_with_images(full_context+f"!@>{self.personality.name}: "+ lollms_text + "\n!@>functions outputs:\n"+ "\n".join(responses) +"!@>lollms:", [self.image_shot])
else:
lollms_text = self.lc.generate(full_context+f"!@>{self.personality.name}: "+ lollms_text + "\n!@>functions outputs:\n"+ "\n".join(responses) +"!@>lollms:")
lollms_text = self.tl.fast_gen(full_context+f"!@>{self.personality.name}: "+ lollms_text + "\n!@>functions outputs:\n"+ "\n".join(responses) +"!@>lollms:")
lollms_text = self.fix_string_for_xtts(lollms_text)
self.discussion.add_message(MSG_TYPE.MSG_TYPE_FULL.value, SENDER_TYPES.SENDER_TYPES_AI.value, self.personality.name,lollms_text)
ASCIIColors.red(" -------------- LOLLMS answer -------------------")