Environment: free cloud sandbox instance on Weaviate Cloud (WCD)
Code language: nodejs (v18.20.4)
Version: weaviate-client (v3.1.5)
Code:
const client = await weaviate.connectToWeaviateCloud(
clusterUrl,
{
authCredentials: new weaviate.ApiKey(apiKeyAdmin),
headers: {
'X-OpenAI-Api-Key': openaiApiKey
}
}
)
await client.collections.create({
name: testCollectionName,
vectorizers: [
weaviate.configure.vectorizer.text2VecOpenAI({
name: 'question_vector',
sourceProperties: ['question'],
model: 'text-embedding-3-large',
dimensions: 1024
})
],
properties: [
{ name: 'category', dataType: dataType.TEXT },
{ name: 'question', dataType: dataType.TEXT },
{ name: 'answer', dataType: dataType.TEXT },
]
})
It’s demo code from the document. But it can not create collection with vectorizer. (The result is : collection is created, but the Vectorizer
is empty when view in console page)
Plus: The openaiApiKey
provided is corrent.
I don’t know what’s wrong. Need help here. Thanks.