refactor(types): remove quoted annotations under postponed evaluation

This commit is contained in:
youhuanghe
2026-03-24 05:07:14 +00:00
committed by WangCham
parent 2911220054
commit 3f368c5764
5 changed files with 14 additions and 14 deletions

View File

@@ -25,7 +25,7 @@ def _get_box_config(ap) -> dict:
return config_data.get('box', {})
def resolve_box_ws_relay_url(ap: 'core_app.Application') -> str:
def resolve_box_ws_relay_url(ap: core_app.Application) -> str:
"""Derive the ws relay base URL used for managed-process attach."""
runtime_url = str(_get_box_config(ap).get('runtime_url', '')).strip()
if runtime_url:
@@ -39,7 +39,7 @@ def resolve_box_ws_relay_url(ap: 'core_app.Application') -> str:
class BoxRuntimeConnector:
"""Connect to the Box runtime via action RPC (stdio or ws)."""
def __init__(self, ap: 'core_app.Application'):
def __init__(self, ap: core_app.Application):
self.ap = ap
self.configured_runtime_url = self._load_configured_runtime_url()
self.manages_local_runtime = self._should_manage_local_runtime()

View File

@@ -39,7 +39,7 @@ if TYPE_CHECKING:
class BoxService:
def __init__(
self,
ap: 'core_app.Application',
ap: core_app.Application,
client: BoxRuntimeClient | None = None,
output_limit_chars: int = 4000,
):
@@ -77,7 +77,7 @@ class BoxService:
async def execute_spec_payload(
self,
spec_payload: dict,
query: 'pipeline_query.Query',
query: pipeline_query.Query,
*,
skip_host_mount_validation: bool = False,
) -> dict:
@@ -105,7 +105,7 @@ class BoxService:
)
return self._serialize_result(result)
async def execute_sandbox_tool(self, parameters: dict, query: 'pipeline_query.Query') -> dict:
async def execute_sandbox_tool(self, parameters: dict, query: pipeline_query.Query) -> dict:
spec_payload = dict(parameters)
spec_payload.setdefault('session_id', str(query.query_id))
return await self.execute_spec_payload(spec_payload, query)
@@ -365,7 +365,7 @@ class BoxService:
# ── Observability ─────────────────────────────────────────────────
def _record_error(self, exc: Exception, query: 'pipeline_query.Query'):
def _record_error(self, exc: Exception, query: pipeline_query.Query):
self._recent_errors.append(
{
'timestamp': _dt.datetime.now(_UTC).isoformat(),

View File

@@ -29,17 +29,17 @@ class RequestRunner(abc.ABC):
name: str = None
ap: 'app.Application'
ap: app.Application
pipeline_config: dict
def __init__(self, ap: 'app.Application', pipeline_config: dict):
def __init__(self, ap: app.Application, pipeline_config: dict):
self.ap = ap
self.pipeline_config = pipeline_config
@abc.abstractmethod
async def run(
self, query: 'pipeline_query.Query'
) -> typing.AsyncGenerator['provider_message.Message | provider_message.MessageChunk', None]:
self, query: pipeline_query.Query
) -> typing.AsyncGenerator[provider_message.Message | provider_message.MessageChunk, None]:
"""运行请求"""
pass

View File

@@ -30,9 +30,9 @@ class ToolLoader(abc.ABC):
name: str = None
ap: 'app.Application'
ap: app.Application
def __init__(self, ap: 'app.Application'):
def __init__(self, ap: app.Application):
self.ap = ap
async def initialize(self):

View File

@@ -18,13 +18,13 @@ importutil.import_modules_in_pkg(loaders)
class ToolManager:
"""LLM工具管理器"""
ap: 'app.Application'
ap: app.Application
native_tool_loader: native_loader.NativeToolLoader
plugin_tool_loader: plugin_loader.PluginToolLoader
mcp_tool_loader: mcp_loader.MCPLoader
def __init__(self, ap: 'app.Application'):
def __init__(self, ap: app.Application):
self.ap = ap
async def initialize(self):