π OpenHands: AI-Driven Development
Clean up global in llm.py (we figured it's not needed) (#6675)
Engel Nyst1a715d2ec4c5
diff --git a/openhands/agenthub/codeact_agent/codeact_agent.py b/openhands/agenthub/codeact_agent/codeact_agent.pyindex 62ad243e91..5a1f6d54a8 100644--- a/openhands/agenthub/codeact_agent/codeact_agent.py+++ b/openhands/agenthub/codeact_agent/codeact_agent.py@@ -303,7 +303,6 @@ class CodeActAgent(Agent):and len(obs.set_of_marks) > 0and self.config.enable_som_visual_browsingand self.llm.vision_is_active()- and self.llm.is_visual_browser_tool_supported()):text += 'Image: Current webpage screenshot (Note that only visible portion of webpage is present in the screenshot. You may need to scroll to view the remaining portion of the web-page.)\n'message = Message(diff --git a/openhands/llm/llm.py b/openhands/llm/llm.pyindex ff3c62772b..e8dd2f6f1e 100644--- a/openhands/llm/llm.py+++ b/openhands/llm/llm.py@@ -75,16 +75,6 @@ FUNCTION_CALLING_SUPPORTED_MODELS = ['o3-mini',]-# visual browsing tool supported models-# This flag is needed since gpt-4o and gpt-4o-mini do not allow passing image_urls with role='tool'-VISUAL_BROWSING_TOOL_SUPPORTED_MODELS = [- 'claude-3-5-sonnet',- 'claude-3-5-sonnet-20240620',- 'claude-3-5-sonnet-20241022',- 'o1-2024-12-17',-]--REASONING_EFFORT_SUPPORTED_MODELS = ['o1-2024-12-17','o1',@@ -495,15 +485,6 @@ class LLM(RetryMixin, DebugMixin):"""return self._function_calling_active- def is_visual_browser_tool_supported(self) -> bool:- return (- self.config.model in VISUAL_BROWSING_TOOL_SUPPORTED_MODELS- or self.config.model.split('/')[-1] in VISUAL_BROWSING_TOOL_SUPPORTED_MODELS- or any(- m in self.config.model for m in VISUAL_BROWSING_TOOL_SUPPORTED_MODELS- )- )-def _post_completion(self, response: ModelResponse) -> float:"""Post-process the completion response.