Fix Telegram prompt: send only message text to orchestrator, not duplicate title
This commit is contained in:
parent
ab21363032
commit
be1f375071
1 changed files with 8 additions and 5 deletions
13
app.py
13
app.py
|
|
@ -2247,13 +2247,16 @@ def process_beat_tasks():
|
|||
|
||||
sender_info = ''
|
||||
if task.get('type') == 'telegram':
|
||||
# Telegram: nur die eigentliche Nachricht (description) übergeben,
|
||||
# nicht den Titel (der ist nur eine Kurzzusammenfassung für die DB).
|
||||
sender_info = (
|
||||
f"\n\n[Eingehende Telegram-Nachricht]\n"
|
||||
f"Von: {task.get('telegram_user', 'Unbekannt')} "
|
||||
f"(Telegram-ID: {task.get('telegram_chat_id', 'N/A')})\n"
|
||||
f"Created by: {task.get('created_by', 'N/A')}\n"
|
||||
f"[Eingehende Telegram-Nachricht von {task.get('telegram_user', 'Unbekannt')} "
|
||||
f"(Telegram-ID: {task.get('telegram_chat_id', 'N/A')})]\n\n"
|
||||
)
|
||||
response = execute_agent_task('orchestrator', task.get('title', '') + '\n\n' + task.get('description', '') + sender_info)
|
||||
prompt = sender_info + task.get('description', '')
|
||||
else:
|
||||
prompt = task.get('title', '') + '\n\n' + task.get('description', '')
|
||||
response = execute_agent_task('orchestrator', prompt)
|
||||
|
||||
update_task_db(task['id'], status='completed', response=response)
|
||||
task['status'] = 'completed'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue