feat : file agent improved
This commit is contained in:
@@ -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__":
|
||||
|
||||
Reference in New Issue
Block a user