Skip to content

Commit bcb5f4c

Browse files
authored
Make minor changes to fix reported bugs and add missing features (#352)
* Make changes to fix reported bugs and to close the following issues: - #325 - #328 - #345 - #346 - #349 - #350 - #350 * Differentiate between RQ-bits in 1.32 and 1.33 * Update CI images * Allow runtime generation with images and cohere module * Fix names in tests * Skip failing test due to server regression * Fix docstring for alias.update
1 parent 4c35138 commit bcb5f4c

File tree

17 files changed

+815
-93
lines changed

17 files changed

+815
-93
lines changed

.github/workflows/main.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ env:
1010
WEAVIATE_127: 1.27.27
1111
WEAVIATE_128: 1.28.16
1212
WEAVIATE_129: 1.29.9
13-
WEAVIATE_130: 1.30.12
14-
WEAVIATE_131: 1.31.5
15-
WEAVIATE_132: 1.32.5
16-
WEAVIATE_133: 1.33.0-rc.1
13+
WEAVIATE_130: 1.30.17
14+
WEAVIATE_131: 1.31.16
15+
WEAVIATE_132: 1.32.10
16+
WEAVIATE_133: 1.33.0
1717

1818
concurrency:
1919
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}

src/alias/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export interface Aliases {
3838
* delete the alias and create a new one.
3939
*
4040
* @param {string} args.alias Alias to update.
41-
* @param {string} args.collection New collection the alias should point to.
41+
* @param {string} args.newTargetCollection New collection the alias should point to.
4242
* @return {Promise<void>} Awaitable promise.
4343
*/
4444
update: (args: UpdateAliasArgs) => Promise<void>;

src/collections/backup/integration.test.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ describe('Integration testing of backups', () => {
118118
.then(testCollectionWaitForCompletion)
119119
.then(testCollectionNoWaitForCompletion));
120120

121-
requireAtLeast(1, 32, 3).describe('overwrite alias', () => {
121+
requireAtLeast(1, 32, 0).describe('overwrite alias', () => {
122122
test('overwriteAlias=true', async () => {
123123
const client = await clientPromise;
124124

@@ -153,7 +153,8 @@ describe('Integration testing of backups', () => {
153153
expect(alias.collection).toEqual(things.name);
154154
});
155155

156-
test('overwriteAlias=false', async () => {
156+
// Skip until server regression is fixed for overwriteAlias=false backups
157+
test.skip('overwriteAlias=false', async () => {
157158
const client = await clientPromise;
158159

159160
const things = await client.collections.create({ name: 'ThingsFalse' });

src/collections/config/integration.test.ts

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import {
88
ModuleConfig,
99
MultiTenancyConfig,
1010
PropertyConfig,
11+
RQConfig,
1112
RerankerCohereConfig,
1213
VectorIndexConfigDynamic,
1314
VectorIndexConfigHNSW,
@@ -877,4 +878,46 @@ describe('Testing of the collection.config namespace', () => {
877878
);
878879
});
879880
});
881+
882+
requireAtLeast(1, 32, 0).it(
883+
'should be able to create a collection with RQ quantizer bits=8 option',
884+
async () => {
885+
const collectionName = 'TestCollectionRQQuantizer8Bits';
886+
const collection = await client.collections.create({
887+
name: collectionName,
888+
vectorizers: weaviate.configure.vectors.selfProvided({
889+
quantizer: weaviate.configure.vectorIndex.quantizer.rq({ bits: 8, rescoreLimit: 10 }),
890+
}),
891+
});
892+
await collection.config.get().then((config) => {
893+
console.log(JSON.stringify(config, null, 2));
894+
const indexConfig = config.vectorizers.default.indexConfig as VectorIndexConfigHNSW;
895+
expect(indexConfig.quantizer).toBeDefined();
896+
expect(indexConfig.quantizer?.type).toEqual('rq');
897+
expect((indexConfig.quantizer as RQConfig).bits).toEqual(8);
898+
expect((indexConfig.quantizer as RQConfig).rescoreLimit).toEqual(10);
899+
});
900+
}
901+
);
902+
903+
requireAtLeast(1, 33, 0).it(
904+
'should be able to create a collection with RQ quantizer bits=1 option',
905+
async () => {
906+
const collectionName = 'TestCollectionRQQuantizer1Bits';
907+
const collection = await client.collections.create({
908+
name: collectionName,
909+
vectorizers: weaviate.configure.vectors.selfProvided({
910+
quantizer: weaviate.configure.vectorIndex.quantizer.rq({ bits: 1, rescoreLimit: 10 }),
911+
}),
912+
});
913+
await collection.config.get().then((config) => {
914+
console.log(JSON.stringify(config, null, 2));
915+
const indexConfig = config.vectorizers.default.indexConfig as VectorIndexConfigHNSW;
916+
expect(indexConfig.quantizer).toBeDefined();
917+
expect(indexConfig.quantizer?.type).toEqual('rq');
918+
expect((indexConfig.quantizer as RQConfig).bits).toEqual(1);
919+
expect((indexConfig.quantizer as RQConfig).rescoreLimit).toEqual(10);
920+
});
921+
}
922+
);
880923
});

src/collections/config/types/generative.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ export type GenerativeAWSConfig = {
1212
service: string;
1313
model?: string;
1414
endpoint?: string;
15+
maxTokens?: number;
1516
};
1617

1718
export type GenerativeAnthropicConfig = {

src/collections/config/types/vectorizer.ts

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,12 @@ export type Vectorizer =
4040
| 'text2vec-nvidia'
4141
| 'text2vec-mistral'
4242
| 'text2vec-model2vec'
43+
| 'text2vec-morph'
4344
| 'text2vec-ollama'
4445
| 'text2vec-openai'
4546
| Text2VecPalmVectorizer
4647
| 'text2vec-google'
48+
| 'text2vec-google-ai-studio'
4749
| 'text2vec-transformers'
4850
| 'text2vec-voyageai'
4951
| 'text2vec-weaviate'
@@ -93,6 +95,30 @@ export type Multi2VecNvidiaConfig = {
9395
};
9496
};
9597

98+
/** The configuration for multi-media vectorization using the AWS module.
99+
*
100+
* See the [documentation](https://weaviate.io/developers/weaviate/model-providers/aws/embeddings-multimodal) for detailed usage.
101+
*/
102+
export type Multi2VecAWSConfig = {
103+
/** The dimensionality of the vector once embedded. */
104+
dimensions?: number;
105+
/** The model to use. */
106+
model?: string;
107+
/** The AWS region where the model runs. */
108+
region?: string;
109+
/** The image fields used when vectorizing. */
110+
imageFields?: string[];
111+
/** The text fields used when vectorizing. */
112+
textFields?: string[];
113+
/** The weights of the fields used for vectorization. */
114+
weights?: {
115+
/** The weights of the image fields. */
116+
imageFields?: number[];
117+
/** The weights of the text fields. */
118+
textFields?: number[];
119+
};
120+
};
121+
96122
/** The configuration for multi-media vectorization using the CLIP module.
97123
*
98124
* See the [documentation](https://weaviate.io/developers/weaviate/model-providers/transformers/embeddings-multimodal) for detailed usage.
@@ -504,6 +530,8 @@ export type Text2VecPalmConfig = Text2VecGoogleConfig;
504530
export type Text2VecGoogleConfig = {
505531
/** The API endpoint to use without a leading scheme such as `http://`. */
506532
apiEndpoint?: string;
533+
/** The dimensionality of the vector once embedded. */
534+
dimensions?: number;
507535
/** The model ID to use. */
508536
model?: string;
509537
/** The model ID to use.
@@ -517,6 +545,13 @@ export type Text2VecGoogleConfig = {
517545
vectorizeCollectionName?: boolean;
518546
};
519547

548+
export type Text2VecGoogleAiStudioConfig = {
549+
/** The model ID to use. */
550+
model?: string;
551+
/** The Weaviate property name for the `gecko-002` or `gecko-003` model to use as the title. */
552+
titleProperty?: string;
553+
};
554+
520555
/**
521556
* The configuration for text vectorization using the Transformers module.
522557
*
@@ -579,10 +614,18 @@ export type Text2VecModel2Vec = {
579614
vectorizeCollectionName?: boolean;
580615
};
581616

617+
export type Text2VecMorphConfig = {
618+
/** The base URL to use where API requests should go. */
619+
baseURL?: string;
620+
/** The model to use. */
621+
model?: string;
622+
};
623+
582624
export type NoVectorizerConfig = {};
583625

584626
export type VectorizerConfig =
585627
| Img2VecNeuralConfig
628+
| Multi2VecAWSConfig
586629
| Multi2VecClipConfig
587630
| Multi2VecBindConfig
588631
| Multi2VecGoogleConfig
@@ -652,6 +695,8 @@ export type VectorizerConfigType<V> = V extends 'img2vec-neural'
652695
? Text2VecMistralConfig | undefined
653696
: V extends 'text2vec-model2vec'
654697
? Text2VecModel2Vec | undefined
698+
: V extends 'text2vec-morph'
699+
? Text2VecMorphConfig | undefined
655700
: V extends 'text2vec-ollama'
656701
? Text2VecOllamaConfig | undefined
657702
: V extends 'text2vec-openai'

0 commit comments

Comments
 (0)