Skip to content

Commit bdfc0f1

Browse files
refactor(types): remove quoted annotations under postponed evaluation
1 parent 5a4a191 commit bdfc0f1

5 files changed

Lines changed: 14 additions & 14 deletions

File tree

src/langbot/pkg/box/connector.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def _get_box_config(ap) -> dict:
2525
return config_data.get('box', {})
2626

2727

28-
def resolve_box_ws_relay_url(ap: 'core_app.Application') -> str:
28+
def resolve_box_ws_relay_url(ap: core_app.Application) -> str:
2929
"""Derive the ws relay base URL used for managed-process attach."""
3030
runtime_url = str(_get_box_config(ap).get('runtime_url', '')).strip()
3131
if runtime_url:
@@ -39,7 +39,7 @@ def resolve_box_ws_relay_url(ap: 'core_app.Application') -> str:
3939
class BoxRuntimeConnector:
4040
"""Connect to the Box runtime via action RPC (stdio or ws)."""
4141

42-
def __init__(self, ap: 'core_app.Application'):
42+
def __init__(self, ap: core_app.Application):
4343
self.ap = ap
4444
self.configured_runtime_url = self._load_configured_runtime_url()
4545
self.manages_local_runtime = self._should_manage_local_runtime()

src/langbot/pkg/box/service.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def _is_path_under(path: str, root: str) -> bool:
3939
class BoxService:
4040
def __init__(
4141
self,
42-
ap: 'core_app.Application',
42+
ap: core_app.Application,
4343
client: BoxRuntimeClient | None = None,
4444
output_limit_chars: int = 4000,
4545
):
@@ -77,7 +77,7 @@ def available(self) -> bool:
7777
async def execute_spec_payload(
7878
self,
7979
spec_payload: dict,
80-
query: 'pipeline_query.Query',
80+
query: pipeline_query.Query,
8181
*,
8282
skip_host_mount_validation: bool = False,
8383
) -> dict:
@@ -105,7 +105,7 @@ async def execute_spec_payload(
105105
)
106106
return self._serialize_result(result)
107107

108-
async def execute_sandbox_tool(self, parameters: dict, query: 'pipeline_query.Query') -> dict:
108+
async def execute_sandbox_tool(self, parameters: dict, query: pipeline_query.Query) -> dict:
109109
spec_payload = dict(parameters)
110110
spec_payload.setdefault('session_id', str(query.query_id))
111111
return await self.execute_spec_payload(spec_payload, query)
@@ -365,7 +365,7 @@ def _apply_profile(self, params: dict):
365365

366366
# ── Observability ─────────────────────────────────────────────────
367367

368-
def _record_error(self, exc: Exception, query: 'pipeline_query.Query'):
368+
def _record_error(self, exc: Exception, query: pipeline_query.Query):
369369
self._recent_errors.append(
370370
{
371371
'timestamp': _dt.datetime.now(_UTC).isoformat(),

src/langbot/pkg/provider/runner.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,17 +29,17 @@ class RequestRunner(abc.ABC):
2929

3030
name: str = None
3131

32-
ap: 'app.Application'
32+
ap: app.Application
3333

3434
pipeline_config: dict
3535

36-
def __init__(self, ap: 'app.Application', pipeline_config: dict):
36+
def __init__(self, ap: app.Application, pipeline_config: dict):
3737
self.ap = ap
3838
self.pipeline_config = pipeline_config
3939

4040
@abc.abstractmethod
4141
async def run(
42-
self, query: 'pipeline_query.Query'
43-
) -> typing.AsyncGenerator['provider_message.Message | provider_message.MessageChunk', None]:
42+
self, query: pipeline_query.Query
43+
) -> typing.AsyncGenerator[provider_message.Message | provider_message.MessageChunk, None]:
4444
"""运行请求"""
4545
pass

src/langbot/pkg/provider/tools/loader.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ class ToolLoader(abc.ABC):
3030

3131
name: str = None
3232

33-
ap: 'app.Application'
33+
ap: app.Application
3434

35-
def __init__(self, ap: 'app.Application'):
35+
def __init__(self, ap: app.Application):
3636
self.ap = ap
3737

3838
async def initialize(self):

src/langbot/pkg/provider/tools/toolmgr.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@
1818
class ToolManager:
1919
"""LLM工具管理器"""
2020

21-
ap: 'app.Application'
21+
ap: app.Application
2222

2323
native_tool_loader: native_loader.NativeToolLoader
2424
plugin_tool_loader: plugin_loader.PluginToolLoader
2525
mcp_tool_loader: mcp_loader.MCPLoader
2626

27-
def __init__(self, ap: 'app.Application'):
27+
def __init__(self, ap: app.Application):
2828
self.ap = ap
2929

3030
async def initialize(self):

0 commit comments

Comments
 (0)