Skip to content

Commit dfa6594

Browse files
committed
fix(examples): use environment variables for LLM config in hello world
Allow hello world example to use the same LLM_API_KEY and LLM_BASE_URL environment variables as other examples, enabling consistent configuration across all examples. Changes: - Use os.getenv() for model with default 'openhands/claude-sonnet-4-5-20250929' - Add base_url parameter from LLM_BASE_URL environment variable - Add usage_id for better tracking - Add comments about API key configuration
1 parent a612c0a commit dfa6594

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

examples/01_standalone_sdk/01_hello_world.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,16 @@
66
from openhands.tools.terminal import TerminalTool
77

88

9+
# Credits for Claude Sonnet 4.5 model are available at
10+
# https://app.all-hands.dev/settings/api-keys
11+
# For Anthropic or others use LiteLLM model names, e.g.
12+
# LLM_MODEL="anthropic/claude-sonnet-4-5-20250929"
13+
914
llm = LLM(
10-
model="anthropic/claude-sonnet-4-5-20250929",
15+
model=os.getenv("LLM_MODEL", "openhands/claude-sonnet-4-5-20250929"),
1116
api_key=os.getenv("LLM_API_KEY"),
17+
usage_id="hello-world",
18+
base_url=os.getenv("LLM_BASE_URL"),
1219
)
1320

1421
agent = Agent(

0 commit comments

Comments
 (0)