feat : file agent improved

This commit is contained in:
martin legrand
2025-03-26 12:06:27 +01:00
parent df922b18a7
commit 8922350379
11 changed files with 75 additions and 41 deletions
+4 -17
View File
@@ -13,11 +13,7 @@ class CasualAgent(Agent):
"""
super().__init__(name, prompt_path, provider, verbose)
self.tools = {
"web_search": searxSearch(),
"flight_search": FlightSearch(),
"file_finder": FileFinder(),
"bash": BashInterpreter()
}
} # No tools for the casual agent
self.role = {
"en": "talk",
"fr": "discuter",
@@ -27,19 +23,10 @@ class CasualAgent(Agent):
self.type = "casual_agent"
def process(self, prompt, speech_module) -> str:
complete = False
self.memory.push('user', prompt)
while not complete:
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 tool in self.tools.values():
if tool.found_executable_blocks():
complete = False # AI read results and continue the conversation
animate_thinking("Thinking...", color="status")
answer, reasoning = self.llm_request()
self.last_answer = answer
return answer, reasoning
if __name__ == "__main__":