да лимит файл фикс da
This commit is contained in:
1 parent
68bc3f0eb9
commit
6372a96f87
1 file changed
+3
-4
@@ -284,7 +284,7 @@ async def guest_middleware(handler, event, data):
|
|||||||
file_content = file_bytes.read().decode("utf-8", errors="ignore")
|
file_content = file_bytes.read().decode("utf-8", errors="ignore")
|
||||||
file_bytes.close()
|
file_bytes.close()
|
||||||
|
|
||||||
prompt = f"<файл>{file_content}</файл>{prompt}"
|
prompt = f"<файл>{file_content[:MAX_PROMPT]}</файл>{prompt}"
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(f"{YELLOW} -- {e}{RESET}")
|
print(f"{YELLOW} -- {e}{RESET}")
|
||||||
@@ -299,7 +299,7 @@ async def guest_middleware(handler, event, data):
|
|||||||
else:
|
else:
|
||||||
file_content = file_bytes.read().decode("utf-8", errors="ignore")
|
file_content = file_bytes.read().decode("utf-8", errors="ignore")
|
||||||
file_bytes.close()
|
file_bytes.close()
|
||||||
prompt = f"<файл>{file_content}</файл>{prompt}"
|
prompt = f"<файл>{file_content[:MAX_PROMPT]}</файл>{prompt}"
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(f"{YELLOW} -- {e}{RESET}")
|
print(f"{YELLOW} -- {e}{RESET}")
|
||||||
|
|
||||||
@@ -362,10 +362,9 @@ async def guest_middleware(handler, event, data):
|
|||||||
elif event.guest_message and gmsg:
|
elif event.guest_message and gmsg:
|
||||||
await bot.edit_message_text(text=make_graph(message, process), inline_message_id=gmsg.inline_message_id)
|
await bot.edit_message_text(text=make_graph(message, process), inline_message_id=gmsg.inline_message_id)
|
||||||
print(f"{RED} -- photo - {e}{RESET}")
|
print(f"{RED} -- photo - {e}{RESET}")
|
||||||
prompt = f"{prompt}\n{user_text}"
|
prompt = f"{prompt}\n{user_text[:MAX_PROMPT]}"
|
||||||
if replied_text:
|
if replied_text:
|
||||||
prompt = f"<ответ на>{replied_text}</ответ> {prompt}"
|
prompt = f"<ответ на>{replied_text}</ответ> {prompt}"
|
||||||
prompt = prompt[:MAX_PROMPT]
|
|
||||||
|
|
||||||
if config["markdown"] == "" and message.from_user.id != 777000:
|
if config["markdown"] == "" and message.from_user.id != 777000:
|
||||||
last_command_time[user_id][1] = False
|
last_command_time[user_id][1] = False
|
||||||
|
|||||||
Reference in new issue
Block a user