Files
browser-use__browser-use/tests/ci/test_agent_output_model_cache.py
2026-05-31 02:49:32 -07:00

16 lines
787 B
Python

from browser_use.agent.views import AgentOutput
from browser_use.tools.service import Tools
def test_agent_output_dynamic_models_are_cached_per_action_model_and_mode() -> None:
action_model = Tools().registry.create_action_model()
thinking_model = AgentOutput.type_with_custom_actions(action_model)
no_thinking_model = AgentOutput.type_with_custom_actions_no_thinking(action_model)
flash_model = AgentOutput.type_with_custom_actions_flash_mode(action_model)
assert AgentOutput.type_with_custom_actions(action_model) is thinking_model
assert AgentOutput.type_with_custom_actions_no_thinking(action_model) is no_thinking_model
assert AgentOutput.type_with_custom_actions_flash_mode(action_model) is flash_model
assert len({thinking_model, no_thinking_model, flash_model}) == 3