# Client.collections.create () vs. client.schema.create\_class ()

**URL:** <https://forum.weaviate.io/t/client-collections-create-vs-client-schema-create-class/2594>\
**Category:** Support\
**Tags:** python\
**Created:** [June 3, 2024, 3:00am UTC](https://forum.weaviate.io/t/client-collections-create-vs-client-schema-create-class/2594 "2024-06-03T03:00:18Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sridhar\_Iyer](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/sridhar_iyer/32/1148_2.png) [@Sridhar\_Iyer](https://forum.weaviate.io/u/Sridhar_Iyer)\
**Post date:** [June 3, 2024, 3:00am UTC](https://forum.weaviate.io/t/client-collections-create-vs-client-schema-create-class/2594/1 "2024-06-03T03:00:18Z")

</div>

### 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

---

<div class="post-metadata">

**Author:** ![Sridhar\_Iyer](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/sridhar_iyer/32/1148_2.png) [@Sridhar\_Iyer](https://forum.weaviate.io/u/Sridhar_Iyer)\
**Post date:** [June 3, 2024, 12:20pm UTC](https://forum.weaviate.io/t/client-collections-create-vs-client-schema-create-class/2594/2 "2024-06-03T12:20:54Z")

</div>

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:

---

<div class="post-metadata">

**Author:** ![Sridhar\_Iyer](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/sridhar_iyer/32/1148_2.png) [@Sridhar\_Iyer](https://forum.weaviate.io/u/Sridhar_Iyer)\
**Post date:** [June 3, 2024, 12:49pm UTC](https://forum.weaviate.io/t/client-collections-create-vs-client-schema-create-class/2594/3 "2024-06-03T12:49:16Z")

</div>

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.
