Skip to content

Commit

Permalink
Clean up global in llm.py (we figured it's not needed) (#6675)
Browse files Browse the repository at this point in the history
  • Loading branch information
enyst authored Feb 10, 2025
1 parent 4615548 commit 1a715d2
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 20 deletions.
1 change: 0 additions & 1 deletion openhands/agenthub/codeact_agent/codeact_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,6 @@ def get_observation_message(
and len(obs.set_of_marks) > 0
and self.config.enable_som_visual_browsing
and 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(
Expand Down
19 changes: 0 additions & 19 deletions openhands/llm/llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,16 +75,6 @@
'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',
Expand Down Expand Up @@ -495,15 +485,6 @@ def is_function_calling_active(self) -> bool:
"""
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.
Expand Down

0 comments on commit 1a715d2

Please sign in to comment.