Description
In several example notebooks I see
client.collections.create ()
I run my own instance of weaviate (docker-compose) version.
I create client = weaviate.Client ()
with this client I am able to connect to my instance. However,
client.collections.create () does not work (client has no collections attribute)
i have to use client.schema.create_class ()
I am trying to use multimodal embeddings from google. I can not find an example with client.collections.create ()
Two questions:
a) what is the difference between client.collections.create () vs. client.schema.create_class ()
b) is there any difference in the client connection when the client connects with my own instance under docker. ( client.schema.create_class works not client.collections.create)
c) any example of multimodal embeddings creation (the collection will have image, some text description, want to use both image / text embeddings)
Thanks
Server Setup Information
- Weaviate Server Version:
- Deployment Method:
- Multi Node? Number of Running Nodes:
- Client Language and Version:
- Multitenancy?:
Any additional Information
I define the following:
class_animals_data = {
âclassâ : âAnimalsâ,
âdescriptionâ : âdata extracted from related docsâ,
âvectorizerâ: âgenerative-palmâ,
âmoduleConfigâ: {
âgenerative-palmâ: {
âimage_fieldsâ:[âimageâ],
âproject_idâ: âXXXXXâ,
âlocationâ: âYYYYYYYâ,
âmodel_idâ: âmultimodalembedding@001â,
âdimensionsâ :1408,
},
},
"properties" : [
{
'name': 'image',
'dataType': ['blob']
},
{
'name': 'description',
'dataType': ['text'],
}
]
}
(the client âwcâ is connected to an instance of weaviate I am running under docker - it works fine. I am able to create text / openAI vectorizer based collections)
wc.schema.create_class(class_animals_data )
UnexpectedStatusCodeError: Create class! Unexpected status code: 422, with response body: {âerrorâ: [{âmessageâ: âvectorizer: module âgenerative-palmâ exists, but does not provide the Vectorizer or ReferenceVectorizer capabilityâ}]}.
/usr/local/lib/python3.10/dist-packages/weaviate/schema/crud_schema.py in _create_class_with_primitives(self, weaviate_class)
815 raise RequestsConnectionError(âClass may not have been created properly.â) from conn_err
816 if response.status_code != 200:
â 817 raise UnexpectedStatusCodeException(âCreate classâ, response)
818
819 def _create_classes_with_primitives(self, schema_classes_list: list) â None:
Figured out a few things:
if I use:
client1 = weaviate.Client (xxx) this client does not have âcollectionsâ attribute.
if i try:
client2 = weaviate.connect_to_custom(xxx), this client has âcollectionsâ attribute.