Files
memoryweave/go/internal/api/server_sqlite_nowindows.go
T
xiaowei 2a350cf781 fix(distill): max_tokens 800→1200 — Agnes推理token预算不足
Agnes 2.0-flash是推理模型,推理token占大量预算。
800仍不够→JSON截断(parse error: unexpected end of JSON input)。
1200确保推理+正文都够用。
2026-08-20 01:13:06 +08:00

26 lines
722 B
Go
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
//go:build !windows
// 织忆 MemoryWeave — SQLite 存储后端初始化(非 Windows)
package api
import (
"log"
"os"
"github.com/xiaoxue/memoryweave/internal/storage"
)
// initStorageForSQLite 初始化 SQLite 存储后端(仅非 Windows)
func initStorageForSQLite(emb *storage.Embedder) storage.LanceDB {
dbPath := "/var/lib/memoryweave/zhiyi.db"
if envPath := os.Getenv("SQLITE_PATH"); envPath != "" {
dbPath = envPath
}
sqliteDB, err := storage.NewSQLiteClient(dbPath)
if err != nil {
log.Printf("[zhiyid] SQLite 初始化失败 (%v),降级为内存存储", err)
return storage.NewMemLanceClient(emb)
}
log.Printf("[zhiyid] 存储后端: SQLite (CGO) — %s", dbPath)
return sqliteDB
}