mirror of
https://github.com/SpudGunMan/meshing-around.git
synced 2026-08-07 17:32:52 +02:00
saveSomeAPIcalls
This commit is contained in:
+10
-4
@@ -106,11 +106,17 @@ def handle_wiki(message):
|
||||
return "Please add a search term example:wiki: travelling gnome"
|
||||
|
||||
def handle_llm(message_from_id, channel_number, deviceID, message, publicChannel):
|
||||
global llmRunCounter, llmTotalRuntime
|
||||
|
||||
location = get_node_location(message_from_id, deviceID)
|
||||
global llmRunCounter, llmTotalRuntime, llmLocationTable
|
||||
|
||||
if location_enabled:
|
||||
location_name = where_am_i(str(location[0]), str(location[1]), short = True)
|
||||
location = get_node_location(message_from_id, deviceID)
|
||||
# if message_from_id is is the llmLocationTable use the location from the table to save on API calls
|
||||
if message_from_id in llmLocationTable:
|
||||
location = llmLocationTable[message_from_id]
|
||||
else:
|
||||
location_name = where_am_i(str(location[0]), str(location[1]), short = True)
|
||||
llmLocationTable.append({message_from_id: location_name})
|
||||
|
||||
if NO_DATA_NOGPS in location_name:
|
||||
location_name = "no location provided "
|
||||
else:
|
||||
|
||||
@@ -28,6 +28,7 @@ scheduler_enabled = False # enable the scheduler currently config via code only
|
||||
wiki_return_limit = 3 # limit the number of sentences returned off the first paragraph first hit
|
||||
llmRunCounter = 0
|
||||
llmTotalRuntime = []
|
||||
llmLocationTable = []
|
||||
|
||||
# Read the config file, if it does not exist, create basic config file
|
||||
config = configparser.ConfigParser()
|
||||
|
||||
Reference in New Issue
Block a user