Skip to content

Instantly share code, notes, and snippets.

@RafalWilinski
Created February 4, 2025 16:52
Show Gist options
  • Save RafalWilinski/274d51bcd0b999eb161b00c33fb9d8a2 to your computer and use it in GitHub Desktop.
Save RafalWilinski/274d51bcd0b999eb161b00c33fb9d8a2 to your computer and use it in GitHub Desktop.
This fails on query but works on describe. Why?
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