Configure max allowed iterations in research mode via env var

This commit is contained in:
Debanjum
2025-03-18 17:01:14 +05:30
parent 2ab8e711d3
commit 931f555cf8
2 changed files with 8 additions and 1 deletions

View File

@@ -1,4 +1,5 @@
import logging
import os
from datetime import datetime
from typing import Callable, Dict, List, Optional
@@ -160,7 +161,7 @@ async def execute_information_collection(
query_files: str = None,
):
current_iteration = 0
MAX_ITERATIONS = 5
MAX_ITERATIONS = int(os.getenv("KHOJ_RESEARCH_ITERATIONS", 5))
previous_iterations: List[InformationCollectionIteration] = []
while current_iteration < MAX_ITERATIONS:
online_results: Dict = dict()