71 lines
1.6 KiB
Python
71 lines
1.6 KiB
Python
"""RuntimeState protocol: agent loop state exposed to MyTool."""
|
|
|
|
from typing import Any, Protocol
|
|
|
|
|
|
class RuntimeState(Protocol):
|
|
"""Minimum contract that MyTool requires from its runtime state provider.
|
|
|
|
In practice, this is always satisfied by ``AgentLoop``. MyTool also
|
|
accesses arbitrary attributes dynamically (via ``getattr`` / ``setattr``)
|
|
for dot-path inspection and modification; those paths are validated at
|
|
runtime rather than by this protocol.
|
|
"""
|
|
|
|
@property
|
|
def model(self) -> str: ...
|
|
|
|
@property
|
|
def max_iterations(self) -> int: ...
|
|
|
|
@property
|
|
def current_iteration(self) -> int: ...
|
|
|
|
@property
|
|
def tool_names(self) -> list[str]: ...
|
|
|
|
@property
|
|
def workspace(self) -> str: ...
|
|
|
|
@property
|
|
def provider_retry_mode(self) -> str: ...
|
|
|
|
@property
|
|
def max_tool_result_chars(self) -> int: ...
|
|
|
|
@property
|
|
def context_window_tokens(self) -> int: ...
|
|
|
|
@property
|
|
def web_config(self) -> Any: ...
|
|
|
|
@property
|
|
def exec_config(self) -> Any: ...
|
|
|
|
@property
|
|
def workspace_sandbox(self) -> Any: ...
|
|
|
|
@property
|
|
def subagents(self) -> Any: ...
|
|
|
|
@property
|
|
def _runtime_vars(self) -> dict[str, Any]: ...
|
|
|
|
@property
|
|
def _last_usage(self) -> Any: ...
|
|
|
|
def _sync_subagent_runtime_limits(self) -> None: ...
|
|
|
|
def set_runtime_model(self, model: str) -> Any: ...
|
|
|
|
def set_runtime_context_window(self, context_window_tokens: int) -> Any: ...
|
|
|
|
def set_session_model_preset(
|
|
self,
|
|
session_key: str,
|
|
name: str,
|
|
) -> Any: ...
|
|
|
|
@property
|
|
def model_preset(self) -> str | None: ...
|