Like why is querying those 10k vecotrs once vs ten times not close to ten times the price? Something
Like why is querying those 10k vecotrs once vs ten times not close to ten times the price? Something doesn't add up in my head
your total queried vector dimensions would be 3.878million which is wrong, isn't it?
@/path/to/vectors.ndjson not clickable? I have no clue how to continue:
Content-Type headers have been set to application/x-ndjson. The server returns "unexpected - Internal server error" with status code 500.returnMetadata: true parameter, as listed in https://developers.cloudflare.com/vectorize/platform/client-api/#query-vectors{"content":"..."} with the ... being less than 8'000 for all elements. Which should guarantee that it's less than 10KiB, right?await env.<INDEX>.query(vector, { topK: 1}), in some cases it simply fails and returns the following error message: TypeError: Cannot read properties of undefined (reading '0')reading '0' isn't constant either, sometimes the number is different, and different userQueries result in different numbers. 
data array is sometimes undefined, not sure why but that should be my problem {"id":"1","values":[32.4,74.1,3.2],"metadata":{"path":"r2://bucket-name/path/to/image.png","format":"png","category":"profile_image"}}
{"id":"1","values":[32.4,74.1,3.2],"metadata":{"path":"r2://bucket-name/path/to/image.png","format":"png","category":"profile_image"}}await env.<INDEX>.query(vector, { topK: 1})TypeError: Cannot read properties of undefined (reading '0')reading '0'export async function getEmbedResponse(env: Environment, userQuery: string, data: string[]): Promise<{ score: number, result: string }> {
const ai = new Ai(env.AI)
const queryVector: EmbeddingResponse = await ai.run('@cf/baai/bge-base-en-v1.5', {
text: [userQuery],
})
let matches = await env.<INDEX>.query(queryVector.data[0], { topK: 1 })
const embedAiResponse = { score: matches.matches[0].score, result: data[parseInt(matches.matches[0].vectorId)] }
return embedAiResponse
}interface EmbeddingResponse {
shape: number[];
data: number[][];
}