Created
February 4, 2025 16:52
-
-
Save RafalWilinski/274d51bcd0b999eb161b00c33fb9d8a2 to your computer and use it in GitHub Desktop.
This fails on query but works on describe. Why?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { getPlatformProxy } from "wrangler"; | |
(async () => { | |
const proxy = await getPlatformProxy<Env>(); | |
/// This succeeds! | |
const vectorizeIndex = await proxy.env.VECTORIZE_INDEX.describe(); | |
console.log(vectorizeIndex); | |
const vector = new Array(1024).fill(0); | |
/// This fails! | |
const result = await proxy.env.VECTORIZE_INDEX.query(vector, { | |
topK: 1, | |
returnMetadata: "all", | |
namespace: "test", | |
}); | |
console.log(result); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment