Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
22 changes: 18 additions & 4 deletions src/collections/config/types/generative.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,10 @@ export type GenerativeAzureOpenAIConfig = GenerativeOpenAIConfigBase & {
deploymentId: string;
};

export type GenerativePaLMConfig = {
/** @deprecated Use `GenerativeGoogleConfig` instead. */
export type GenerativePaLMConfig = GenerativeGoogleConfig;

export type GenerativeGoogleConfig = {
apiEndpoint?: string;
maxOutputTokens?: number;
modelId?: string;
Expand All @@ -95,6 +98,9 @@ export type GenerativeConfig =
| GenerativeAWSConfig
| GenerativeAzureOpenAIConfig
| GenerativeCohereConfig
| GenerativeDatabricksConfig
| GenerativeGoogleConfig
| GenerativeFriendliAIConfig
| GenerativeMistralConfig
| GenerativeOctoAIConfig
| GenerativeOllamaConfig
Expand All @@ -110,11 +116,13 @@ export type GenerativeConfigType<G> = G extends 'generative-anthropic'
: G extends 'generative-aws'
? GenerativeAWSConfig
: G extends 'generative-azure-openai'
? GenerativeOpenAIConfig
: G extends 'generative-cohere'
? GenerativeAzureOpenAIConfig
: G extends 'generative-cohere'
? GenerativeCohereConfig
: G extends 'generative-databricks'
? GenerativeDatabricksConfig
: G extends 'generative-google'
? GenerativeGoogleConfig
: G extends 'generative-friendliai'
? GenerativeFriendliAIConfig
: G extends 'generative-mistral'
Expand All @@ -124,23 +132,29 @@ export type GenerativeConfigType<G> = G extends 'generative-anthropic'
: G extends 'generative-ollama'
? GenerativeOllamaConfig
: G extends 'generative-openai'
? GenerativeOpenAIConfig
: G extends GenerativePalm
? GenerativePaLMConfig
: G extends 'none'
? undefined
: Record<string, any> | undefined;

/** @deprecated Use `generative-google` instead. */
type GenerativePalm = 'generative-palm';

export type GenerativeSearch =
| 'generative-anthropic'
| 'generative-anyscale'
| 'generative-aws'
| 'generative-azure-openai'
| 'generative-cohere'
| 'generative-databricks'
| 'generative-google'
| 'generative-friendliai'
| 'generative-mistral'
| 'generative-octoai'
| 'generative-ollama'
| 'generative-openai'
| 'generative-palm'
| GenerativePalm
| 'none'
| string;
38 changes: 29 additions & 9 deletions src/collections/config/types/vectorizer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,18 @@ export type VectorConfig = Record<
}
>;

/** @deprecated Use `multi2vec-google` instead. */
type Multi2VecPalmVectorizer = 'multi2vec-palm';

/** @deprecated Use `text2vec-google` instead. */
type Text2VecPalmVectorizer = 'text2vec-palm';

export type Vectorizer =
| 'img2vec-neural'
| 'multi2vec-clip'
| 'multi2vec-bind'
| 'multi2vec-palm'
| Multi2VecPalmVectorizer
| 'multi2vec-google'
| 'ref2vec-centroid'
| 'text2vec-aws'
| 'text2vec-azure-openai'
Expand All @@ -29,7 +36,8 @@ export type Vectorizer =
| 'text2vec-octoai'
| 'text2vec-ollama'
| 'text2vec-openai'
| 'text2vec-palm'
| Text2VecPalmVectorizer
| 'text2vec-google'
| 'text2vec-transformers'
| 'text2vec-voyageai'
| 'none';
Expand Down Expand Up @@ -113,12 +121,15 @@ export type Multi2VecBindConfig = {
};
};

/** The configuration for multi-media vectorization using the PaLM model.
/** @deprecated Use `Multi2VecGoogleConfig` instead. */
export type Multi2VecPalmConfig = Multi2VecGoogleConfig;

/** The configuration for multi-media vectorization using the Google module.
*
* See the [documentation](https://weaviate.io/developers/weaviate/model-providers/google/embeddings) for detailed usage.
*/
export type Multi2VecPalmConfig = {
/** The project ID of the Palm model. */
export type Multi2VecGoogleConfig = {
/** The project ID of the model in GCP. */
projectId: string;
/** The location where the model runs. */
location: string;
Expand Down Expand Up @@ -327,12 +338,15 @@ export type Text2VecOpenAIConfig = {
vectorizeCollectionName?: boolean;
};

/** @deprecated Use `Text2VecGoogleConfig` instead. */
export type Text2VecPalmConfig = Text2VecGoogleConfig;

/**
* The configuration for text vectorization using the PaLM module.
* The configuration for text vectorization using the Google module.
*
* See the [documentation](https://weaviate.io/developers/weaviate/model-providers/google/embeddings) for detailed usage.
*/
export type Text2VecPalmConfig = {
export type Text2VecGoogleConfig = {
/** The API endpoint to use without a leading scheme such as `http://`. */
apiEndpoint?: string;
/** The model ID to use. */
Expand Down Expand Up @@ -385,13 +399,15 @@ export type VectorizerConfig =
| Img2VecNeuralConfig
| Multi2VecClipConfig
| Multi2VecBindConfig
| Multi2VecGoogleConfig
| Multi2VecPalmConfig
| Ref2VecCentroidConfig
| Text2VecAWSConfig
| Text2VecAzureOpenAIConfig
| Text2VecContextionaryConfig
| Text2VecCohereConfig
| Text2VecDatabricksConfig
| Text2VecGoogleConfig
| Text2VecGPT4AllConfig
| Text2VecHuggingFaceConfig
| Text2VecJinaConfig
Expand All @@ -407,7 +423,9 @@ export type VectorizerConfigType<V> = V extends 'img2vec-neural'
? Multi2VecClipConfig | undefined
: V extends 'multi2vec-bind'
? Multi2VecBindConfig | undefined
: V extends 'multi2vec-palm'
: V extends 'multi2vec-google'
? Multi2VecGoogleConfig
: V extends Multi2VecPalmVectorizer
? Multi2VecPalmConfig
: V extends 'ref2vec-centroid'
? Ref2VecCentroidConfig
Expand All @@ -419,6 +437,8 @@ export type VectorizerConfigType<V> = V extends 'img2vec-neural'
? Text2VecCohereConfig | undefined
: V extends 'text2vec-databricks'
? Text2VecDatabricksConfig
: V extends 'text2vec-google'
? Text2VecGoogleConfig | undefined
: V extends 'text2vec-gpt4all'
? Text2VecGPT4AllConfig | undefined
: V extends 'text2vec-huggingface'
Expand All @@ -435,7 +455,7 @@ export type VectorizerConfigType<V> = V extends 'img2vec-neural'
? Text2VecOpenAIConfig | undefined
: V extends 'text2vec-azure-openai'
? Text2VecAzureOpenAIConfig
: V extends 'text2vec-palm'
: V extends Text2VecPalmVectorizer
? Text2VecPalmConfig | undefined
: V extends 'text2vec-transformers'
? Text2VecTransformersConfig | undefined
Expand Down
19 changes: 19 additions & 0 deletions src/collections/configure/generative.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
GenerativeCohereConfig,
GenerativeDatabricksConfig,
GenerativeFriendliAIConfig,
GenerativeGoogleConfig,
GenerativeMistralConfig,
GenerativeOctoAIConfig,
GenerativeOllamaConfig,
Expand Down Expand Up @@ -235,13 +236,31 @@ export default {
*
* @param {GenerativePaLMConfigCreate} [config] The configuration for the `generative-palm` module.
* @returns {ModuleConfig<'generative-palm', GenerativePaLMConfig>} The configuration object.
* @deprecated Use `google` instead.
*/
palm: (
config?: GenerativePaLMConfigCreate
): ModuleConfig<'generative-palm', GenerativePaLMConfig | undefined> => {
console.warn('The `generative-palm` module is deprecated. Use `generative-google` instead.');
return {
name: 'generative-palm',
config,
};
},
/**
* Create a `ModuleConfig<'generative-google', GenerativeGoogleConfig>` object for use when performing AI generation using the `generative-google` module.
*
* See the [documentation](https://weaviate.io/developers/weaviate/model-providers/google/generative) for detailed usage.
*
* @param {GenerativePaLMConfigCreate} [config] The configuration for the `generative-palm` module.
* @returns {ModuleConfig<'generative-palm', GenerativePaLMConfig>} The configuration object.
*/
google: (
config?: GenerativePaLMConfigCreate
): ModuleConfig<'generative-google', GenerativeGoogleConfig | undefined> => {
return {
name: 'generative-google',
config,
};
},
};
20 changes: 15 additions & 5 deletions src/collections/configure/types/vectorizer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ import {
Text2VecContextionaryConfig,
Text2VecDatabricksConfig,
Text2VecGPT4AllConfig,
Text2VecGoogleConfig,
Text2VecHuggingFaceConfig,
Text2VecJinaConfig,
Text2VecMistralConfig,
Text2VecOctoAIConfig,
Text2VecOllamaConfig,
Text2VecOpenAIConfig,
Text2VecPalmConfig,
Text2VecTransformersConfig,
Text2VecVoyageAIConfig,
VectorIndexType,
Expand Down Expand Up @@ -111,9 +111,12 @@ export type Multi2VecBindConfigCreate = {
vectorizeCollectionName?: boolean;
};

/** The configuration for the `multi2vec-palm` vectorizer. */
export type Multi2VecPalmConfigCreate = {
/** The project id of the palm model. */
/** @deprecated Use `Multi2VecGoogleConfigCreate` instead.*/
export type Multi2VecPalmConfigCreate = Multi2VecGoogleConfigCreate;

/** The configuration for the `multi2vec-google` vectorizer. */
export type Multi2VecGoogleConfigCreate = {
/** The project id of the model in GCP. */
projectId: string;
/** Where the model runs */
location: string;
Expand Down Expand Up @@ -157,7 +160,10 @@ export type Text2VecOllamaConfigCreate = Text2VecOllamaConfig;

export type Text2VecOpenAIConfigCreate = Text2VecOpenAIConfig;

export type Text2VecPalmConfigCreate = Text2VecPalmConfig;
/** @deprecated Use `Text2VecGoogleConfigCreate` instead. */
export type Text2VecPalmConfigCreate = Text2VecGoogleConfig;

export type Text2VecGoogleConfigCreate = Text2VecGoogleConfig;

export type Text2VecTransformersConfigCreate = Text2VecTransformersConfig;

Expand All @@ -171,6 +177,8 @@ export type VectorizerConfigCreateType<V> = V extends 'img2vec-neural'
? Multi2VecBindConfigCreate | undefined
: V extends 'multi2vec-palm'
? Multi2VecPalmConfigCreate
: V extends 'multi2vec-google'
? Multi2VecGoogleConfigCreate
: V extends 'ref2vec-centroid'
? Ref2VecCentroidConfigCreate
: V extends 'text2vec-aws'
Expand Down Expand Up @@ -199,6 +207,8 @@ export type VectorizerConfigCreateType<V> = V extends 'img2vec-neural'
? Text2VecAzureOpenAIConfigCreate
: V extends 'text2vec-palm'
? Text2VecPalmConfigCreate | undefined
: V extends 'text2vec-google'
? Text2VecGoogleConfigCreate | undefined
: V extends 'text2vec-transformers'
? Text2VecTransformersConfigCreate | undefined
: V extends 'text2vec-voyageai'
Expand Down
Loading
Loading