Skip to content

Commit 8ed49ab

Browse files
committed
Update build_knowledge_base.py
1 parent f31a34b commit 8ed49ab

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

KnowledgeBaseBot/build_knowledge_base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,15 @@
4444
with open(STATE_FILE, "r") as f:
4545
last_update_time = datetime.fromisoformat(json.load(f))
4646
print(f"Knowledge base loaded. Last update was at: {last_update_time}")
47-
new_issues = repo.get_issues(state='all', since=last_update_time)
47+
new_issues = repo.get_issues(state='all', since=last_update_time, sort='created', direction='asc')
4848
else:
4949
print("No existing knowledge base found. Creating a new one.")
5050
index = None
5151
metadata = []
5252
all_texts = []
5353
# Set a very old date to fetch all issues for the first time
5454
last_update_time = datetime(1970, 1, 1, tzinfo=timezone.utc)
55-
new_issues = repo.get_issues(state='all')
55+
new_issues = repo.get_issues(state='all', sort='updated', direction='asc')
5656
# Initial processing of documentation (only on first build)
5757
print("Processing documentation for the first time...")
5858
loader = DirectoryLoader(DOCS_PATH, glob="**/*.rst")

0 commit comments

Comments
 (0)