wooden-umbrella-84098
09/29/2025, 6:54 PMimport os
from openhands.sdk import (
LLM,
Agent,
Conversation,
)
from openhands.tools.preset.default import get_default_tools
llm = LLM(
model="anthropic/claude-sonnet-4-20250514",
api_key=os.getenv("ANTROPIC_API_KEY"),
)
tools = get_default_tools(working_dir=os.getcwd())
agent = Agent(llm=llm, tools=tools)
conversation = Conversation(agent=agent)
conversation.send_message(
"Write hello_world.py, then run it."
)
conversation.run()
print(conversation.state.message[-1])
I think this works today?calm-artist-7206
09/29/2025, 6:57 PMservice_id mandatory for LLM. It's a bit strange thing, the code just went that way, but my guess is that we will need to change something and maybe it won't bewooden-umbrella-84098
09/29/2025, 7:02 PMwooden-umbrella-84098
09/29/2025, 7:02 PMcalm-artist-7206
09/29/2025, 7:14 PMwooden-umbrella-84098
09/29/2025, 7:15 PM