mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-09 05:39:12 +00:00
Disable openai, binary operator agents until they become useful
This commit is contained in:
@@ -66,18 +66,7 @@ async def operate_environment(
|
|||||||
max_context = await ConversationAdapters.aget_max_context_size(reasoning_model, user) or 20000
|
max_context = await ConversationAdapters.aget_max_context_size(reasoning_model, user) or 20000
|
||||||
max_iterations = int(os.getenv("KHOJ_OPERATOR_ITERATIONS", 100))
|
max_iterations = int(os.getenv("KHOJ_OPERATOR_ITERATIONS", 100))
|
||||||
operator_agent: OperatorAgent
|
operator_agent: OperatorAgent
|
||||||
if is_operator_model(reasoning_model.name) == ChatModel.ModelType.OPENAI:
|
if is_operator_model(reasoning_model.name) == ChatModel.ModelType.ANTHROPIC:
|
||||||
operator_agent = OpenAIOperatorAgent(
|
|
||||||
query,
|
|
||||||
reasoning_model,
|
|
||||||
environment_type,
|
|
||||||
max_iterations,
|
|
||||||
max_context,
|
|
||||||
chat_history,
|
|
||||||
previous_trajectory,
|
|
||||||
tracer,
|
|
||||||
)
|
|
||||||
elif is_operator_model(reasoning_model.name) == ChatModel.ModelType.ANTHROPIC:
|
|
||||||
operator_agent = AnthropicOperatorAgent(
|
operator_agent = AnthropicOperatorAgent(
|
||||||
query,
|
query,
|
||||||
reasoning_model,
|
reasoning_model,
|
||||||
@@ -88,7 +77,20 @@ async def operate_environment(
|
|||||||
previous_trajectory,
|
previous_trajectory,
|
||||||
tracer,
|
tracer,
|
||||||
)
|
)
|
||||||
else:
|
# TODO: Remove once OpenAI Operator Agent is useful
|
||||||
|
elif is_operator_model(reasoning_model.name) == ChatModel.ModelType.OPENAI and False:
|
||||||
|
operator_agent = OpenAIOperatorAgent(
|
||||||
|
query,
|
||||||
|
reasoning_model,
|
||||||
|
environment_type,
|
||||||
|
max_iterations,
|
||||||
|
max_context,
|
||||||
|
chat_history,
|
||||||
|
previous_trajectory,
|
||||||
|
tracer,
|
||||||
|
)
|
||||||
|
# TODO: Remove once Binary Operator Agent is useful
|
||||||
|
elif False:
|
||||||
grounding_model_name = "ui-tars-1.5"
|
grounding_model_name = "ui-tars-1.5"
|
||||||
grounding_model = await ConversationAdapters.aget_chat_model_by_name(grounding_model_name)
|
grounding_model = await ConversationAdapters.aget_chat_model_by_name(grounding_model_name)
|
||||||
if (
|
if (
|
||||||
@@ -96,7 +98,7 @@ async def operate_environment(
|
|||||||
or not grounding_model.vision_enabled
|
or not grounding_model.vision_enabled
|
||||||
or not grounding_model.model_type == ChatModel.ModelType.OPENAI
|
or not grounding_model.model_type == ChatModel.ModelType.OPENAI
|
||||||
):
|
):
|
||||||
raise ValueError("No supported visual grounding model for binary operator agent found.")
|
raise ValueError("Binary operator agent needs ui-tars-1.5 served over an OpenAI compatible API.")
|
||||||
operator_agent = BinaryOperatorAgent(
|
operator_agent = BinaryOperatorAgent(
|
||||||
query,
|
query,
|
||||||
reasoning_model,
|
reasoning_model,
|
||||||
@@ -108,6 +110,11 @@ async def operate_environment(
|
|||||||
previous_trajectory,
|
previous_trajectory,
|
||||||
tracer,
|
tracer,
|
||||||
)
|
)
|
||||||
|
else:
|
||||||
|
raise ValueError(
|
||||||
|
f"Unsupported operator model: {reasoning_model.name}. "
|
||||||
|
"Please use a supported operator model. Only Anthropic models are currently supported."
|
||||||
|
)
|
||||||
|
|
||||||
# Initialize Environment
|
# Initialize Environment
|
||||||
if send_status_func:
|
if send_status_func:
|
||||||
|
|||||||
Reference in New Issue
Block a user