openhands-tools 1.7.2__py3-none-any.whl → 1.7.4__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- openhands/tools/preset/__init__.py +2 -0
- openhands/tools/preset/gemini.py +2 -1
- openhands/tools/preset/gpt5.py +75 -0
- {openhands_tools-1.7.2.dist-info → openhands_tools-1.7.4.dist-info}/METADATA +2 -2
- {openhands_tools-1.7.2.dist-info → openhands_tools-1.7.4.dist-info}/RECORD +7 -6
- {openhands_tools-1.7.2.dist-info → openhands_tools-1.7.4.dist-info}/WHEEL +0 -0
- {openhands_tools-1.7.2.dist-info → openhands_tools-1.7.4.dist-info}/top_level.txt +0 -0
|
@@ -20,6 +20,7 @@ Notes:
|
|
|
20
20
|
|
|
21
21
|
from .default import get_default_agent
|
|
22
22
|
from .gemini import get_gemini_agent, get_gemini_tools
|
|
23
|
+
from .gpt5 import get_gpt5_agent
|
|
23
24
|
from .planning import get_planning_agent
|
|
24
25
|
|
|
25
26
|
|
|
@@ -27,5 +28,6 @@ __all__ = [
|
|
|
27
28
|
"get_default_agent",
|
|
28
29
|
"get_gemini_agent",
|
|
29
30
|
"get_gemini_tools",
|
|
31
|
+
"get_gpt5_agent",
|
|
30
32
|
"get_planning_agent",
|
|
31
33
|
]
|
openhands/tools/preset/gemini.py
CHANGED
|
@@ -88,7 +88,8 @@ def get_gemini_agent(
|
|
|
88
88
|
llm: LLM,
|
|
89
89
|
cli_mode: bool = False,
|
|
90
90
|
) -> Agent:
|
|
91
|
-
"""Get an agent
|
|
91
|
+
"""Get an agent with gemini-style tools: read_file, write_file, edit,
|
|
92
|
+
list_directory."""
|
|
92
93
|
tools = get_gemini_tools(
|
|
93
94
|
enable_browser=not cli_mode,
|
|
94
95
|
)
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"""GPT-5 preset configuration for OpenHands agents.
|
|
2
|
+
|
|
3
|
+
This preset uses ApplyPatchTool for file edits instead of the default
|
|
4
|
+
claude-style FileEditorTool. It mirrors the Gemini preset pattern by
|
|
5
|
+
providing optional helpers without changing global defaults.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
from openhands.sdk import Agent
|
|
9
|
+
from openhands.sdk.context.condenser import LLMSummarizingCondenser
|
|
10
|
+
from openhands.sdk.context.condenser.base import CondenserBase
|
|
11
|
+
from openhands.sdk.llm.llm import LLM
|
|
12
|
+
from openhands.sdk.logger import get_logger
|
|
13
|
+
from openhands.sdk.tool import Tool
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
logger = get_logger(__name__)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def register_gpt5_tools(enable_browser: bool = True) -> None:
|
|
20
|
+
"""Register the GPT-5 tool set (terminal, apply_patch, task_tracker, browser)."""
|
|
21
|
+
from openhands.tools.apply_patch import ApplyPatchTool
|
|
22
|
+
from openhands.tools.task_tracker import TaskTrackerTool
|
|
23
|
+
from openhands.tools.terminal import TerminalTool
|
|
24
|
+
|
|
25
|
+
logger.debug(f"Tool: {TerminalTool.name} registered.")
|
|
26
|
+
logger.debug(f"Tool: {ApplyPatchTool.name} registered.")
|
|
27
|
+
logger.debug(f"Tool: {TaskTrackerTool.name} registered.")
|
|
28
|
+
|
|
29
|
+
if enable_browser:
|
|
30
|
+
from openhands.tools.browser_use import BrowserToolSet
|
|
31
|
+
|
|
32
|
+
logger.debug(f"Tool: {BrowserToolSet.name} registered.")
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
def get_gpt5_tools(enable_browser: bool = True) -> list[Tool]:
|
|
36
|
+
"""Get the GPT-5 tool specifications using ApplyPatchTool for edits.
|
|
37
|
+
|
|
38
|
+
Args:
|
|
39
|
+
enable_browser: Whether to include browser tools.
|
|
40
|
+
"""
|
|
41
|
+
register_gpt5_tools(enable_browser=enable_browser)
|
|
42
|
+
|
|
43
|
+
from openhands.tools.apply_patch import ApplyPatchTool
|
|
44
|
+
from openhands.tools.task_tracker import TaskTrackerTool
|
|
45
|
+
from openhands.tools.terminal import TerminalTool
|
|
46
|
+
|
|
47
|
+
tools: list[Tool] = [
|
|
48
|
+
Tool(name=TerminalTool.name),
|
|
49
|
+
Tool(name=ApplyPatchTool.name),
|
|
50
|
+
Tool(name=TaskTrackerTool.name),
|
|
51
|
+
]
|
|
52
|
+
if enable_browser:
|
|
53
|
+
from openhands.tools.browser_use import BrowserToolSet
|
|
54
|
+
|
|
55
|
+
tools.append(Tool(name=BrowserToolSet.name))
|
|
56
|
+
return tools
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
def get_gpt5_condenser(llm: LLM) -> CondenserBase:
|
|
60
|
+
"""Get the default condenser for the GPT-5 preset."""
|
|
61
|
+
return LLMSummarizingCondenser(llm=llm, max_size=80, keep_first=4)
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
def get_gpt5_agent(llm: LLM, cli_mode: bool = False) -> Agent:
|
|
65
|
+
"""Get an agent with ApplyPatchTool for unified-diff style file editing."""
|
|
66
|
+
tools = get_gpt5_tools(enable_browser=not cli_mode)
|
|
67
|
+
agent = Agent(
|
|
68
|
+
llm=llm,
|
|
69
|
+
tools=tools,
|
|
70
|
+
system_prompt_kwargs={"cli_mode": cli_mode},
|
|
71
|
+
condenser=get_gpt5_condenser(
|
|
72
|
+
llm=llm.model_copy(update={"usage_id": "condenser"})
|
|
73
|
+
),
|
|
74
|
+
)
|
|
75
|
+
return agent
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: openhands-tools
|
|
3
|
-
Version: 1.7.
|
|
3
|
+
Version: 1.7.4
|
|
4
4
|
Summary: OpenHands Tools - Runtime tools for AI agents
|
|
5
5
|
Requires-Python: >=3.12
|
|
6
6
|
Requires-Dist: openhands-sdk
|
|
7
7
|
Requires-Dist: bashlex>=0.18
|
|
8
8
|
Requires-Dist: binaryornot>=0.4.4
|
|
9
9
|
Requires-Dist: cachetools
|
|
10
|
-
Requires-Dist: libtmux>=0.
|
|
10
|
+
Requires-Dist: libtmux>=0.53.0
|
|
11
11
|
Requires-Dist: pydantic>=2.11.7
|
|
12
12
|
Requires-Dist: browser-use>=0.8.0
|
|
13
13
|
Requires-Dist: func-timeout>=4.3.5
|
|
@@ -50,9 +50,10 @@ openhands/tools/grep/impl.py,sha256=Krbnygmqpv0iKI7HsfzIukOLoCweRg1JNCXv14d7WC8,
|
|
|
50
50
|
openhands/tools/planning_file_editor/__init__.py,sha256=edIuvR5ZnEXXsYfRt8xbrq15Z6vtdUq4AMguuuk1grI,197
|
|
51
51
|
openhands/tools/planning_file_editor/definition.py,sha256=7wzE1qXoengRq80MjDI-XbWhbPVYLU1lThFO9Mq14wg,3927
|
|
52
52
|
openhands/tools/planning_file_editor/impl.py,sha256=W8Mdy7Qjbz90iKSmisw23-TcFtXwe7Vk373WvrScCS8,2218
|
|
53
|
-
openhands/tools/preset/__init__.py,sha256=
|
|
53
|
+
openhands/tools/preset/__init__.py,sha256=KougtVUTSj9D6AjR78EXmYRdITY6ZIaodCQuWfViXc0,913
|
|
54
54
|
openhands/tools/preset/default.py,sha256=r6lAqHD-4ntjiOSfNvSxuAJtJqqTTik_mBIFZOE1w7Q,2686
|
|
55
|
-
openhands/tools/preset/gemini.py,sha256=
|
|
55
|
+
openhands/tools/preset/gemini.py,sha256=FG3BcJjnm6tDLIjg6EiDFTksx5lVVBInh_Jpza0mHpU,3136
|
|
56
|
+
openhands/tools/preset/gpt5.py,sha256=44LOv6MncP9X9QU7pn1UfdjYl8ec8zKU9jUU7tUYR5I,2615
|
|
56
57
|
openhands/tools/preset/planning.py,sha256=s05upBJ97JEZOfUJMkBW3xa5ZKgxZFklY1yHEBzqmhQ,5303
|
|
57
58
|
openhands/tools/task_tracker/__init__.py,sha256=NVm3CE_CkIAUSjFexh7HLXMpibJ_Dh8J8OOow2SlE1I,302
|
|
58
59
|
openhands/tools/task_tracker/definition.py,sha256=yGN_wks_-QpjRlfYiv5uOYyRTshaFuBwog0P62m5x0w,15772
|
|
@@ -73,7 +74,7 @@ openhands/tools/tom_consult/definition.py,sha256=MTdOCOJaEGgOXhlJ9-x0HdhD6JiKNT2
|
|
|
73
74
|
openhands/tools/tom_consult/executor.py,sha256=LkWeltj-7ZgLhVZKZP4cuhxqg2YuyRnqSz5S0U9WElk,16656
|
|
74
75
|
openhands/tools/utils/__init__.py,sha256=AgJX59QLQTulZqIvJnUqM7LxAgsFhtqmgol-lKLc7Wc,1253
|
|
75
76
|
openhands/tools/utils/timeout.py,sha256=AjKNLZa8NqQ0HllZzqWZwZMj-8PEWHHBXwOlMjTygpA,399
|
|
76
|
-
openhands_tools-1.7.
|
|
77
|
-
openhands_tools-1.7.
|
|
78
|
-
openhands_tools-1.7.
|
|
79
|
-
openhands_tools-1.7.
|
|
77
|
+
openhands_tools-1.7.4.dist-info/METADATA,sha256=1y214T0Ox84aaFO6T02a__TN9w3PyM3yLT2wX41urDY,418
|
|
78
|
+
openhands_tools-1.7.4.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
79
|
+
openhands_tools-1.7.4.dist-info/top_level.txt,sha256=jHgVu9I0Blam8BXFgedoGKfglPF8XvW1TsJFIjcgP4E,10
|
|
80
|
+
openhands_tools-1.7.4.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|