This commit is contained in:
SpudGunMan
2024-09-03 17:13:04 -07:00
parent eb3bbdd3c5
commit 5d53db4211
4 changed files with 8 additions and 6 deletions
+2 -2
View File
@@ -40,8 +40,8 @@ Any messages that are over 160 characters are chunked into 160 message bytes to
- `wx` and `wxc` returns local weather forecast, (wxc is metric value), NOAA or Open Meteo for weather forecasting.
- `wxa` and `wxalert` return NOAA alerts. Short title or expanded details
- `joke` tells a joke
- `wiki: ` search wikipedia, return the first few sentances of first result if a match `wiki: lora radio`
- `ask: ` ask Ollama LLM AI for a response `ask: what temp do I cook chicken`
- `wiki: ` will search wikipedia, return the first few sentances of first result if a match `wiki: lora radio`
- `askai` and `ask:` will ask Ollama LLM AI for a response `askai what temp do I cook chicken`
- `messages` Replay the last messages heard, like Store and Forward
- `motd` or to set the message `motd $New Message Of the day`
- `lheard` returns the last 5 heard nodes with SNR, can also use `sitrep`
+4 -1
View File
@@ -24,6 +24,7 @@ def auto_response(message, snr, rssi, hop, message_from_id, channel_number, devi
"wx": lambda: handle_wxc(message_from_id, deviceID, 'wx'),
"wiki:": lambda: handle_wiki(message),
"ask:": lambda: handle_llm(message_from_id, channel_number, deviceID, message, publicChannel),
"askai": lambda: handle_llm(message_from_id, channel_number, deviceID, message, publicChannel),
"joke": tell_joke,
"bbslist": bbs_list_messages,
"bbspost": lambda: handle_bbspost(message, message_from_id, deviceID),
@@ -108,9 +109,11 @@ def handle_llm(message_from_id, channel_number, deviceID, message, publicChannel
global llmRunCounter, llmTotalRuntime
if "ask:" in message.lower():
user_input = message.split(":")[1]
user_input = user_input.strip()
elif "askai" in message.lower():
user_input = message.replace("askai", "")
else:
user_input = message
user_input = user_input.strip()
if len(user_input) < 1:
return "Please ask a question"
+1 -1
View File
@@ -13,7 +13,7 @@ llmEnableHistory = False
llm_history_limit = 6 # limit the history to 3 messages (come in pairs)
antiFloodLLM = []
llmChat_history = []
trap_list_llm = ("ask:",)
trap_list_llm = ("ask:", "askai")
meshBotAI = """
FROM {llmModel}
+1 -2
View File
@@ -74,7 +74,7 @@ if wikipedia_enabled:
if llm_enabled:
from modules.llm import * # from the spudgunman/meshing-around repo
trap_list = trap_list + trap_list_llm # items ask:
help_message = help_message + ", ask:"
help_message = help_message + ", askai"
# Scheduled Broadcast Configuration
if scheduler_enabled:
@@ -670,7 +670,6 @@ async def watchdog():
with contextlib.redirect_stdout(None):
interface1.localNode.getMetadata()
print(f"System: if you see this upgrade python to >3.4")
#if "device_state_version:" not in meta:
except Exception as e:
logger.error(f"System: communicating with interface1, trying to reconnect: {e}")
retry_int1 = True