|
62 | 62 | "voyage-finance-2", |
63 | 63 | "voyage-multilingual-2", |
64 | 64 | ] |
65 | | -VoyageMultimodalModel: TypeAlias = Literal["voyage-multimodal-3",] |
| 65 | +VoyageMultimodalModel: TypeAlias = Literal[ |
| 66 | + "voyage-multimodal-3", |
| 67 | + "voyage-multimodal-3.5", |
| 68 | +] |
66 | 69 | AWSModel: TypeAlias = Literal[ |
67 | 70 | "amazon.titan-embed-text-v1", |
68 | 71 | "cohere.embed-english-v3", |
@@ -550,6 +553,8 @@ class _Multi2VecVoyageaiConfig(_Multi2VecBase): |
550 | 553 | baseURL: Optional[AnyHttpUrl] |
551 | 554 | model: Optional[str] |
552 | 555 | truncation: Optional[bool] |
| 556 | + dimensions: Optional[int] |
| 557 | + videoFields: Optional[List[Multi2VecField]] |
553 | 558 |
|
554 | 559 | def _to_dict(self) -> Dict[str, Any]: |
555 | 560 | ret_dict = super()._to_dict() |
@@ -881,37 +886,43 @@ def multi2vec_cohere( |
881 | 886 | @staticmethod |
882 | 887 | def multi2vec_voyageai( |
883 | 888 | *, |
884 | | - model: Optional[Union[CohereMultimodalModel, str]] = None, |
| 889 | + model: Optional[Union[VoyageMultimodalModel, str]] = None, |
885 | 890 | truncation: Optional[bool] = None, |
886 | | - output_encoding: Optional[str], |
| 891 | + dimensions: Optional[int] = None, |
| 892 | + output_encoding: Optional[str] = None, |
887 | 893 | vectorize_collection_name: bool = True, |
888 | 894 | base_url: Optional[AnyHttpUrl] = None, |
889 | 895 | image_fields: Optional[Union[List[str], List[Multi2VecField]]] = None, |
890 | 896 | text_fields: Optional[Union[List[str], List[Multi2VecField]]] = None, |
| 897 | + video_fields: Optional[Union[List[str], List[Multi2VecField]]] = None, |
891 | 898 | ) -> _VectorizerConfigCreate: |
892 | | - """Create a `_Multi2VecCohereConfig` object for use when vectorizing using the `multi2vec-cohere` model. |
| 899 | + """Create a `_Multi2VecVoyageaiConfig` object for use when vectorizing using the `multi2vec-voyageai` model. |
893 | 900 |
|
894 | | - See the [documentation](https://weaviate.io/developers/weaviate/model-providers/cohere/embeddings-multimodal) |
| 901 | + See the [documentation](https://weaviate.io/developers/weaviate/model-providers/voyageai/embeddings-multimodal) |
895 | 902 | for detailed usage. |
896 | 903 |
|
897 | 904 | Args: |
898 | 905 | model: The model to use. Defaults to `None`, which uses the server-defined default. |
899 | | - truncate: The truncation strategy to use. Defaults to `None`, which uses the server-defined default. |
| 906 | + truncation: The truncation strategy to use. Defaults to `None`, which uses the server-defined default. |
| 907 | + dimensions: The number of dimensions for the output embeddings. Defaults to `None`, which uses the model's default (1024 for voyage-multimodal-3.5). |
900 | 908 | output_encoding: Deprecated, has no effect. |
901 | 909 | vectorize_collection_name: Deprecated, has no effect. |
902 | 910 | base_url: The base URL to use where API requests should go. Defaults to `None`, which uses the server-defined default. |
903 | 911 | image_fields: The image fields to use in vectorization. |
904 | 912 | text_fields: The text fields to use in vectorization. |
| 913 | + video_fields: The video fields to use in vectorization. |
905 | 914 |
|
906 | 915 | Raises: |
907 | | - pydantic.ValidationError: If `model` is not a valid value from the `CohereMultimodalModel` type or if `truncate` is not a valid value from the `CohereTruncation` type. |
| 916 | + pydantic.ValidationError: If `model` is not a valid value from the `VoyageMultimodalModel` type. |
908 | 917 | """ |
909 | 918 | return _Multi2VecVoyageaiConfig( |
910 | 919 | baseURL=base_url, |
911 | 920 | model=model, |
912 | 921 | truncation=truncation, |
| 922 | + dimensions=dimensions, |
913 | 923 | imageFields=_map_multi2vec_fields(image_fields), |
914 | 924 | textFields=_map_multi2vec_fields(text_fields), |
| 925 | + videoFields=_map_multi2vec_fields(video_fields), |
915 | 926 | ) |
916 | 927 |
|
917 | 928 | @staticmethod |
|
0 commit comments