AI Update: تایید است، فرمت جدید را روی ربات اعمال کن.
This commit is contained in:
+19
-32
@@ -2764,18 +2764,11 @@ async def process_agent_turn_by_chat_id(
|
||||
model_display = get_model_display_name(model_to_use, effort_to_use)
|
||||
curr_cid = getattr(curr_proj, "conversation_id", None)
|
||||
conv_title = getattr(curr_proj, "conversation_titles", {}).get(curr_cid) if curr_cid and hasattr(curr_proj, "conversation_titles") else None
|
||||
if is_fa:
|
||||
topic_str = f" • 🏷️ «{escape_html(conv_title)}»" if conv_title else ""
|
||||
initial_status = (
|
||||
f"📁 <b>پروژه:</b> <code>{escape_html(curr_proj.name)}</code>{topic_str}\n\n"
|
||||
f"💭 <b>{escape_html(model_display)}</b>"
|
||||
)
|
||||
else:
|
||||
topic_str = f" • 🏷️ \"{escape_html(conv_title)}\"" if conv_title else ""
|
||||
initial_status = (
|
||||
f"📁 <b>Project:</b> <code>{escape_html(curr_proj.name)}</code>{topic_str}\n\n"
|
||||
f"💭 <b>{escape_html(model_display)}</b>"
|
||||
)
|
||||
proj_label = f"📁 <b>پروژه:</b> <code>{escape_html(curr_proj.name)}</code>" if is_fa else f"📁 <b>Project:</b> <code>{escape_html(curr_proj.name)}</code>"
|
||||
status_lines = [f"🤔 <b>{escape_html(model_display)}</b>"]
|
||||
if conv_title:
|
||||
status_lines.append(f"🗣 <i>{escape_html(conv_title)}</i>")
|
||||
initial_status = f"{proj_label}\n\n" + "\n".join(status_lines)
|
||||
status_msg = await app.bot.send_message(
|
||||
chat_id=chat_id,
|
||||
text=initial_status,
|
||||
@@ -6541,18 +6534,11 @@ async def process_agent_turn(
|
||||
else:
|
||||
curr_cid = getattr(curr_proj, "conversation_id", None)
|
||||
conv_title = getattr(curr_proj, "conversation_titles", {}).get(curr_cid) if curr_cid and hasattr(curr_proj, "conversation_titles") else None
|
||||
if is_fa:
|
||||
topic_str = f" • 🏷️ «{escape_html(conv_title)}»" if conv_title else ""
|
||||
initial_status = (
|
||||
f"📁 <b>پروژه:</b> <code>{escape_html(curr_proj.name)}</code>{topic_str}\n\n"
|
||||
f"💭 <b>{escape_html(model_display)}</b>"
|
||||
)
|
||||
else:
|
||||
topic_str = f" • 🏷️ \"{escape_html(conv_title)}\"" if conv_title else ""
|
||||
initial_status = (
|
||||
f"📁 <b>Project:</b> <code>{escape_html(curr_proj.name)}</code>{topic_str}\n\n"
|
||||
f"💭 <b>{escape_html(model_display)}</b>"
|
||||
)
|
||||
proj_label = f"📁 <b>پروژه:</b> <code>{escape_html(curr_proj.name)}</code>" if is_fa else f"📁 <b>Project:</b> <code>{escape_html(curr_proj.name)}</code>"
|
||||
status_lines = [f"🤔 <b>{escape_html(model_display)}</b>"]
|
||||
if conv_title:
|
||||
status_lines.append(f"🗣 <i>{escape_html(conv_title)}</i>")
|
||||
initial_status = f"{proj_label}\n\n" + "\n".join(status_lines)
|
||||
|
||||
status_msg = await update.effective_message.reply_html(
|
||||
initial_status,
|
||||
@@ -6597,7 +6583,6 @@ async def process_agent_turn(
|
||||
# Get dynamic conversation topic if set or updated
|
||||
curr_cid = getattr(curr_proj, "conversation_id", None)
|
||||
conv_title = getattr(curr_proj, "conversation_titles", {}).get(curr_cid) if curr_cid and hasattr(curr_proj, "conversation_titles") else None
|
||||
topic_badge = f" • 🏷️ {escape_html(conv_title)}" if conv_title else ""
|
||||
|
||||
# Suffix at the BOTTOM of the message
|
||||
bottom_parts = []
|
||||
@@ -6613,7 +6598,10 @@ async def process_agent_turn(
|
||||
|
||||
# 3. Status indicator at the bottom stating which model is being used and active topic
|
||||
if not final:
|
||||
bottom_parts.append(f"💭 <b>{escape_html(model_display)}</b>{topic_badge} ▌")
|
||||
status_lines = [f"🤔 <b>{escape_html(model_display)}</b> ▌"]
|
||||
if conv_title:
|
||||
status_lines.append(f"🗣 <i>{escape_html(conv_title)}</i>")
|
||||
bottom_parts.append("\n".join(status_lines))
|
||||
|
||||
if raw_text.strip():
|
||||
formatted_body = markdown_to_telegram_html(raw_text)
|
||||
@@ -6623,15 +6611,14 @@ async def process_agent_turn(
|
||||
full_html = formatted_body + (" ▌" if not final else "")
|
||||
else:
|
||||
# Still waiting for response text - show project header and thinking at the bottom
|
||||
proj_header = (
|
||||
f"📁 <b>پروژه:</b> <code>{escape_html(curr_proj.name)}</code>{topic_badge}"
|
||||
if is_fa else
|
||||
f"📁 <b>Project:</b> <code>{escape_html(curr_proj.name)}</code>{topic_badge}"
|
||||
)
|
||||
proj_header = f"📁 <b>پروژه:</b> <code>{escape_html(curr_proj.name)}</code>" if is_fa else f"📁 <b>Project:</b> <code>{escape_html(curr_proj.name)}</code>"
|
||||
status_lines = [f"🤔 <b>{escape_html(model_display)}</b> ▌"]
|
||||
if conv_title:
|
||||
status_lines.append(f"🗣 <i>{escape_html(conv_title)}</i>")
|
||||
thinking_msg = "\n".join(status_lines)
|
||||
if bottom_parts:
|
||||
full_html = proj_header + "\n\n" + "\n\n".join(bottom_parts)
|
||||
else:
|
||||
thinking_msg = f"💭 <b>{escape_html(model_display)}</b>{topic_badge} ▌"
|
||||
full_html = proj_header + "\n\n" + thinking_msg
|
||||
|
||||
if len(full_html) > settings.max_message_length:
|
||||
|
||||
Reference in New Issue
Block a user