For Workes & Pages, what is the name of the domain?
NA
What is the error number?
NA
What is the error message?
vectors.map is not a function
What is the issue or error you’re encountering
vectors.map is not a function on even simple executions
What steps have you taken to resolve the issue?
Created a small /embed GET route to test but also failed
What are the steps to reproduce the issue?
if (request.method === 'GET' && pathname === `/embed`) {
try {
const text = "text"
const response = await env.AI.run("@cf/baai/bge-small-en-v1.5", {
text,
});
await env.TESTVECTORS.insert({
id: 1,
values: response.data[0],
metadata: {
key: "value"
}
})
return new Response(JSON.stringify(response), {
headers: {
'content-type': 'text/plain;charset=UTF-8',
'Access-Control-Allow-Origin': '*',
},
});
} catch (error) {
console.log(error);
}
}
My vectorize wrangler:
[[vectorize]]
binding = “TESTVECTORS”
index_name = “test-index-v1”
Error is being thrown at env.TESTVECTORS.insert(), AI is working fine.