-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathopenhands_gen.py
More file actions
28 lines (22 loc) · 1.01 KB
/
openhands_gen.py
File metadata and controls
28 lines (22 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import os
from openhands.sdk import LLM, Agent, Conversation, Tool
from openhands.tools.file_editor import FileEditorTool
from openhands.tools.task_tracker import TaskTrackerTool
from openhands.tools.terminal import TerminalTool
llm = LLM(
model="openhands/gpt-5-2025-08-07",
api_key=os.getenv("LLM_API_KEY"),
)
agent = Agent(
llm=llm,
tools=[
Tool(name=TerminalTool.name),
Tool(name=FileEditorTool.name),
Tool(name=TaskTrackerTool.name),
],
)
cwd = os.getcwd()
conversation = Conversation(agent=agent, workspace=cwd)
conversation.send_message("Hi, i wrote a framework called vortex that can enable an abstraction on implementation of sparse attention in sglang, which was very hard to do earlier. Could you based on the example file in this directory: vortex_torch/flow/algorithms.py, propose a better algorithm of dynamic sparse attention? Then, add your algorithm registered name in vortex_torch/examples/verify_algo.sh as the first one.")
conversation.run()
print("All done!")