Skip to content

Commit

Permalink
Prevent store multiple records
Browse files Browse the repository at this point in the history
  • Loading branch information
szczyglis-dev committed Nov 26, 2024
1 parent c298cf9 commit 0f09c3a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/pygpt_net/core/attachments/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,11 @@ def get_context_text(self, ctx: CtxItem, filename: bool = False) -> str:

# store used files and URLs in ctx
if file["type"] == "url":
self.last_urls.append(store_path)
if store_path not in self.last_urls:
self.last_urls.append(store_path)
else:
self.last_files.append(store_path)
if store_path not in self.last_files:
self.last_files.append(store_path)

if os.path.exists(text_path):
try:
Expand Down

0 comments on commit 0f09c3a

Please sign in to comment.