Skip to content
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions src/alias/journey.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,12 @@ requireAtLeast(1, 32, 0).describe('manages collection aliases', () => {
.then((aliases) => {
expect(aliases).not.toBeUndefined();
expect(aliases).toHaveLength(2);
expect(aliases).toEqual<Alias[]>([
{ collection: 'PaulHewson', alias: 'Bono' },
{ collection: 'GeorgeBarnes', alias: 'MachineGunKelly' },
]);
expect(aliases).toEqual(
expect.arrayContaining<Alias>([
{ collection: 'PaulHewson', alias: 'Bono' },
{ collection: 'GeorgeBarnes', alias: 'MachineGunKelly' },
])
);
});
});

Expand Down
1 change: 0 additions & 1 deletion src/collections/aggregate/integration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ describe('Testing of the collection.aggregate methods', () => {
// },
],
vectorizers: weaviate.configure.vectors.text2VecContextionary({
vectorizeCollectionName: false,
vectorIndexConfig: weaviate.configure.vectorIndex.hnsw({ maxConnections: 64 }),
}),
})
Expand Down
2 changes: 2 additions & 0 deletions src/collections/config/types/generative.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ export type GenerativePaLMConfig = GenerativeGoogleConfig;
export type GenerativeGoogleConfig = {
apiEndpoint?: string;
maxOutputTokens?: number;
model?: string;
/** @deprecated Use `model` instead. */
modelId?: string;
projectId?: string;
temperature?: number;
Expand Down
8 changes: 6 additions & 2 deletions src/collections/config/types/vectorizer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,9 @@ export type Multi2VecGoogleConfig = {
/** Length of a video interval in seconds. */
videoIntervalSeconds?: number;
/** The model ID in use. */
model?: string;
/** The model ID in use.
* @deprecated Use `model` instead.*/
modelId?: string;
/** The dimensionality of the vector once embedded. */
dimensions?: number;
Expand Down Expand Up @@ -393,8 +396,6 @@ export type Text2MultiVecJinaAIConfig = {
dimensions?: number;
/** The model to use. */
model?: string;
/** Whether to vectorize the collection name. */
vectorizeCollectionName?: boolean;
};

/** @deprecated Use `Text2VecJinaAIConfig` instead. */
Expand Down Expand Up @@ -476,6 +477,9 @@ export type Text2VecGoogleConfig = {
/** The API endpoint to use without a leading scheme such as `http://`. */
apiEndpoint?: string;
/** The model ID to use. */
model?: string;
/** The model ID to use.
* @deprecated Use `model `instead.*/
modelId?: string;
/** The project ID to use. */
projectId?: string;
Expand Down
18 changes: 16 additions & 2 deletions src/collections/configure/generative.ts
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,14 @@ export default {
console.warn('The `generative-palm` module is deprecated. Use `generative-google` instead.');
return {
name: 'generative-palm',
config,
// Do not populate config key if config === undefined.
config: config
? {
...config,
// Only create modelId key if either config.model or config.modelId are defined.
...(config?.modelId || config?.model ? { modelId: config?.model ?? config?.model } : undefined),
}
: undefined,
};
},
/**
Expand All @@ -262,7 +269,14 @@ export default {
): ModuleConfig<'generative-google', GenerativeGoogleConfig | undefined> => {
return {
name: 'generative-google',
config,
// Do not populate config key if config === undefined.
config: config
? {
...config,
// Only create modelId key if either config.model or config.modelId are defined.
...(config?.modelId || config?.model ? { modelId: config?.model ?? config?.model } : undefined),
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This syntax is fairly dense. My intention was to copy the model name into the modelId variable (for b/c) but preserve the previous behavior for config === undefined

}
: undefined,
};
},
/**
Expand Down
5 changes: 3 additions & 2 deletions src/collections/configure/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
import generative from './generative.js';
import reranker from './reranker.js';
import { configure as configureVectorIndex, reconfigure as reconfigureVectorIndex } from './vectorIndex.js';
import { multiVectors, vectors } from './vectorizer.js';
import { legacyVectors, multiVectors, vectors } from './vectorizer.js';

import { parseWithDefault } from './parsing.js';

Expand Down Expand Up @@ -63,7 +63,7 @@ const configure = {
/**
* @deprecated Use `vectors` instead.
*/
vectorizer: vectors,
vectorizer: legacyVectors,
vectors,
vectorIndex: configureVectorIndex,
dataType,
Expand Down Expand Up @@ -311,5 +311,6 @@ export {
tokenization,
vectorDistances,
configureVectorIndex as vectorIndex,
legacyVectors as vectorizer,
vectors,
};
Loading