@@ -23,6 +23,7 @@ import {
2323 GenerativeConfig ,
2424 GenerativeSearch ,
2525 ModuleConfig ,
26+ PropertyDescriptionsUpdate ,
2627 Reranker ,
2728 RerankerConfig ,
2829 VectorIndexType ,
@@ -32,10 +33,12 @@ export class MergeWithExisting {
3233 static schema (
3334 current : WeaviateClass ,
3435 supportsNamedVectors : boolean ,
35- update ?: CollectionConfigUpdate
36+ update ?: CollectionConfigUpdate < any >
3637 ) : WeaviateClass {
3738 if ( update === undefined ) return current ;
3839 if ( update . description !== undefined ) current . description = update . description ;
40+ if ( update . propertyDescriptions !== undefined )
41+ current . properties = MergeWithExisting . properties ( current . properties , update . propertyDescriptions ) ;
3942 if ( update . generative !== undefined )
4043 current . moduleConfig = MergeWithExisting . generative ( current . moduleConfig , update . generative ) ;
4144 if ( update . invertedIndex !== undefined )
@@ -74,6 +77,18 @@ export class MergeWithExisting {
7477 return current ;
7578 }
7679
80+ static properties (
81+ current : WeaviateClass [ 'properties' ] ,
82+ update : PropertyDescriptionsUpdate < any >
83+ ) : WeaviateClass [ 'properties' ] {
84+ if ( current === undefined ) throw Error ( 'Properties are missing from the class schema.' ) ;
85+ if ( current . length === 0 ) return current ;
86+ return current . map ( ( property ) => ( {
87+ ...property ,
88+ description : update [ property . name ! ] ?? property . description ,
89+ } ) ) ;
90+ }
91+
7792 static generative (
7893 current : WeaviateModuleConfig ,
7994 update : ModuleConfig < GenerativeSearch , GenerativeConfig >
0 commit comments