|
40 | 40 | _Img2VecNeuralConfig, |
41 | 41 | _map_multi2vec_fields, |
42 | 42 | _Multi2MultiVecJinaConfig, |
| 43 | + _Multi2VecAWSConfig, |
43 | 44 | _Multi2VecBindConfig, |
44 | 45 | _Multi2VecClipConfig, |
45 | 46 | _Multi2VecCohereConfig, |
|
60 | 61 | _Text2VecJinaConfig, |
61 | 62 | _Text2VecMistralConfig, |
62 | 63 | _Text2VecModel2VecConfig, |
| 64 | + _Text2VecMorphConfig, |
63 | 65 | _Text2VecNvidiaConfig, |
64 | 66 | _Text2VecOllamaConfig, |
65 | 67 | _Text2VecOpenAIConfig, |
@@ -559,6 +561,42 @@ def text2vec_mistral( |
559 | 561 | vector_index_config=_IndexWrappers.single(vector_index_config, quantizer), |
560 | 562 | ) |
561 | 563 |
|
| 564 | + @staticmethod |
| 565 | + def text2vec_morph( |
| 566 | + *, |
| 567 | + name: Optional[str] = None, |
| 568 | + quantizer: Optional[_QuantizerConfigCreate] = None, |
| 569 | + base_url: Optional[AnyHttpUrl] = None, |
| 570 | + model: Optional[str] = None, |
| 571 | + source_properties: Optional[List[str]] = None, |
| 572 | + vector_index_config: Optional[_VectorIndexConfigCreate] = None, |
| 573 | + vectorize_collection_name: bool = True, |
| 574 | + ) -> _VectorConfigCreate: |
| 575 | + """Create a vector using the `text2vec-morph` module. |
| 576 | +
|
| 577 | + See the [documentation](https://weaviate.io/developers/weaviate/model-providers/morph/embeddings) |
| 578 | + for detailed usage. |
| 579 | +
|
| 580 | + Args: |
| 581 | + name: The name of the vector. |
| 582 | + quantizer: The quantizer to use for the vector index. If not provided, no quantization will be applied. |
| 583 | + base_url: The base URL to use where API requests should go. Defaults to `None`, which uses the server-defined default. |
| 584 | + model: The model to use. Defaults to `None`, which uses the server-defined default. |
| 585 | + source_properties: Which properties should be included when vectorizing. By default all text properties are included. |
| 586 | + vector_index_config: The configuration for Weaviate's vector index. Use `wvc.config.Configure.VectorIndex` to create a vector index configuration. None by default |
| 587 | + vectorize_collection_name: Whether to vectorize the collection name. Defaults to `True`. |
| 588 | + """ |
| 589 | + return _VectorConfigCreate( |
| 590 | + name=name, |
| 591 | + source_properties=source_properties, |
| 592 | + vectorizer=_Text2VecMorphConfig( |
| 593 | + baseURL=base_url, |
| 594 | + model=model, |
| 595 | + vectorizeClassName=vectorize_collection_name, |
| 596 | + ), |
| 597 | + vector_index_config=_IndexWrappers.single(vector_index_config, quantizer), |
| 598 | + ) |
| 599 | + |
562 | 600 | @staticmethod |
563 | 601 | def text2vec_ollama( |
564 | 602 | *, |
@@ -688,6 +726,48 @@ def text2vec_aws( |
688 | 726 | vector_index_config=_IndexWrappers.single(vector_index_config, quantizer), |
689 | 727 | ) |
690 | 728 |
|
| 729 | + @staticmethod |
| 730 | + def multi2vec_aws( |
| 731 | + *, |
| 732 | + name: Optional[str] = None, |
| 733 | + quantizer: Optional[_QuantizerConfigCreate] = None, |
| 734 | + dimensions: Optional[int] = None, |
| 735 | + image_fields: Optional[Union[List[str], List[Multi2VecField]]] = None, |
| 736 | + model: Optional[str] = None, |
| 737 | + text_fields: Optional[Union[List[str], List[Multi2VecField]]] = None, |
| 738 | + region: Optional[str] = None, |
| 739 | + vector_index_config: Optional[_VectorIndexConfigCreate] = None, |
| 740 | + ) -> _VectorConfigCreate: |
| 741 | + """Create a vector using the `multi2vec-aws` module. |
| 742 | +
|
| 743 | + See the [documentation](https://weaviate.io/developers/weaviate/model-providers/aws/embeddings) |
| 744 | + for detailed usage. |
| 745 | +
|
| 746 | + Args: |
| 747 | + name: The name of the vector. |
| 748 | + quantizer: The quantizer to use for the vector index. If not provided, no quantization will be applied. |
| 749 | + dimensions: The number of dimensions to use. Defaults to `None`, which uses the server-defined default. |
| 750 | + image_fields: The image fields to use in vectorization. |
| 751 | + model: The model to use. Defaults to `None`, which uses the server-defined default. |
| 752 | + text_fields: The text fields to use in vectorization. |
| 753 | + region: The AWS region to run the model from. Defaults to `None`, which uses the server-defined defau |
| 754 | + vector_index_config: The configuration for Weaviate's vector index. Use `wvc.config.Configure.VectorIndex` to create a vector index configuration. None by default |
| 755 | +
|
| 756 | + Raises: |
| 757 | + pydantic.ValidationError: If `model` is not a valid value from the `JinaMultimodalModel` type. |
| 758 | + """ |
| 759 | + return _VectorConfigCreate( |
| 760 | + name=name, |
| 761 | + vectorizer=_Multi2VecAWSConfig( |
| 762 | + region=region, |
| 763 | + model=model, |
| 764 | + dimensions=dimensions, |
| 765 | + imageFields=_map_multi2vec_fields(image_fields), |
| 766 | + textFields=_map_multi2vec_fields(text_fields), |
| 767 | + ), |
| 768 | + vector_index_config=_IndexWrappers.single(vector_index_config, quantizer), |
| 769 | + ) |
| 770 | + |
691 | 771 | @staticmethod |
692 | 772 | def img2vec_neural( |
693 | 773 | *, |
|
0 commit comments