Revert "Remove AI"

This reverts commit dc3a82a85e.
This commit is contained in:
Jeroen Oudshoorn
2024-01-05 14:05:29 +01:00
parent 3e5bea0d5d
commit 83e97d7568
4 changed files with 35 additions and 1 deletions

View File

@ -1,6 +1,7 @@
import logging import logging
import pwnagotchi.plugins as plugins import pwnagotchi.plugins as plugins
from pwnagotchi.ai.epoch import Epoch
# basic mood system # basic mood system

View File

@ -58,6 +58,34 @@ class Example(plugins.Plugin):
# or set a custom state # or set a custom state
# agent.set_bored() # agent.set_bored()
# called when the AI finished loading
def on_ai_ready(self, agent):
pass
# called when the AI finds a new set of parameters
def on_ai_policy(self, agent, policy):
pass
# called when the AI starts training for a given number of epochs
def on_ai_training_start(self, agent, epochs):
pass
# called after the AI completed a training epoch
def on_ai_training_step(self, agent, _locals, _globals):
pass
# called when the AI has done training
def on_ai_training_end(self, agent):
pass
# called when the AI got the best reward so far
def on_ai_best_reward(self, agent, reward):
pass
# called when the AI got the worst reward so far
def on_ai_worst_reward(self, agent, reward):
pass
# called when a non overlapping wifi channel is found to be free # called when a non overlapping wifi channel is found to be free
def on_free_channel(self, agent, channel): def on_free_channel(self, agent, channel):
pass pass

View File

@ -26,6 +26,11 @@ class Voice:
self._('New day, new hunt, new pwns!'), self._('New day, new hunt, new pwns!'),
self._('Hack the Planet!')]) self._('Hack the Planet!')])
def on_ai_ready(self):
return random.choice([
self._('AI ready.'),
self._('The neural network is ready.')])
def on_keys_generation(self): def on_keys_generation(self):
return random.choice([ return random.choice([
self._('Generating keys, do not turn off ...')]) self._('Generating keys, do not turn off ...')])