refactor(memory): drop unused host helpers · openclaw/openclaw@33fa225
vincentkoc
·
2026-06-19
·
via Recent Commits to openclaw:main
File tree
packages/memory-host-sdk/src/host
| Original file line number | Diff line number | Diff line change |
|---|
@@ -799,34 +799,3 @@ export function expandQueryForFts(
|
799 | 799 | |
800 | 800 | return { original, keywords, expanded }; |
801 | 801 | } |
802 | | - |
803 | | -/** |
804 | | - * Type for an optional LLM-based query expander. |
805 | | - * Can be provided to enhance keyword extraction with semantic understanding. |
806 | | - */ |
807 | | -export type LlmQueryExpander = (query: string) => Promise<string[]>; |
808 | | - |
809 | | -/** |
810 | | - * Expand query with optional LLM assistance. |
811 | | - * Falls back to local extraction if LLM is unavailable or fails. |
812 | | - */ |
813 | | -export async function expandQueryWithLlm( |
814 | | -query: string, |
815 | | -llmExpander?: LlmQueryExpander, |
816 | | -opts?: { ftsTokenizer?: "unicode61" | "trigram" }, |
817 | | -): Promise<string[]> { |
818 | | -// If LLM expander is provided, try it first |
819 | | -if (llmExpander) { |
820 | | -try { |
821 | | -const llmKeywords = await llmExpander(query); |
822 | | -if (llmKeywords.length > 0) { |
823 | | -return llmKeywords; |
824 | | -} |
825 | | -} catch { |
826 | | -// LLM failed, fall back to local extraction |
827 | | -} |
828 | | -} |
829 | | - |
830 | | -// Fall back to local keyword extraction |
831 | | -return extractKeywords(query, opts); |
832 | | -} |
| Original file line number | Diff line number | Diff line change |
|---|
@@ -42,11 +42,3 @@ export function resolveMemoryCacheSummary(cache: { enabled: boolean; entries?: n
|
42 | 42 | const suffix = typeof cache.entries === "number" ? ` (${cache.entries})` : ""; |
43 | 43 | return { tone: "ok", text: `cache on${suffix}` }; |
44 | 44 | } |
45 | | - |
46 | | -/** Resolve cache enabled state without count text. */ |
47 | | -export function resolveMemoryCacheState(cache: { enabled: boolean }): { |
48 | | -tone: Tone; |
49 | | -state: "enabled" | "disabled"; |
50 | | -} { |
51 | | -return cache.enabled ? { tone: "ok", state: "enabled" } : { tone: "muted", state: "disabled" }; |
52 | | -} |
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。