fixed bug

This commit is contained in:
Frederico @ VilaRosa02 2025-08-29 19:31:26 +00:00
parent edeecd8c5a
commit 0384397e28
4 changed files with 18 additions and 3 deletions

4
.gitmodules vendored
View File

@ -1,6 +1,6 @@
[submodule "make-llm-files"] [submodule "make-llm-files"]
path = make-llm-files path = make-llm-files
url = https://git.fredericofalcao.com/git/make-llm-files url = https://git.fredericofalcao.com/git/make-llm-files
[submodule "make-telegram-updates"] [submodule "process-telegram-updates"]
path = make-telegram-updates path = process-telegram-updates
url = https://git.fredericofalcao.com/git/make-telegram-updates url = https://git.fredericofalcao.com/git/make-telegram-updates

@ -1 +0,0 @@
Subproject commit b6b01b48dc01a41db14066196fe3d379560d67f0

@ -0,0 +1 @@
Subproject commit 5c6601d7ec86c3e0baf4c1e6341830e8e66d84f7

View File

@ -16,6 +16,19 @@ SRC_FILES=$(subst .score.txt,.notification.txt,$(SRC_SCORE_FILES))
all: $(SRC_FILES) all: $(SRC_FILES)
# 7. Processed received messages
process-telegram-updates: ../process-telegram-updates/process_message.php
cd ../process-telegram-updates && make fetch_updates
cd ../process-telegram-updates && make process_updates
../process-telegram-updates/process_message.php:
printf '%s\n' \
'<?php function process_message(array $$from,array $$chat,string $$date,string $$text) { '\
' if (substr($$text,0,7) == "/learn ") file_put_contents(__DIR__."/data/learnings.txt", substr($$text,7)."\n",FILE_APPEND); '\
' if (substr($$text,0,7) == "/memory") telegram_send_text($$chat["id"],file_get_contents(__DIR__."/data/learnings.txt"));'\
' }' > $@
# 6. Run the MAIL-ROUTE script to either notify the user of a new message, or ignore # 6. Run the MAIL-ROUTE script to either notify the user of a new message, or ignore
%.notification.txt: %.score.txt %.header.txt %.summary.txt %.notification.txt: %.score.txt %.header.txt %.summary.txt
TELEGRAM_BOT_TOKEN=$(TELEGRAM_BOT_TOKEN) TELEGRAM_CHAT_ID=$(TELEGRAM_CHAT_ID) ./mail-route $^ > $@ TELEGRAM_BOT_TOKEN=$(TELEGRAM_BOT_TOKEN) TELEGRAM_CHAT_ID=$(TELEGRAM_CHAT_ID) ./mail-route $^ > $@
@ -32,6 +45,7 @@ all: $(SRC_FILES)
%.summary.txt: %.email.txt %.summary.txt: %.email.txt
cd ../make-llm-files && make clean cd ../make-llm-files && make clean
echo "You are a machine executive assistant tasked with parsing emails. User will send the content of a received email, and you (agent) must send a one phrase (max 12 words) sentence as an executive summary of the email." > ../make-llm-files/01_root.sys echo "You are a machine executive assistant tasked with parsing emails. User will send the content of a received email, and you (agent) must send a one phrase (max 12 words) sentence as an executive summary of the email." > ../make-llm-files/01_root.sys
cp ../process-telegram-updates/data/learnings.txt ../make-llm-files/02_learnings.sys
cp ../data/$< ../make-llm-files/user_message.txt cp ../data/$< ../make-llm-files/user_message.txt
echo '{}' > ../make-llm-files/settings.json echo '{}' > ../make-llm-files/settings.json
cd ../make-llm-files && make cd ../make-llm-files && make
@ -43,6 +57,7 @@ all: $(SRC_FILES)
%.score.txt: %.email.txt %.score.txt: %.email.txt
cd ../make-llm-files && make clean cd ../make-llm-files && make clean
echo "You are a machine executive assistant tasked with parsing emails urgency/importance. User will send the content of a received email, and you (agent) must REPLY ONLY with a single score [0.00-1.00] where you assess how important/urgent the email is." > ../make-llm-files/01_root.sys echo "You are a machine executive assistant tasked with parsing emails urgency/importance. User will send the content of a received email, and you (agent) must REPLY ONLY with a single score [0.00-1.00] where you assess how important/urgent the email is." > ../make-llm-files/01_root.sys
cp process-telegram-updates/data/learnings.txt ../make-llm-files/02_learnings.sys
cp ../data/$< ../make-llm-files/user_message.txt cp ../data/$< ../make-llm-files/user_message.txt
echo '{"temperature": 0.8,"max_output_tokens":4}' > ../make-llm-files/settings.json echo '{"temperature": 0.8,"max_output_tokens":4}' > ../make-llm-files/settings.json
cd ../make-llm-files && make cd ../make-llm-files && make