Skip to content

Commit a4392d1

Browse files
committed
fix: resolve type errors breaking production build
1 parent ea55134 commit a4392d1

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

nuxt.config.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ export default defineNuxtConfig({
4545
},
4646
},
4747
safeRuntimeConfig: {
48-
validateOnBuild: false,
4948
$schema: v.object({
5049
googleApiKey: v.pipe(v.string(), v.minLength(1, 'GOOGLE_API_KEY is required')),
5150
openaiApiKey: v.pipe(v.string(), v.minLength(1, 'OPENAI_API_KEY is required')),

server/utils/embeddings.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ export async function generateEmbeddingCached(value: string): Promise<number[]>
55
const normalizedValue = value.trim().toLowerCase()
66
const cacheKey = `embedding:${normalizedValue}`
77

8-
const cached = await kv.get<number[]>(cacheKey)
8+
const cached = await kv.get(cacheKey) as number[] | null
99
if (cached)
1010
return cached
1111

1212
const model = createOpenAI({ apiKey: useRuntimeConfig().openaiApiKey }).embedding('text-embedding-3-small')
1313
const { embedding } = await embed({ model, value })
1414

15-
await kv.set(cacheKey, embedding)
15+
await kv.set(cacheKey, embedding as unknown as string)
1616

17-
return embedding
17+
return [...embedding]
1818
}

0 commit comments

Comments
 (0)