Skip to content

Commit 66114ac

Browse files
authored
Merge pull request #213 from weaviate/1.27/rename-palm-to-google
Deprecate `xPalm` types and methods in favour of `xGoogle`
2 parents 8ed6c24 + 578b4d5 commit 66114ac

File tree

6 files changed

+324
-27
lines changed

6 files changed

+324
-27
lines changed

src/collections/config/types/generative.ts

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,10 @@ export type GenerativeAzureOpenAIConfig = GenerativeOpenAIConfigBase & {
7979
deploymentId: string;
8080
};
8181

82-
export type GenerativePaLMConfig = {
82+
/** @deprecated Use `GenerativeGoogleConfig` instead. */
83+
export type GenerativePaLMConfig = GenerativeGoogleConfig;
84+
85+
export type GenerativeGoogleConfig = {
8386
apiEndpoint?: string;
8487
maxOutputTokens?: number;
8588
modelId?: string;
@@ -95,6 +98,9 @@ export type GenerativeConfig =
9598
| GenerativeAWSConfig
9699
| GenerativeAzureOpenAIConfig
97100
| GenerativeCohereConfig
101+
| GenerativeDatabricksConfig
102+
| GenerativeGoogleConfig
103+
| GenerativeFriendliAIConfig
98104
| GenerativeMistralConfig
99105
| GenerativeOctoAIConfig
100106
| GenerativeOllamaConfig
@@ -110,11 +116,13 @@ export type GenerativeConfigType<G> = G extends 'generative-anthropic'
110116
: G extends 'generative-aws'
111117
? GenerativeAWSConfig
112118
: G extends 'generative-azure-openai'
113-
? GenerativeOpenAIConfig
114-
: G extends 'generative-cohere'
115119
? GenerativeAzureOpenAIConfig
120+
: G extends 'generative-cohere'
121+
? GenerativeCohereConfig
116122
: G extends 'generative-databricks'
117123
? GenerativeDatabricksConfig
124+
: G extends 'generative-google'
125+
? GenerativeGoogleConfig
118126
: G extends 'generative-friendliai'
119127
? GenerativeFriendliAIConfig
120128
: G extends 'generative-mistral'
@@ -124,23 +132,29 @@ export type GenerativeConfigType<G> = G extends 'generative-anthropic'
124132
: G extends 'generative-ollama'
125133
? GenerativeOllamaConfig
126134
: G extends 'generative-openai'
135+
? GenerativeOpenAIConfig
136+
: G extends GenerativePalm
127137
? GenerativePaLMConfig
128138
: G extends 'none'
129139
? undefined
130140
: Record<string, any> | undefined;
131141

142+
/** @deprecated Use `generative-google` instead. */
143+
type GenerativePalm = 'generative-palm';
144+
132145
export type GenerativeSearch =
133146
| 'generative-anthropic'
134147
| 'generative-anyscale'
135148
| 'generative-aws'
136149
| 'generative-azure-openai'
137150
| 'generative-cohere'
138151
| 'generative-databricks'
152+
| 'generative-google'
139153
| 'generative-friendliai'
140154
| 'generative-mistral'
141155
| 'generative-octoai'
142156
| 'generative-ollama'
143157
| 'generative-openai'
144-
| 'generative-palm'
158+
| GenerativePalm
145159
| 'none'
146160
| string;

src/collections/config/types/vectorizer.ts

Lines changed: 29 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,18 @@ export type VectorConfig = Record<
1111
}
1212
>;
1313

14+
/** @deprecated Use `multi2vec-google` instead. */
15+
type Multi2VecPalmVectorizer = 'multi2vec-palm';
16+
17+
/** @deprecated Use `text2vec-google` instead. */
18+
type Text2VecPalmVectorizer = 'text2vec-palm';
19+
1420
export type Vectorizer =
1521
| 'img2vec-neural'
1622
| 'multi2vec-clip'
1723
| 'multi2vec-bind'
18-
| 'multi2vec-palm'
24+
| Multi2VecPalmVectorizer
25+
| 'multi2vec-google'
1926
| 'ref2vec-centroid'
2027
| 'text2vec-aws'
2128
| 'text2vec-azure-openai'
@@ -29,7 +36,8 @@ export type Vectorizer =
2936
| 'text2vec-octoai'
3037
| 'text2vec-ollama'
3138
| 'text2vec-openai'
32-
| 'text2vec-palm'
39+
| Text2VecPalmVectorizer
40+
| 'text2vec-google'
3341
| 'text2vec-transformers'
3442
| 'text2vec-voyageai'
3543
| 'none';
@@ -113,12 +121,15 @@ export type Multi2VecBindConfig = {
113121
};
114122
};
115123

116-
/** The configuration for multi-media vectorization using the PaLM model.
124+
/** @deprecated Use `Multi2VecGoogleConfig` instead. */
125+
export type Multi2VecPalmConfig = Multi2VecGoogleConfig;
126+
127+
/** The configuration for multi-media vectorization using the Google module.
117128
*
118129
* See the [documentation](https://weaviate.io/developers/weaviate/model-providers/google/embeddings) for detailed usage.
119130
*/
120-
export type Multi2VecPalmConfig = {
121-
/** The project ID of the Palm model. */
131+
export type Multi2VecGoogleConfig = {
132+
/** The project ID of the model in GCP. */
122133
projectId: string;
123134
/** The location where the model runs. */
124135
location: string;
@@ -327,12 +338,15 @@ export type Text2VecOpenAIConfig = {
327338
vectorizeCollectionName?: boolean;
328339
};
329340

341+
/** @deprecated Use `Text2VecGoogleConfig` instead. */
342+
export type Text2VecPalmConfig = Text2VecGoogleConfig;
343+
330344
/**
331-
* The configuration for text vectorization using the PaLM module.
345+
* The configuration for text vectorization using the Google module.
332346
*
333347
* See the [documentation](https://weaviate.io/developers/weaviate/model-providers/google/embeddings) for detailed usage.
334348
*/
335-
export type Text2VecPalmConfig = {
349+
export type Text2VecGoogleConfig = {
336350
/** The API endpoint to use without a leading scheme such as `http://`. */
337351
apiEndpoint?: string;
338352
/** The model ID to use. */
@@ -385,13 +399,15 @@ export type VectorizerConfig =
385399
| Img2VecNeuralConfig
386400
| Multi2VecClipConfig
387401
| Multi2VecBindConfig
402+
| Multi2VecGoogleConfig
388403
| Multi2VecPalmConfig
389404
| Ref2VecCentroidConfig
390405
| Text2VecAWSConfig
391406
| Text2VecAzureOpenAIConfig
392407
| Text2VecContextionaryConfig
393408
| Text2VecCohereConfig
394409
| Text2VecDatabricksConfig
410+
| Text2VecGoogleConfig
395411
| Text2VecGPT4AllConfig
396412
| Text2VecHuggingFaceConfig
397413
| Text2VecJinaConfig
@@ -407,7 +423,9 @@ export type VectorizerConfigType<V> = V extends 'img2vec-neural'
407423
? Multi2VecClipConfig | undefined
408424
: V extends 'multi2vec-bind'
409425
? Multi2VecBindConfig | undefined
410-
: V extends 'multi2vec-palm'
426+
: V extends 'multi2vec-google'
427+
? Multi2VecGoogleConfig
428+
: V extends Multi2VecPalmVectorizer
411429
? Multi2VecPalmConfig
412430
: V extends 'ref2vec-centroid'
413431
? Ref2VecCentroidConfig
@@ -419,6 +437,8 @@ export type VectorizerConfigType<V> = V extends 'img2vec-neural'
419437
? Text2VecCohereConfig | undefined
420438
: V extends 'text2vec-databricks'
421439
? Text2VecDatabricksConfig
440+
: V extends 'text2vec-google'
441+
? Text2VecGoogleConfig | undefined
422442
: V extends 'text2vec-gpt4all'
423443
? Text2VecGPT4AllConfig | undefined
424444
: V extends 'text2vec-huggingface'
@@ -435,7 +455,7 @@ export type VectorizerConfigType<V> = V extends 'img2vec-neural'
435455
? Text2VecOpenAIConfig | undefined
436456
: V extends 'text2vec-azure-openai'
437457
? Text2VecAzureOpenAIConfig
438-
: V extends 'text2vec-palm'
458+
: V extends Text2VecPalmVectorizer
439459
? Text2VecPalmConfig | undefined
440460
: V extends 'text2vec-transformers'
441461
? Text2VecTransformersConfig | undefined

src/collections/configure/generative.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {
66
GenerativeCohereConfig,
77
GenerativeDatabricksConfig,
88
GenerativeFriendliAIConfig,
9+
GenerativeGoogleConfig,
910
GenerativeMistralConfig,
1011
GenerativeOctoAIConfig,
1112
GenerativeOllamaConfig,
@@ -235,13 +236,31 @@ export default {
235236
*
236237
* @param {GenerativePaLMConfigCreate} [config] The configuration for the `generative-palm` module.
237238
* @returns {ModuleConfig<'generative-palm', GenerativePaLMConfig>} The configuration object.
239+
* @deprecated Use `google` instead.
238240
*/
239241
palm: (
240242
config?: GenerativePaLMConfigCreate
241243
): ModuleConfig<'generative-palm', GenerativePaLMConfig | undefined> => {
244+
console.warn('The `generative-palm` module is deprecated. Use `generative-google` instead.');
242245
return {
243246
name: 'generative-palm',
244247
config,
245248
};
246249
},
250+
/**
251+
* Create a `ModuleConfig<'generative-google', GenerativeGoogleConfig>` object for use when performing AI generation using the `generative-google` module.
252+
*
253+
* See the [documentation](https://weaviate.io/developers/weaviate/model-providers/google/generative) for detailed usage.
254+
*
255+
* @param {GenerativePaLMConfigCreate} [config] The configuration for the `generative-palm` module.
256+
* @returns {ModuleConfig<'generative-palm', GenerativePaLMConfig>} The configuration object.
257+
*/
258+
google: (
259+
config?: GenerativePaLMConfigCreate
260+
): ModuleConfig<'generative-google', GenerativeGoogleConfig | undefined> => {
261+
return {
262+
name: 'generative-google',
263+
config,
264+
};
265+
},
247266
};

src/collections/configure/types/vectorizer.ts

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ import {
99
Text2VecContextionaryConfig,
1010
Text2VecDatabricksConfig,
1111
Text2VecGPT4AllConfig,
12+
Text2VecGoogleConfig,
1213
Text2VecHuggingFaceConfig,
1314
Text2VecJinaConfig,
1415
Text2VecMistralConfig,
1516
Text2VecOctoAIConfig,
1617
Text2VecOllamaConfig,
1718
Text2VecOpenAIConfig,
18-
Text2VecPalmConfig,
1919
Text2VecTransformersConfig,
2020
Text2VecVoyageAIConfig,
2121
VectorIndexType,
@@ -111,9 +111,12 @@ export type Multi2VecBindConfigCreate = {
111111
vectorizeCollectionName?: boolean;
112112
};
113113

114-
/** The configuration for the `multi2vec-palm` vectorizer. */
115-
export type Multi2VecPalmConfigCreate = {
116-
/** The project id of the palm model. */
114+
/** @deprecated Use `Multi2VecGoogleConfigCreate` instead.*/
115+
export type Multi2VecPalmConfigCreate = Multi2VecGoogleConfigCreate;
116+
117+
/** The configuration for the `multi2vec-google` vectorizer. */
118+
export type Multi2VecGoogleConfigCreate = {
119+
/** The project id of the model in GCP. */
117120
projectId: string;
118121
/** Where the model runs */
119122
location: string;
@@ -157,7 +160,10 @@ export type Text2VecOllamaConfigCreate = Text2VecOllamaConfig;
157160

158161
export type Text2VecOpenAIConfigCreate = Text2VecOpenAIConfig;
159162

160-
export type Text2VecPalmConfigCreate = Text2VecPalmConfig;
163+
/** @deprecated Use `Text2VecGoogleConfigCreate` instead. */
164+
export type Text2VecPalmConfigCreate = Text2VecGoogleConfig;
165+
166+
export type Text2VecGoogleConfigCreate = Text2VecGoogleConfig;
161167

162168
export type Text2VecTransformersConfigCreate = Text2VecTransformersConfig;
163169

@@ -171,6 +177,8 @@ export type VectorizerConfigCreateType<V> = V extends 'img2vec-neural'
171177
? Multi2VecBindConfigCreate | undefined
172178
: V extends 'multi2vec-palm'
173179
? Multi2VecPalmConfigCreate
180+
: V extends 'multi2vec-google'
181+
? Multi2VecGoogleConfigCreate
174182
: V extends 'ref2vec-centroid'
175183
? Ref2VecCentroidConfigCreate
176184
: V extends 'text2vec-aws'
@@ -199,6 +207,8 @@ export type VectorizerConfigCreateType<V> = V extends 'img2vec-neural'
199207
? Text2VecAzureOpenAIConfigCreate
200208
: V extends 'text2vec-palm'
201209
? Text2VecPalmConfigCreate | undefined
210+
: V extends 'text2vec-google'
211+
? Text2VecGoogleConfigCreate | undefined
202212
: V extends 'text2vec-transformers'
203213
? Text2VecTransformersConfigCreate | undefined
204214
: V extends 'text2vec-voyageai'

0 commit comments

Comments
 (0)