@cfnathan Okay, it appears that file format is wrong. ```sh $ npx wrangler vectorize insert hey-hi-i
@cfnathan Okay, it appears that file format is wrong.
How it should it be formatted?
How it should it be formatted?
[0.032991889864206314, 0.0012868141056969762, ,,,]$ npx wrangler vectorize insert hey-hi-index --file test_vector.ndjson
✨ Uploading vector batch (1 vectors)
✘ [ERROR] A request to the Cloudflare API (/accounts/account_id/vectorize/indexes/hey-hi-index/insert) failed.
vectorize.invalid_body_payload [code: 1006]https://api.cloudflare.com/client/v4/accounts/${ACCOUNT_IDENTIFIER}/vectorize/indexes/${indexName}/query;wrangler.toml with:https://api.cloudflare.com/client/v4/accounts/${ACCOUNT_IDENTIFIER}/vectorize/indexes/${indexName}/query const vectorizeStartTime: any = new Date()
const queryVec = await c.env.VECTORIZE_TESTE_1536.query(embQuery, {
topK: 3,
returnValues: false,
returnMetadata: true,
namespace: data.customerId.toString()+"_"+data.repoId.toString()
});
const vectorizeEndtime: any= new Date()
console.log("Vectorize time", vectorizeEndtime - vectorizeStartTime)curl --request POST --url https://api.cloudflare.com/client/v4/accounts/${CLOUDFLARE_ACCOUNT_ID}/vectorize/indexes/hey-hi-index/upsert --header "Authorization: Bearer ${VECTORIZE_API_TOKEN}" --header 'Content-Type: application/x-ndjson' --data test_vector.ndjson
{
"result": null,
"success": false,
"errors": [
{
"message": "unexpected - Internal server error"
}
],
"messages": []
}const store = new CloudflareVectorizeStore(embeddings, {
index: env.VECTORIZE_INDEX,
});
await store.addDocuments(
[
{
pageContent: "hello",
metadata: {},
},
{
pageContent: "world",
metadata: {},
},
{
pageContent: "hi",
metadata: {},
},
],
{ ids: ["id1", "id2", "id3"] }
);[[vectorize]]
binding = "VECTOR_INDEX"
index_name = "vector-index"