MCPcopy
hub / github.com/zai-org/Open-AutoGLM / __init__

Method __init__

phone_agent/agent.py:64–82  ·  view source on GitHub ↗
(
        self,
        model_config: ModelConfig | None = None,
        agent_config: AgentConfig | None = None,
        confirmation_callback: Callable[[str], bool] | None = None,
        takeover_callback: Callable[[str], None] | None = None,
    )

Source from the content-addressed store, hash-verified

62 """
63
64 def __init__(
65 self,
66 model_config: ModelConfig | None = None,
67 agent_config: AgentConfig | None = None,
68 confirmation_callback: Callable[[str], bool] | None = None,
69 takeover_callback: Callable[[str], None] | None = None,
70 ):
71 self.model_config = model_config or ModelConfig()
72 self.agent_config = agent_config or AgentConfig()
73
74 self.model_client = ModelClient(self.model_config)
75 self.action_handler = ActionHandler(
76 device_id=self.agent_config.device_id,
77 confirmation_callback=confirmation_callback,
78 takeover_callback=takeover_callback,
79 )
80
81 self._context: list[dict[str, Any]] = []
82 self._step_count = 0
83
84 def run(self, task: str) -> str:
85 """

Callers

nothing calls this directly

Calls 4

ModelConfigClass · 0.90
ModelClientClass · 0.90
ActionHandlerClass · 0.90
AgentConfigClass · 0.85

Tested by

no test coverage detected