Update Anthropic and Gemini to allow overriding run_llm

This commit is contained in:
Mark Backman
2025-01-11 16:16:53 -05:00
parent 0852570212
commit f1947d7d38
2 changed files with 14 additions and 2 deletions

View File

@@ -775,7 +775,14 @@ class AnthropicAssistantContextAggregator(LLMAssistantContextAggregator):
],
}
)
run_llm = True
if frame.override_run_llm:
# Explicit override
print("Explicit override")
run_llm = frame.run_llm
else:
# Default behavior
print("Default behavior")
run_llm = True
elif aggregation:
self._context.add_message({"role": "assistant", "content": aggregation})

View File

@@ -282,7 +282,12 @@ class GoogleAssistantContextAggregator(OpenAIAssistantContextAggregator):
],
)
)
run_llm = not bool(self._function_calls_in_progress)
if frame.override_run_llm:
# Explicit override
run_llm = frame.run_llm
else:
# Default behavior
run_llm = not bool(self._function_calls_in_progress)
else:
if aggregation.strip():
self._context.add_message(