+ fixes
This commit is contained in:
@@ -142,12 +142,13 @@ async def change_quality(call: CallbackQuery, state: FSMContext, dao: DAO):
|
||||
@router.callback_query(States.gen_mode, F.data == 'gen_mode_change_type')
|
||||
async def gen_mode_change_type(call: CallbackQuery, state: FSMContext, dao: DAO):
|
||||
await call.answer()
|
||||
keyboards = []
|
||||
for gen_type in GenType:
|
||||
keyboards.append(InlineKeyboardButton(text=gen_type.value, callback_data=f'select_type_{gen_type.name}'))
|
||||
await call.message.edit_caption(caption="Выбери тип генерации", reply_markup=InlineKeyboardMarkup(
|
||||
inline_keyboard=[keyboards,
|
||||
[InlineKeyboardButton(text="⬅️ Назад", callback_data="gen_mode_cancel_type_change")]]))
|
||||
data = await state.get_data()
|
||||
if GenType(data['type']) is GenType.IMAGE:
|
||||
await state.update_data({"type": GenType.TEXT.name})
|
||||
else:
|
||||
await state.update_data({"type": GenType.IMAGE.name})
|
||||
|
||||
await gen_mode_base_msg(call.message, state=state, dao=dao)
|
||||
|
||||
|
||||
@router.callback_query(States.gen_mode, F.data.startswith('select_type_'))
|
||||
@@ -346,7 +347,6 @@ async def generate_image(
|
||||
quality=Quality[data['quality']],
|
||||
)
|
||||
|
||||
|
||||
images = []
|
||||
if generated_images_io:
|
||||
for img_io in generated_images_io:
|
||||
@@ -376,7 +376,7 @@ async def gen_start_text(message: Message, gemini: GoogleAdapter, state: FSMCont
|
||||
char_id: str = None) -> str:
|
||||
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+=f"PROMPT:\n{message.text}\n\n"
|
||||
prompt += f"PROMPT:\n{message.text}\n\n"
|
||||
if char_id:
|
||||
char = await dao.chars.get_character(message.chat.id)
|
||||
prompt += char.character_bio
|
||||
|
||||
Reference in New Issue
Block a user