fix : various bugs & improve memory system
This commit is contained in:
@@ -17,7 +17,7 @@ class BrowserAgent(Agent):
|
||||
self.tools = {
|
||||
"web_search": searxSearch(),
|
||||
}
|
||||
self.role = "Web Research"
|
||||
self.role = "Web surfing, website & news"
|
||||
self.type = "browser_agent"
|
||||
self.browser = Browser()
|
||||
self.current_page = ""
|
||||
|
||||
@@ -18,7 +18,7 @@ class CasualAgent(Agent):
|
||||
"file_finder": FileFinder(),
|
||||
"bash": BashInterpreter()
|
||||
}
|
||||
self.role = "Chat and Conversation"
|
||||
self.role = "talk, quick search"
|
||||
self.type = "casual_agent"
|
||||
|
||||
def process(self, prompt, speech_module) -> str:
|
||||
|
||||
@@ -20,7 +20,7 @@ class CoderAgent(Agent):
|
||||
"go": GoInterpreter(),
|
||||
"file_finder": FileFinder()
|
||||
}
|
||||
self.role = "Code Assistance"
|
||||
self.role = "Coding task"
|
||||
self.type = "code_agent"
|
||||
|
||||
def process(self, prompt, speech_module) -> str:
|
||||
|
||||
@@ -18,23 +18,15 @@ class FileAgent(Agent):
|
||||
self.type = "file_agent"
|
||||
|
||||
def process(self, prompt, speech_module) -> str:
|
||||
complete = False
|
||||
exec_success = False
|
||||
self.memory.push('user', prompt)
|
||||
|
||||
self.wait_message(speech_module)
|
||||
while not complete:
|
||||
if exec_success:
|
||||
complete = True
|
||||
animate_thinking("Thinking...", color="status")
|
||||
answer, reasoning = self.llm_request()
|
||||
exec_success, _ = self.execute_modules(answer)
|
||||
answer = self.remove_blocks(answer)
|
||||
self.last_answer = answer
|
||||
complete = True
|
||||
for name, tool in self.tools.items():
|
||||
if tool.found_executable_blocks():
|
||||
complete = False # AI read results and continue the conversation
|
||||
animate_thinking("Thinking...", color="status")
|
||||
answer, reasoning = self.llm_request()
|
||||
exec_success, _ = self.execute_modules(answer)
|
||||
answer = self.remove_blocks(answer)
|
||||
self.last_answer = answer
|
||||
return answer, reasoning
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
Reference in New Issue
Block a user