Skip to content

Commit fc95bbb

Browse files
committed
update with an LLM class
1 parent 51e31ba commit fc95bbb

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

openhands-sdk/openhands/sdk/subagent/registry.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ def create_security_expert(llm):
2828
from threading import RLock
2929
from typing import TYPE_CHECKING, NamedTuple
3030

31+
from pydantic import SecretStr
32+
3133
from openhands.sdk.logger import get_logger
3234
from openhands.sdk.subagent.load import (
3335
load_project_agents,
@@ -60,18 +62,18 @@ def _definition_from_factory(
6062
factory_func: Callable[["LLM"], "Agent"],
6163
description: str,
6264
) -> AgentDefinition:
63-
"""Introspect *factory_func* with a TestLLM to build a full AgentDefinition.
65+
"""Introspect *factory_func* with a dummy LLM to build a full AgentDefinition.
6466
6567
This lets register_agent() accept just (name, factory_func, description)
6668
while still producing a complete definition (tools, system_prompt, model)
6769
that can be forwarded to a remote server. Falls back to a minimal
6870
definition if the factory raises.
6971
"""
70-
_model_placeholder = "test-model"
72+
_model_placeholder = "__introspect__"
7173
try:
72-
from openhands.sdk.testing import TestLLM
74+
from openhands.sdk.llm.llm import LLM as _LLM
7375

74-
agent = factory_func(TestLLM(model=_model_placeholder))
76+
agent = factory_func(_LLM(model=_model_placeholder, api_key=SecretStr("n/a")))
7577
tools = [t.name for t in agent.tools]
7678
system_prompt = ""
7779
if agent.agent_context and agent.agent_context.system_message_suffix:

0 commit comments

Comments
 (0)