Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
Josh-XT committed Dec 23, 2024
1 parent 8424ba8 commit e5afa67
Showing 1 changed file with 0 additions and 16 deletions.
16 changes: 0 additions & 16 deletions agixt/XT.py
Original file line number Diff line number Diff line change
Expand Up @@ -1800,22 +1800,6 @@ async def chat_completions(self, prompt: ChatCompletions):
thoughts_and_reflections += after_thoughts
except:
pass
# Strip out any <execute> or <output> tags
if "<execute>" in thoughts_and_reflections:
thoughts_and_reflections = re.sub(
r"<execute>(.*?)</execute>", "", thoughts_and_reflections
)
if "<output>" in thoughts_and_reflections:
thoughts_and_reflections = re.sub(
r"<output>(.*?)</output>", "", thoughts_and_reflections
)
if len(thoughts_and_reflections) > 10:
timestamp = datetime.now().strftime("%Y-%m-%d %H:%M:%S")
await self.file_reader.write_text_to_memory(
user_input=new_prompt,
text=f"{self.agent_name}'s previous thoughts and reflections from {timestamp}:\n{thoughts_and_reflections}",
external_source=f"{self.agent_name}",
)
answer = response.split("<answer>")[-1]
answer = answer.split("</answer>")[0]
response = answer
Expand Down

0 comments on commit e5afa67

Please sign in to comment.