@csuwl/opencode-memory-plugin 1.1.0 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/tools/vector-memory.ts +2 -7
package/package.json
CHANGED
package/tools/vector-memory.ts
CHANGED
|
@@ -152,9 +152,7 @@ async function getEmbedding(text: string): Promise<number[]> {
|
|
|
152
152
|
} catch (error) {
|
|
153
153
|
console.error('Embedding generation failed, using fallback:', error)
|
|
154
154
|
|
|
155
|
-
// Get fallback mode from config
|
|
156
|
-
const config = await getConfig()
|
|
157
|
-
const fallbackMode = config.embedding.fallbackMode
|
|
155
|
+
// Get fallback mode from config (config already declared above)
|
|
158
156
|
|
|
159
157
|
if (fallbackMode === 'error') {
|
|
160
158
|
throw new Error(`Embedding generation failed: ${error}`)
|
|
@@ -164,10 +162,7 @@ async function getEmbedding(text: string): Promise<number[]> {
|
|
|
164
162
|
throw new Error('BM25_FALLBACK') // Signal to use BM25-only search
|
|
165
163
|
}
|
|
166
164
|
|
|
167
|
-
// Default: hash-based fallback
|
|
168
|
-
const config = await getConfig()
|
|
169
|
-
const modelInfo = config.models.available[currentModelName!]
|
|
170
|
-
const dimensions = modelInfo?.dimensions || 384
|
|
165
|
+
// Default: hash-based fallback (config already available)
|
|
171
166
|
|
|
172
167
|
const words = text.toLowerCase().split(/\s+/)
|
|
173
168
|
const fallbackEmbedding: number[] = []
|