hi @matterberg ! Welcome to our community!
Sorry for the delay here, missed this one
this is how you can do it using python v4 client:
client.collections.delete("BringOwnNamedVectors")
collection = client.collections.create(
name="BringOwnNamedVectors",
description="Collection with named vectors",
properties=[
wvc.config.Property(name="name", data_type=wvc.config.DataType.TEXT),
wvc.config.Property(name="description", data_type=wvc.config.DataType.TEXT),
],
vectorizer_config=[
wvc.config.Configure.NamedVectors.none(
name="named1"
),
wvc.config.Configure.NamedVectors.text2vec_openai(
name="named2", source_properties=["name"]
),
wvc.config.Configure.NamedVectors.text2vec_cohere(
name="named3", source_properties=["description"]
)
],
)
now you have one object, with tree vectors: named1, named2, named3
named1 as no vectorizer, while named2 and named3 will use openai and cohere respectively.
this is how you can add an object:
collection.data.insert(
{"name": "object1", "description": "descr1"},
vector={
"named1": [1,2,3]
}
)
As named2 and named3 uses a vectorizer, Weaviate will do it for you. You can now get that object:
object = collection.query.fetch_objects(include_vector=True).objects[0]
print(object.properties)
print(object.vectors)
it will output something like this:
{'description': 'descr1', 'name': 'object1'}
{'named3': [0.01366424560546875, 0.057220458984375, -0.032806396484375, ...], 'named1': [1.0, 2.0, 3.0], 'named2': [-0.025193732231855392, 0.0002761332143563777, -0.014227229170501232, ...]}
Let me know if this helps!