mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-04 05:39:06 +00:00
Configure max allowed iterations in research mode via env var
This commit is contained in:
6
.github/workflows/run_evals.yml
vendored
6
.github/workflows/run_evals.yml
vendored
@@ -45,6 +45,11 @@ on:
|
||||
required: false
|
||||
default: 'gemini-2.0-flash'
|
||||
type: string
|
||||
max_research_iterations:
|
||||
description: 'Maximum number of iterations in research mode'
|
||||
required: false
|
||||
default: 5
|
||||
type: number
|
||||
|
||||
jobs:
|
||||
eval:
|
||||
@@ -110,6 +115,7 @@ jobs:
|
||||
KHOJ_URL: "http://localhost:42110"
|
||||
KHOJ_DEFAULT_CHAT_MODEL: ${{ github.event_name == 'workflow_dispatch' && inputs.chat_model || 'gemini-2.0-flash' }}
|
||||
KHOJ_LLM_SEED: "42"
|
||||
KHOJ_RESEARCH_ITERATIONS: ${{ github.event_name == 'workflow_dispatch' && inputs.max_research_iterations || 5 }}
|
||||
GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}
|
||||
SERPER_DEV_API_KEY: ${{ matrix.dataset != 'math500' && secrets.SERPER_DEV_API_KEY }}
|
||||
OLOSTEP_API_KEY: ${{ matrix.dataset != 'math500' && secrets.OLOSTEP_API_KEY }}
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user