mirror of
https://github.com/hansjone/oclaw.git
synced 2026-10-14 06:43:16 +08:00
初始化:独立 oclaw 仓库首提交
- 在 oclaw/ 下重新初始化 Git 仓库 - 补齐子仓库 .gitignore,避免提交本地运行态数据(_local、node_modules、logs 等) - 提交当前工程代码与配置 Made-with: Cursor
This commit is contained in:
commit
ba3836f00f
579 changed files with 83112 additions and 0 deletions
27
tests/test_prompt_runtime_paths.py
Normal file
27
tests/test_prompt_runtime_paths.py
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from oclaw.openclaw_runtime.memory_stage import render_memory_context_block
|
||||
from oclaw.openclaw_runtime.types import OpenClawMemoryContext
|
||||
from oclaw.prompts.loader import render_openclaw_prompt
|
||||
|
||||
|
||||
def test_router_prompt_renders() -> None:
|
||||
txt = render_openclaw_prompt(
|
||||
"router/decide_route.md",
|
||||
variables={"user_text": "hi", "has_attachments": "no"},
|
||||
strict=True,
|
||||
)
|
||||
assert "json" in txt.lower()
|
||||
assert "sync_direct" in txt
|
||||
assert "async_task" in txt
|
||||
|
||||
|
||||
def test_memory_context_markdown_block() -> None:
|
||||
ctx = OpenClawMemoryContext(
|
||||
short_term=("用户想排查网络问题",),
|
||||
semantic_hits=({"content": "上次 DNS 配置异常", "score": 0.91},),
|
||||
)
|
||||
out = render_memory_context_block(ctx)
|
||||
assert "[short_term_digest]" in out
|
||||
assert "[semantic_memory_hits]" in out
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue