feat : fast browser memory recovery
This commit is contained in:
1 parent
aa75d276dc
commit
f69ceb5025
3 files changed
+13
-3
No files matched your search
@@ -251,7 +251,7 @@ class BrowserAgent(Agent):
|
||||
complete = False
|
||||
|
||||
animate_thinking(f"Thinking...", color="status")
|
||||
self.memory.push('user', self.search_prompt(user_prompt))
|
||||
mem_begin_idx = self.memory.push('user', self.search_prompt(user_prompt))
|
||||
ai_prompt, _ = self.llm_request()
|
||||
if "REQUEST_EXIT" in ai_prompt:
|
||||
pretty_print(f"{reasoning}\n{ai_prompt}", color="output")
|
||||
@@ -305,9 +305,10 @@ class BrowserAgent(Agent):
|
||||
prompt = self.make_navigation_prompt(user_prompt, page_text)
|
||||
|
||||
prompt = self.conclude_prompt(user_prompt)
|
||||
self.memory.push('user', prompt)
|
||||
mem_last_idx = self.memory.push('assistant', prompt)
|
||||
answer, reasoning = self.llm_request()
|
||||
pretty_print(answer, color="output")
|
||||
self.memory.clear_section(mem_begin_idx, mem_last_idx)
|
||||
return answer, reasoning
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
Reference in new issue
Block a user