From 906d03b1db40606255d27c4517305b0782b1ad2f Mon Sep 17 00:00:00 2001 From: JP Hwang Date: Wed, 3 Jul 2024 13:47:04 +0100 Subject: [PATCH 1/2] Propose further wording change --- weaviate/collections/classes/config.py | 32 +++++++++---------- .../collections/classes/config_vectorizers.py | 6 ++-- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/weaviate/collections/classes/config.py b/weaviate/collections/classes/config.py index 0b6fb881b..19dd0365d 100644 --- a/weaviate/collections/classes/config.py +++ b/weaviate/collections/classes/config.py @@ -536,13 +536,13 @@ def custom( module_name: str, module_config: Dict[str, Any], ) -> _GenerativeConfigCreate: - """Create a `_GenerativeCustom` object for use when generating using a custom module. + """Create a `_GenerativeCustom` object for use when generating using a custom specification. Arguments: `module_name` - The name of the custom module to use, REQUIRED. + The name of the module to use, REQUIRED. `module_config` - The configuration to use for the custom module. Defaults to `None`, which uses the server-defined default. + The configuration to use for the module. Defaults to `None`, which uses the server-defined default. """ return _GenerativeCustom(generative=_EnumLikeStr(module_name), module_config=module_config) @@ -800,13 +800,13 @@ def transformers() -> _RerankerConfigCreate: @staticmethod def custom(module_name: str, module_config: Dict[str, Any]) -> _RerankerConfigCreate: - """Create a `_RerankerCustomConfig` object for use when reranking using a custom module. + """Create a `_RerankerCustomConfig` object for use when reranking using a custom specification. Arguments: `module_name` - The name of the custom module to use, REQUIRED. + The name of the module to use, REQUIRED. `module_config` - The configuration to use for the custom module. Defaults to `None`, which uses the server-defined default. + The configuration to use for the module. Defaults to `None`, which uses the server-defined default. """ return _RerankerCustomConfig( reranker=_EnumLikeStr(module_name), module_config=module_config @@ -914,9 +914,9 @@ class _CollectionConfigUpdate(_ConfigUpdateModel): vectorIndexConfig: Optional[_VectorIndexConfigUpdate] = Field( default=None, alias="vector_index_config" ) - vectorizerConfig: Optional[ - Union[_VectorIndexConfigUpdate, List[_NamedVectorConfigUpdate]] - ] = Field(default=None, alias="vectorizer_config") + vectorizerConfig: Optional[Union[_VectorIndexConfigUpdate, List[_NamedVectorConfigUpdate]]] = ( + Field(default=None, alias="vectorizer_config") + ) multiTenancyConfig: Optional[_MultiTenancyConfigUpdate] = Field( default=None, alias="multi_tenancy_config" ) @@ -963,10 +963,10 @@ def merge_with_existing(self, schema: Dict[str, Any]) -> Dict[str, Any]: raise WeaviateInvalidInputError( f"Cannot update vector index config with name {vc.name} to change its quantizer" ) - schema["vectorConfig"][vc.name][ - "vectorIndexConfig" - ] = vc.vectorIndexConfig.merge_with_existing( - schema["vectorConfig"][vc.name]["vectorIndexConfig"] + schema["vectorConfig"][vc.name]["vectorIndexConfig"] = ( + vc.vectorIndexConfig.merge_with_existing( + schema["vectorConfig"][vc.name]["vectorIndexConfig"] + ) ) schema["vectorConfig"][vc.name][ "vectorIndexType" @@ -1536,9 +1536,9 @@ class _CollectionConfigCreate(_ConfigCreateModel): vectorIndexConfig: Optional[_VectorIndexConfigCreate] = Field( default=None, alias="vector_index_config" ) - vectorizerConfig: Optional[ - Union[_VectorizerConfigCreate, List[_NamedVectorConfigCreate]] - ] = Field(default=_Vectorizer.none(), alias="vectorizer_config") + vectorizerConfig: Optional[Union[_VectorizerConfigCreate, List[_NamedVectorConfigCreate]]] = ( + Field(default=_Vectorizer.none(), alias="vectorizer_config") + ) generativeSearch: Optional[_GenerativeConfigCreate] = Field( default=None, alias="generative_config" ) diff --git a/weaviate/collections/classes/config_vectorizers.py b/weaviate/collections/classes/config_vectorizers.py index 9d33f7356..23667226f 100644 --- a/weaviate/collections/classes/config_vectorizers.py +++ b/weaviate/collections/classes/config_vectorizers.py @@ -693,13 +693,13 @@ def text2vec_contextionary(vectorize_collection_name: bool = True) -> _Vectorize def custom( module_name: str, module_config: Optional[Dict[str, Any]] = None ) -> _VectorizerConfigCreate: - """Create a `_VectorizerCustomConfig` object for use when vectorizing using a custom module. + """Create a `_VectorizerCustomConfig` object for use when vectorizing using a custom specification. Arguments: `module_name` - The name of the custom module to use, REQUIRED. + The name of the module to use, REQUIRED. `module_config` - The configuration to use for the custom module. Defaults to `None`, which uses the server-defined default. + The configuration to use for the module. Defaults to `None`, which uses the server-defined default. """ return _VectorizerCustomConfig( vectorizer=_EnumLikeStr(module_name), module_config=module_config From cbe0fda2d94b5a02d5d85d04a93bfdc11fdeb0d0 Mon Sep 17 00:00:00 2001 From: JP Hwang Date: Wed, 3 Jul 2024 14:24:13 +0100 Subject: [PATCH 2/2] Run black 23.9.1 --- weaviate/collections/classes/config.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/weaviate/collections/classes/config.py b/weaviate/collections/classes/config.py index 089967d3e..ad53b6d54 100644 --- a/weaviate/collections/classes/config.py +++ b/weaviate/collections/classes/config.py @@ -985,9 +985,9 @@ class _CollectionConfigUpdate(_ConfigUpdateModel): vectorIndexConfig: Optional[_VectorIndexConfigUpdate] = Field( default=None, alias="vector_index_config" ) - vectorizerConfig: Optional[Union[_VectorIndexConfigUpdate, List[_NamedVectorConfigUpdate]]] = ( - Field(default=None, alias="vectorizer_config") - ) + vectorizerConfig: Optional[ + Union[_VectorIndexConfigUpdate, List[_NamedVectorConfigUpdate]] + ] = Field(default=None, alias="vectorizer_config") multiTenancyConfig: Optional[_MultiTenancyConfigUpdate] = Field( default=None, alias="multi_tenancy_config" ) @@ -1034,10 +1034,10 @@ def merge_with_existing(self, schema: Dict[str, Any]) -> Dict[str, Any]: raise WeaviateInvalidInputError( f"Cannot update vector index config with name {vc.name} to change its quantizer" ) - schema["vectorConfig"][vc.name]["vectorIndexConfig"] = ( - vc.vectorIndexConfig.merge_with_existing( - schema["vectorConfig"][vc.name]["vectorIndexConfig"] - ) + schema["vectorConfig"][vc.name][ + "vectorIndexConfig" + ] = vc.vectorIndexConfig.merge_with_existing( + schema["vectorConfig"][vc.name]["vectorIndexConfig"] ) schema["vectorConfig"][vc.name][ "vectorIndexType" @@ -1618,9 +1618,9 @@ class _CollectionConfigCreate(_ConfigCreateModel): vectorIndexConfig: Optional[_VectorIndexConfigCreate] = Field( default=None, alias="vector_index_config" ) - vectorizerConfig: Optional[Union[_VectorizerConfigCreate, List[_NamedVectorConfigCreate]]] = ( - Field(default=_Vectorizer.none(), alias="vectorizer_config") - ) + vectorizerConfig: Optional[ + Union[_VectorizerConfigCreate, List[_NamedVectorConfigCreate]] + ] = Field(default=_Vectorizer.none(), alias="vectorizer_config") generativeSearch: Optional[_GenerativeConfigCreate] = Field( default=None, alias="generative_config" )