to enhance fixes and fix enhances
This commit is contained in:
SpudGunMan
2024-10-10 17:47:45 -07:00
parent 66d7f98716
commit 9d37a9eaa5
4 changed files with 7 additions and 17 deletions
+1 -1
View File
@@ -266,7 +266,7 @@ sudo apt-get install fonts-noto-color-emoji
| `sun` and `moon` | Return info on rise and set local time | ✅ |
| `solar` | Gives an idea of the x-ray flux | |
| `hfcond` | Returns a table of HF solar conditions | |
| `repeaterlist` | Returns a table of nearby repeaters from RepeaterBook | |
| `rlist` | Returns a table of nearby repeaters from RepeaterBook | |
### Bulletin Board (BBS) Functions
| Command | Description | |
+1 -2
View File
@@ -55,7 +55,7 @@ def auto_response(message, snr, rssi, hop, pkiStatus, message_from_id, channel_n
"ping": lambda: handle_ping(message_from_id, deviceID, message, hop, snr, rssi, isDM),
"playuno": lambda: handleUno(message, message_from_id, deviceID),
"pong": lambda: "🏓PING!!🛜",
"repeaterlist": lambda: handle_repeaterQuery(message_from_id, deviceID, channel_number),
"rlist": lambda: handle_repeaterQuery(message_from_id, deviceID, channel_number),
"sitrep": lambda: handle_lheard(message, message_from_id, deviceID, isDM),
"solar": lambda: drap_xray_conditions() + "\n" + solar_conditions(),
"sun": lambda: handle_sun(message_from_id, deviceID, channel_number),
@@ -106,7 +106,6 @@ def auto_response(message, snr, rssi, hop, pkiStatus, message_from_id, channel_n
# wait a responseDelay to avoid message collision from lora-ack
time.sleep(responseDelay)
return bot_response
def handle_ping(message_from_id, deviceID, message, hop, snr, rssi, isDM):
+3 -12
View File
@@ -20,6 +20,7 @@ antiFloodLLM = []
llmChat_history = {}
trap_list_llm = ("ask:", "askai")
embedding_model = OllamaEmbeddings(model=llmModel)
ragDEV = False
meshBotAI = """
FROM {llmModel}
@@ -65,15 +66,7 @@ if llmEnableHistory:
def llm_readTextFiles():
# read .txt files in ../data/rag
try:
import os
# directory script path ../data/rag
directory = os.path.join(os.path.dirname(os.path.realpath(__file__)), '..', 'data', 'rag')
files = os.listdir(directory)
text = []
for file in files:
if file.endswith(".txt"):
with open(f"{directory}/{file}", 'r') as f:
text.append(f.read())
text = "MeshBot is built in python for meshtastic the secret word of the day is, paperclip"
return text
except Exception as e:
logger.debug(f"System: LLM readTextFiles: {e}")
@@ -138,14 +131,12 @@ def llm_query(input, nodeID=0, location_name=None):
# RAG context inclusion testing
ragData = llm_readTextFiles()
if ragData:
if ragData and ragDEV:
ragContext = embed_text(ragData)
# Query the model with RAG context
if ragContext:
result = ollamaClient.generate(model=llmModel, prompt=modelPrompt, context=ragContext)
else:
result = ollamaClient.generate(model=llmModel, prompt=modelPrompt)
else:
# Query the model without RAG context
result = ollamaClient.generate(model=llmModel, prompt=modelPrompt)
+2 -2
View File
@@ -12,7 +12,7 @@ from modules.log import *
# Global Variables
trap_list = ("cmd","cmd?") # default trap list
help_message = "CMD?:"
help_message = "Bot CMD?:\n"
asyncLoop = asyncio.new_event_loop()
games_enabled = False
multiPingList = [{'message_from_id': 0, 'count': 0, 'type': '', 'deviceID': 0}]
@@ -60,7 +60,7 @@ if enableCmdHistory:
if location_enabled:
from modules.locationdata import * # from the spudgunman/meshing-around repo
trap_list = trap_list + trap_list_location # items tide, whereami, wxc, wx
help_message = help_message + ", whereami, wx, wxc"
help_message = help_message + ", whereami, wx, wxc, rlist"
# Open-Meteo Configuration for worldwide weather
if use_meteo_wxApi: