Show operator context when use operator in default and research mode

This commit is contained in:
Debanjum
2025-05-17 17:47:39 -07:00
parent cc355f93fc
commit 0ce74e0329

View File

@@ -189,6 +189,9 @@ def construct_tool_chat_history(
ConversationCommand.Code: (
lambda iteration: list(iteration.codeContext.keys()) if iteration.codeContext else []
),
ConversationCommand.Operator: (
lambda iteration: list(iteration.operatorContext.keys()) if iteration.operatorContext else []
),
}
for iteration in previous_iterations:
# If a tool is provided use the inferred query extractor for that tool if available
@@ -451,6 +454,11 @@ def generate_chatml_messages_with_context(
if not is_none_or_empty(chat.get("codeContext")):
message_context += f"{prompts.code_executed_context.format(online_results=chat.get('codeContext'))}"
if not is_none_or_empty(chat.get("operatorContext")):
message_context += (
f"{prompts.operator_execution_context.format(operator_results=chat.get('operatorContext'))}"
)
if not is_none_or_empty(message_context):
reconstructed_context_message = ChatMessage(content=message_context, role="user")
chatml_messages.insert(0, reconstructed_context_message)