+ fixes
This commit is contained in:
@@ -375,14 +375,12 @@ async def handle_text(message: Message, gemini: GoogleAdapter, state: FSMContext
|
|||||||
async def gen_start_text(message: Message, gemini: GoogleAdapter, state: FSMContext, dao: DAO, bot: Bot,
|
async def gen_start_text(message: Message, gemini: GoogleAdapter, state: FSMContext, dao: DAO, bot: Bot,
|
||||||
char_id: str = None) -> str:
|
char_id: str = None) -> str:
|
||||||
await bot.send_chat_action(message.chat.id, "typing")
|
await bot.send_chat_action(message.chat.id, "typing")
|
||||||
prompt = ("Use a TELEGRAM HTML formatting. If you write a prompt use <pre> tag.\n\n"
|
prompt = "Use a TELEGRAM HTML formatting. If you write a prompt use <pre> tag.\n\n"
|
||||||
"PROMPT:\n\n",
|
prompt+=f"PROMPT:\n{message.text}\n\n"
|
||||||
message.text,
|
|
||||||
'\n\n')
|
|
||||||
if char_id:
|
if char_id:
|
||||||
char = await dao.chars.get_character(message.chat.id)
|
char = await dao.chars.get_character(message.chat.id)
|
||||||
prompt += char.character_bio
|
prompt += char.character_bio
|
||||||
result = await asyncio.to_thread(gemini.generate_text, prompt=message.text)
|
result = await asyncio.to_thread(gemini.generate_text, prompt=prompt)
|
||||||
if result:
|
if result:
|
||||||
return result
|
return result
|
||||||
else:
|
else:
|
||||||
|
|||||||
Reference in New Issue
Block a user