docs(comments): 注释中文化 · internal/runtime/memory(31 文件,纯替换)
- 只翻注释/文档字符串:820 增 / 820 删 严格 1:1;剥掉整行注释与行尾注释尾巴后, 逐文件与 HEAD 比对「代码部分差异 = 0」;裁决/design 编号计数逐项与 HEAD 一致 - 保留可执行 SQL 样例、SQLite 报错原文、pgvector/HNSW/ANN/BLOB 等技术词原文 - 复核:go build 绿 + memory/projectindex/vector 三包测试绿;gofmt 仅剩 2 个既有未格式化文件(改动前即如此,未顺手修)
This commit is contained in:
1 parent
eb1828ee7a
commit
61cf80d5ee
31 files changed
+820
-820
No files matched your search
@@ -9,7 +9,7 @@ import (
|
||||
"git.yeij.top/AskaEth/Cyrene_v2/internal/runtime/embedding"
|
||||
)
|
||||
|
||||
// addItem is a convenience to persist an item and fail the test on error.
|
||||
// addItem 是一个便捷函数:持久化一条条目,出错则让测试失败。
|
||||
func addItem(t *testing.T, s *Store, item MemoryItem) MemoryItem {
|
||||
t.Helper()
|
||||
ctx := context.Background()
|
||||
@@ -67,7 +67,7 @@ func TestRetriever_Retrieve_Recency_正常(t *testing.T) {
|
||||
})
|
||||
|
||||
r := NewRetriever(s)
|
||||
// A blank query matches nothing, so ordering falls back to recency.
|
||||
// query 为空时无任何命中,因此排序回退到新近度。
|
||||
results, err := r.Retrieve(ctx, "persona.a", "", 10)
|
||||
if err != nil {
|
||||
t.Fatalf("Retrieve: %v", err)
|
||||
@@ -78,7 +78,7 @@ func TestRetriever_Retrieve_Recency_正常(t *testing.T) {
|
||||
if got := results[0].Item.Content; got != "new memory" {
|
||||
t.Fatalf("top result = %q, want the newer memory", got)
|
||||
}
|
||||
// The older memory must rank below.
|
||||
// 较旧的记忆必须排在后面。
|
||||
if got := results[1].Item.Content; got != "old memory" {
|
||||
t.Fatalf("second result = %q, want the older memory", got)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user