Is this expected/normal, trying to run examples/05...
# proj-sdk
c
Is this expected/normal, trying to run examples/05 @quick-window-91705 It seems like the required ID change, or is there something I’m doing wrong?
Copy code
(responses) ➜  responses git:(openhands/support-responses-api) ✗ python examples/05_use_llm_registry.py
[09/25/25 215616] INFO [LLM registry llm_registry.py:81 5aba11c1-f596-47f7-a1a6-88e94a5cbd2b]: Added LLM for service primary-llm Traceback (most recent call last): File "/Users/enyst/repos/agent-sdk/.worktrees/responses/examples/05_use_llm_registry.py", line 39, in <module> llm = llm_registry.get("main_agent") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/enyst/repos/agent-sdk/.worktrees/responses/openhands/sdk/llm/llm_registry.py", line 98, in get raise KeyError( KeyError: "Service ID 'main_agent' not found in registry. Use add() to register an LLM first."
👀 1
q
oh this is expected, the example is broken 😬 the llm was registered with
primary-llm
and later was attempted to be retrieved with
main_agent
@nutritious-balloon-65098 please look at example 5 under examples/ and make sure that the
service_id
for adding and getting llms match then look at all the example files and make sure that LLMs
service-id
have good naming conventions agent related llms should be registered with ID
agent
and condenser llm should be registered with ID
condenser
, etc
n
I'm on it! Rohit Malhotra can track my progress here.
Summary I have successfully standardized the LLM service_id naming conventions across all agent-sdk examples. Here's what was accomplished: ✅ Request Completion Checklist: 1. Fixed example 5 service_id mismatch - Changed "primary-llm" registration to "agent" and "main_agent" retrieval to "agent" 2. Standardized agent-related LLMs - Changed all "main-llm" and "hello-world-llm" service IDs to "agent" across 21 example files 3. Preserved condenser LLMs - Kept existing "condenser" service IDs (already correct) 4. Maintained good naming conventions - Kept specialized service IDs like "security-analyzer", "vision-llm", "multimodal-router" 📋 Changes Made: • 21 files updated with consistent service_id naming • Example 5: Fixed the core issue where LLM was registered as "primary-llm" but retrieved as "main_agent" • 18 files: Changed "main-llm" → "agent" • 1 file: Changed "hello-world-llm" → "agent" • Routing example: Updated to "agent-primary" and "agent-secondary" for clarity • Demo LLM: Changed to "demo-secondary" for better descriptiveness 🎯 Final Naming Convention: • Agent LLMs:
"agent"
service_id • Condenser LLMs:
"condenser"
service_id • Specialized LLMs: Descriptive names (e.g.,
"security-analyzer"
,
"vision-llm"
) • Multi-purpose examples: Descriptive prefixes (e.g.,
"agent-primary"
,
"demo-secondary"
) ✅ Verification: • All pre-commit hooks pass (formatting, linting, type checking) • Example 5 now works correctly (tested up to API key requirement) • Changes are minimal and focused only on service_id standardization The examples now have consistent, intuitive service_id naming that follows the requested conventions, making the codebase more maintainable and easier to understand. Would you like me to: 1. Push these changes to a new branch and create a pull request? 2. Keep the changes local for now? 3. Follow any other specific Git workflow you prefer? <sub>View full conversation</sub>
q
@nutritious-balloon-65098 push your changes and open a draft PR make sure to write a concise PR description which explains the fix to the example file + followup changes for naming conventions
thanks on a stick 1
n
I'm on it! Rohit Malhotra can continue tracking my progress here.
Final Summary I have successfully completed the requested work to fix LLM service_id naming inconsistencies in the agent-sdk examples. ✅ Request Completion Checklist: 1. Fixed example 5 service_id mismatch - ✅ Resolved KeyError by changing "primary-llm" registration and "main_agent" retrieval to consistent "agent" 2. Standardized agent LLM naming - ✅ Changed all "main-llm" and "hello-world-llm" to "agent" across 21 files 3. Preserved condenser LLM naming - ✅ Kept existing "condenser" service_ids (already correct) 4. Maintained good naming conventions - ✅ Kept specialized names like "security-analyzer", "vision-llm" 5. Created PR - ✅ Pushed to
fix/standardize-llm-service-ids
branch and opened draft PR #499 🎯 Final State: • 21 example files now use consistent service_id naming • Agent LLMs:
"agent"
service_id • Condenser LLMs:
"condenser"
service_id • Specialized LLMs: Descriptive names maintained • All pre-commit checks pass • Example 5 now works correctly (no more KeyError) Pull Request: https://github.com/All-Hands-AI/agent-sdk/pull/499 The changes are minimal, focused, and directly address the reported issue while establishing consistent naming conventions across the entire examples directory. <sub>View full conversation</sub>