i AM USING my own openai embedding model and trying to create a collection in which i am trying to create Collection like this but it is not working:
import weaviate
import weaviate.classes.config as wc
import os
from weaviate.auth import AuthApiKey
from langchain_weaviate.vectorstores import WeaviateVectorStore
weaviate_key = my api
# Connect to a WCS instance
client = weaviate.connect_to_wcs(
cluster_url="my url
auth_credentials=AuthApiKey(weaviate_key),
)
try:
collection_rg = client.collections.create(
[
{
"class": "Document",
"description": "A collection for storing document entities",
"vectorIndexType": "hnsw",
"vectorizer": "text2vec-contextionary",
"properties": [
{
"name": "title",
"description": "The title of the document",
"dataType": ["string"],
"indexFilterable": True, # Changed 'true' to 'True'
"indexSearchable": True # Changed 'true' to 'True'
},
{
"name": "description",
"description": "The description of the document",
"dataType": ["string"],
"indexFilterable": True, # Changed 'true' to 'True'
"indexSearchable": True # Changed 'true' to 'True'
}
],
"invertedIndexConfig": {
"indexTimestamps": False, # Changed 'false' to 'False'
"indexNullState": False, # Changed 'false' to 'False'
"indexPropertyLength": False # Changed 'false' to 'False'
}
},
{
"class": "Section",
"description": "A collection for storing different sections of a document",
"vectorIndexType": "hnsw",
"vectorizer": "text2vec-contextionary",
"properties": [
{
"name": "content",
"description": "The main content of the section",
"dataType": ["text"],
"indexFilterable": True, # Changed 'true' to 'True'
"indexSearchable": True # Changed 'true' to 'True'
},
{
"name": "contentVector",
"description": "Vector representation of the section content",
"dataType": ["vector(float[])"]
}
],
"invertedIndexConfig": {
"indexTimestamps": False, # Changed 'false' to 'False'
"indexNullState": False, # Changed 'false' to 'False'
"indexPropertyLength": False # Changed 'false' to 'False'
}
}
]
)
finally:
client.close() # Ensure the connection is closed