feat : stop button integration
This commit is contained in:
@@ -46,6 +46,7 @@ class Agent():
|
||||
self.last_answer = ""
|
||||
self.last_reasoning = ""
|
||||
self.status_message = "Haven't started yet"
|
||||
self.stop = False
|
||||
self.verbose = verbose
|
||||
self.executor = ThreadPoolExecutor(max_workers=1)
|
||||
|
||||
@@ -119,6 +120,13 @@ class Agent():
|
||||
except Exception as e:
|
||||
raise e
|
||||
|
||||
def request_stop(self) -> None:
|
||||
"""
|
||||
Request the agent to stop.
|
||||
"""
|
||||
self.stop = True
|
||||
self.status_message = "Stopped"
|
||||
|
||||
@abstractmethod
|
||||
def process(self, prompt, speech_module) -> str:
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user