mirror of
https://github.com/hansjone/oclaw.git
synced 2026-10-10 14:30:45 +08:00
实现附件处理链路的统一引用化与可检索增强,避免大文件/多模态内容直接撑爆上下文并提升工具可用性。
本次补齐 text/image/video/archive 的标准化处理、会话级工具守卫、回放压缩、配置与文档对齐,并修复表格与流式输出相关体验问题。 Made-with: Cursor
This commit is contained in:
parent
9d2900db02
commit
37a2ef35f4
27 changed files with 3227 additions and 278 deletions
|
|
@ -0,0 +1,30 @@
|
|||
from __future__ import annotations
|
||||
|
||||
import importlib.util
|
||||
import sysconfig
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
def _load_stdlib_platform() -> object | None:
|
||||
stdlib_dir = Path(sysconfig.get_paths().get("stdlib") or "")
|
||||
platform_py = (stdlib_dir / "platform.py").resolve()
|
||||
if not platform_py.exists():
|
||||
return None
|
||||
spec = importlib.util.spec_from_file_location("_stdlib_platform", str(platform_py))
|
||||
if spec is None or spec.loader is None:
|
||||
return None
|
||||
module = importlib.util.module_from_spec(spec)
|
||||
spec.loader.exec_module(module)
|
||||
return module
|
||||
|
||||
|
||||
_stdlib = _load_stdlib_platform()
|
||||
if _stdlib is not None:
|
||||
for _name in dir(_stdlib):
|
||||
if _name in {"__name__", "__package__", "__loader__", "__spec__", "__file__", "__cached__"}:
|
||||
continue
|
||||
globals()[_name] = getattr(_stdlib, _name)
|
||||
__all__ = list(getattr(_stdlib, "__all__", []))
|
||||
else:
|
||||
__all__ = []
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue