Skip to content

Commit 41794ce

Browse files
committed
chore: update documentation
Lint & format
1 parent cf9ad92 commit 41794ce

File tree

7 files changed

+45
-47
lines changed

7 files changed

+45
-47
lines changed

src/collections/config/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,15 @@ const config = <T>(
4141
.withClassName(name)
4242
.withProperty(resolveProperty<any>(property, []))
4343
.do()
44-
.then(() => { }),
44+
.then(() => {}),
4545
addReference: (
4646
reference: ReferenceSingleTargetConfigCreate<any> | ReferenceMultiTargetConfigCreate<any>
4747
) =>
4848
new PropertyCreator(connection)
4949
.withClassName(name)
5050
.withProperty(resolveReference<any>(reference))
5151
.do()
52-
.then(() => { }),
52+
.then(() => {}),
5353
addVector: async (vectors: VectorizersConfigAdd<T>) => {
5454
const supportsDynamicVectorIndex = await dbVersionSupport.supportsDynamicVectorIndex();
5555
const { vectorsConfig } = makeVectorsConfig(vectors, supportsDynamicVectorIndex);
@@ -73,7 +73,7 @@ const config = <T>(
7373
})
7474
);
7575
},
76-
updateShards: async function(status: 'READY' | 'READONLY', names?: string | string[]) {
76+
updateShards: async function (status: 'READY' | 'READONLY', names?: string | string[]) {
7777
let shardNames: string[];
7878
if (names === undefined) {
7979
shardNames = await this.getShards().then((shards) => shards.map((s) => s.name));
@@ -98,7 +98,7 @@ const config = <T>(
9898
)
9999
)
100100
.then((merged) => new ClassUpdater(connection).withClass(merged).do())
101-
.then(() => { });
101+
.then(() => {});
102102
},
103103
};
104104
};

src/collections/config/integration.test.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import {
1212
VectorIndexConfigHNSW,
1313
} from './types/index.js';
1414

15-
1615
describe('Testing of the collection.config namespace', () => {
1716
let client: WeaviateClient;
1817

@@ -555,8 +554,8 @@ describe('Testing of the collection.config namespace', () => {
555554
.update({
556555
propertyDescriptions: supportsUpdatingPropertyDescriptions
557556
? {
558-
testProp: 'This is a test property',
559-
}
557+
testProp: 'This is a test property',
558+
}
560559
: undefined,
561560
vectorizers: weaviate.reconfigure.vectorizer.update({
562561
vectorIndexConfig: weaviate.reconfigure.vectorIndex.hnsw({

src/collections/config/types/vectorIndex.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ export type RQConfig = {
6565
bits?: number;
6666
rescoreLimit?: number;
6767
type: 'rq';
68-
}
68+
};
6969

7070
export type PQEncoderConfig = {
7171
type: PQEncoderType;

src/collections/config/utils.ts

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -213,11 +213,11 @@ export const makeVectorsConfig = <TProperties extends Properties | undefined = u
213213
const vectorizersConfig = Array.isArray(configVectorizers)
214214
? configVectorizers
215215
: [
216-
{
217-
...configVectorizers,
218-
name: configVectorizers.name || 'default',
219-
},
220-
];
216+
{
217+
...configVectorizers,
218+
name: configVectorizers.name || 'default',
219+
},
220+
];
221221
vectorizersConfig.forEach((v) => {
222222
if (v.vectorIndex.name === 'dynamic' && !supportsDynamicVectorIndex.supports) {
223223
throw new WeaviateUnsupportedFeatureError(supportsDynamicVectorIndex.message);
@@ -340,18 +340,18 @@ class ConfigMapping {
340340
vectorizer:
341341
v.vectorizer === 'none'
342342
? {
343-
name: 'none',
344-
config: undefined,
345-
}
343+
name: 'none',
344+
config: undefined,
345+
}
346346
: {
347-
name: v.vectorizer,
348-
config: v.moduleConfig
349-
? ({
350-
...(v.moduleConfig[v.vectorizer] as any),
351-
vectorizeCollectionName: (v.moduleConfig[v.vectorizer] as any).vectorizeClassName,
352-
} as VectorizerConfig)
353-
: undefined,
354-
},
347+
name: v.vectorizer,
348+
config: v.moduleConfig
349+
? ({
350+
...(v.moduleConfig[v.vectorizer] as any),
351+
vectorizeCollectionName: (v.moduleConfig[v.vectorizer] as any).vectorizeClassName,
352+
} as VectorizerConfig)
353+
: undefined,
354+
},
355355
indexConfig: ConfigMapping.vectorIndex(v.vectorIndexConfig, v.vectorIndexType),
356356
indexType: ConfigMapping.vectorIndexType(v.vectorIndexType),
357357
},

src/collections/configure/types/vectorIndex.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export type RQConfigCreate = QuantizerRecursivePartial<RQConfig>;
2323
export type RQConfigUpdate = {
2424
rescoreLimit?: number;
2525
type: 'rq';
26-
}
26+
};
2727

2828
export type PQConfigCreate = QuantizerRecursivePartial<PQConfig>;
2929

src/collections/configure/vectorIndex.ts

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,9 @@ const configure = {
6565
name: 'hnsw',
6666
config: rest
6767
? {
68-
...rest,
69-
distance: distanceMetric,
70-
}
68+
...rest,
69+
distance: distanceMetric,
70+
}
7171
: undefined,
7272
};
7373
},
@@ -86,11 +86,11 @@ const configure = {
8686
name: 'dynamic',
8787
config: opts
8888
? {
89-
distance: opts.distanceMetric,
90-
threshold: opts.threshold,
91-
hnsw: isModuleConfig(opts.hnsw) ? opts.hnsw.config : configure.hnsw(opts.hnsw).config,
92-
flat: isModuleConfig(opts.flat) ? opts.flat.config : configure.flat(opts.flat).config,
93-
}
89+
distance: opts.distanceMetric,
90+
threshold: opts.threshold,
91+
hnsw: isModuleConfig(opts.hnsw) ? opts.hnsw.config : configure.hnsw(opts.hnsw).config,
92+
flat: isModuleConfig(opts.flat) ? opts.flat.config : configure.flat(opts.flat).config,
93+
}
9494
: undefined,
9595
};
9696
},
@@ -115,7 +115,7 @@ const configure = {
115115
/**
116116
* Create an object of type `RQConfigCreate` to be used when defining the quantizer configuration of a vector index.
117117
*
118-
* @param {number} [options.bits] TODO: WRITE DOCS
118+
* @param {number} [options.bits] Number of bits to user per vector element.
119119
* @param {number} [options.rescoreLimit] The rescore limit. Default is 1000.
120120
* @returns {RQConfigCreate} The object of type `RQConfigCreate`.
121121
*/
@@ -152,9 +152,9 @@ const configure = {
152152
centroids: options?.centroids,
153153
encoder: options?.encoder
154154
? {
155-
distribution: options.encoder.distribution,
156-
type: options.encoder.type,
157-
}
155+
distribution: options.encoder.distribution,
156+
type: options.encoder.type,
157+
}
158158
: undefined,
159159
segments: options?.segments,
160160
trainingLimit: options?.trainingLimit,
@@ -254,7 +254,6 @@ const reconfigure = {
254254
* NOTE: If the vector index already has a quantizer configured, you cannot change its quantizer type; only its values.
255255
* So if you want to change the quantizer type, you must recreate the collection.
256256
*
257-
* @param {number} [options.bits] TODO: WRITE DOCS
258257
* @param {number} [options.rescoreLimit] The new rescore limit.
259258
* @returns {BQConfigUpdate} The configuration object.
260259
*/
@@ -290,9 +289,9 @@ const reconfigure = {
290289
encoder:
291290
pqEncoderDistribution || pqEncoderType
292291
? {
293-
distribution: pqEncoderDistribution,
294-
type: pqEncoderType,
295-
}
292+
distribution: pqEncoderDistribution,
293+
type: pqEncoderType,
294+
}
296295
: undefined,
297296
type: 'pq',
298297
};

src/collections/index.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -149,11 +149,11 @@ const collections = (connection: Connection, dbVersionSupport: DbVersionSupport)
149149
const configs = config.vectorizers
150150
? makeLegacyVectorizer({ ...config.vectorizers, name: undefined })
151151
: {
152-
vectorizer: undefined,
153-
moduleConfig: undefined,
154-
vectorIndexConfig: undefined,
155-
vectorIndexType: undefined,
156-
};
152+
vectorizer: undefined,
153+
moduleConfig: undefined,
154+
vectorIndexConfig: undefined,
155+
vectorIndexType: undefined,
156+
};
157157
schema = {
158158
...schema,
159159
moduleConfig: {
@@ -177,7 +177,7 @@ const collections = (connection: Connection, dbVersionSupport: DbVersionSupport)
177177
await new ClassCreator(connection).withClass(schema).do();
178178
return collection<TProperties, TName>(connection, name, dbVersionSupport);
179179
},
180-
createFromSchema: async function(config: WeaviateClass) {
180+
createFromSchema: async function (config: WeaviateClass) {
181181
const { class: name } = await new ClassCreator(connection).withClass(config).do();
182182
return collection<Properties, string>(connection, name as string, dbVersionSupport);
183183
},

0 commit comments

Comments
 (0)