Text and multimodal embedding configure

Description

weav_client.collections.create(
        name=COLLECTION_NAME,

        vectorizer_config=[
           Configure.NamedVectors.text2vec_palm(
             name ="image_description",
             source_properties=["image_description"],
             project_id= "xxxx",
             api_endpoint="xxxx",
           ),
            Configure.Vectorizer.multi2vec_palm(
                image_fields=["image"],
                text_fields=["summary_description"],
                project_id = "xxxx",
                location = "us-central1",
                model_id = "multimodalembedding@001",
                dimensions = 1408,
            ),
        ],
    properties=[
        Property(name="image", data_type=DataType.BLOB,),
        Property(name="image_description", data_type=DataType.TEXT),
        Property(name="summary_description", data_type=DataType.TEXT),
   .............

The above errors out : (error message below)
Input should be a valid dictionary or instance of _NamedVectorConfigCreate [type=model_type, input_value=_Multi2VecPalmConfig(vect…deoIntervalSeconds=None), input_type=_Multi2VecPalmConfig]
For further information visit Redirecting...

An example given at: ( Multiple vectors | Weaviate - Vector Database )

collection = client.collections.create(
    name="Named_Vector_Jeopardy_Collection",
    description="Jeopardy game show questions",
    vectorizer_config=[
        wvc.config.Configure.NamedVectors.text2vec_cohere(
            name="jeopardy_questions_vector",
            source_properties=["question"],
            vectorize_collection_name=False,
        ),
        wvc.config.Configure.NamedVectors.text2vec_openai(
            name="jeopardy_answers_vector",
            source_properties=["answer"],
            vectorize_collection_name=False,
        ),
    ],
    properties=[
        wvc.config.Property(name="category", data_type=wvc.config.DataType.TEXT),
        wvc.config.Property(name="question", data_type=wvc.config.DataType.TEXT),
        wvc.config.Property(name="answer", data_type=wvc.config.DataType.TEXT),
    ],
)

Any suggestions on fixing the error I get? thanks

Server Setup Information

  • Weaviate Server Version:
  • Deployment Method:
  • Multi Node? Number of Running Nodes:
  • Client Language and Version:
  • Multitenancy?:

Any additional Information

hi @Sridhar_Iyer !!

There is a small error in your named vectors definition :see_no_evil:

instead of
Configure.NamedVectors.multi2vec_palm
you are using
Configure.Vectorizer.multi2vec_palm

when using the NamedVectors, you also need to pass a name for it

here is a working code:

from weaviate.classes.config import Configure, Property, DataType
client.collections.delete("Test")
client.collections.create(
        name="Test",

        vectorizer_config=[
           Configure.NamedVectors.text2vec_palm(
             name ="image_description",
             source_properties=["image_description"],
             project_id= "xxxx",
             api_endpoint="xxxx",
           ),
            Configure.NamedVectors.multi2vec_palm(
                name="image_and_summary",
                image_fields=["image"],
                text_fields=["summary_description"],
                project_id = "xxxx",
                location = "us-central1",
                model_id = "multimodalembedding@001",
                dimensions = 1408,
            ),
        ],
    properties=[
        Property(name="image", data_type=DataType.BLOB,),
        Property(name="image_description", data_type=DataType.TEXT),
        Property(name="summary_description", data_type=DataType.TEXT),
    ]
)

Let me know if this helps.

Thanks!