mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-08 05:39:13 +00:00
Configure max iterations per operator run via environment variable
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
import asyncio
|
import asyncio
|
||||||
import json
|
import json
|
||||||
import logging
|
import logging
|
||||||
|
import os
|
||||||
from typing import Callable, List, Optional
|
from typing import Callable, List, Optional
|
||||||
|
|
||||||
import requests
|
import requests
|
||||||
@@ -46,7 +47,7 @@ async def operate_browser(
|
|||||||
raise ValueError(f"No vision enabled chat model found. Configure a vision chat model to operate browser.")
|
raise ValueError(f"No vision enabled chat model found. Configure a vision chat model to operate browser.")
|
||||||
|
|
||||||
# Initialize Agent
|
# Initialize Agent
|
||||||
max_iterations = 40 # TODO: Configurable?
|
max_iterations = int(os.getenv("KHOJ_OPERATOR_ITERATIONS", 40))
|
||||||
operator_agent: OperatorAgent
|
operator_agent: OperatorAgent
|
||||||
if reasoning_model.name.startswith("gpt-4o"):
|
if reasoning_model.name.startswith("gpt-4o"):
|
||||||
operator_agent = OpenAIOperatorAgent(query, reasoning_model, max_iterations, tracer)
|
operator_agent = OpenAIOperatorAgent(query, reasoning_model, max_iterations, tracer)
|
||||||
|
|||||||
Reference in New Issue
Block a user