diff --git a/src/collections/config/types/generative.ts b/src/collections/config/types/generative.ts index 14b5dbff..4ad0dc43 100644 --- a/src/collections/config/types/generative.ts +++ b/src/collections/config/types/generative.ts @@ -14,11 +14,44 @@ export type GenerativeAWSConfig = { endpoint?: string; }; +export type GenerativeAnthropicConfig = { + maxTokens?: number; + model?: string; + stopSequences?: string[]; + temperature?: number; + topK?: number; + topP?: number; +}; + export type GenerativeAnyscaleConfig = { model?: string; temperature?: number; }; +export type GenerativeCohereConfig = { + kProperty?: number; + model?: string; + maxTokensProperty?: number; + returnLikelihoodsProperty?: string; + stopSequencesProperty?: string[]; + temperatureProperty?: number; +}; + +export type GenerativeDatabricksConfig = { + endpoint: string; + maxTokens?: number; + temperature?: number; + topK?: number; + topP?: number; +}; + +export type GenerativeFriendliAIConfig = { + baseURL?: string; + maxTokens?: number; + model?: string; + temperature?: number; +}; + export type GenerativeMistralConfig = { maxTokens?: number; model?: string; @@ -46,15 +79,6 @@ export type GenerativeAzureOpenAIConfig = GenerativeOpenAIConfigBase & { deploymentId: string; }; -export type GenerativeCohereConfig = { - kProperty?: number; - model?: string; - maxTokensProperty?: number; - returnLikelihoodsProperty?: string; - stopSequencesProperty?: string[]; - temperatureProperty?: number; -}; - export type GenerativePaLMConfig = { apiEndpoint?: string; maxOutputTokens?: number; @@ -66,30 +90,57 @@ export type GenerativePaLMConfig = { }; export type GenerativeConfig = - | GenerativeOpenAIConfig + | GenerativeAnthropicConfig + | GenerativeAnyscaleConfig + | GenerativeAWSConfig + | GenerativeAzureOpenAIConfig | GenerativeCohereConfig + | GenerativeMistralConfig + | GenerativeOctoAIConfig + | GenerativeOllamaConfig + | GenerativeOpenAIConfig | GenerativePaLMConfig | Record | undefined; -export type GenerativeConfigType = G extends 'generative-openai' +export type GenerativeConfigType = G extends 'generative-anthropic' + ? GenerativeAnthropicConfig + : G extends 'generative-anyscale' + ? GenerativeAnyscaleConfig + : G extends 'generative-aws' + ? GenerativeAWSConfig + : G extends 'generative-azure-openai' ? GenerativeOpenAIConfig : G extends 'generative-cohere' - ? GenerativeCohereConfig - : G extends 'generative-palm' + ? GenerativeAzureOpenAIConfig + : G extends 'generative-databricks' + ? GenerativeDatabricksConfig + : G extends 'generative-friendliai' + ? GenerativeFriendliAIConfig + : G extends 'generative-mistral' + ? GenerativeMistralConfig + : G extends 'generative-octoai' + ? GenerativeOctoAIConfig + : G extends 'generative-ollama' + ? GenerativeOllamaConfig + : G extends 'generative-openai' ? GenerativePaLMConfig : G extends 'none' ? undefined : Record | undefined; export type GenerativeSearch = + | 'generative-anthropic' | 'generative-anyscale' | 'generative-aws' + | 'generative-azure-openai' + | 'generative-cohere' + | 'generative-databricks' + | 'generative-friendliai' | 'generative-mistral' | 'generative-octoai' | 'generative-ollama' | 'generative-openai' - | 'generative-cohere' | 'generative-palm' | 'none' | string; diff --git a/src/collections/config/types/reranker.ts b/src/collections/config/types/reranker.ts index 48d1e7d1..f1cd64de 100644 --- a/src/collections/config/types/reranker.ts +++ b/src/collections/config/types/reranker.ts @@ -20,6 +20,7 @@ export type RerankerJinaAIConfig = { export type RerankerConfig = | RerankerCohereConfig + | RerankerJinaAIConfig | RerankerTransformersConfig | RerankerVoyageAIConfig | Record diff --git a/src/collections/config/types/vectorizer.ts b/src/collections/config/types/vectorizer.ts index 16c17998..208125fe 100644 --- a/src/collections/config/types/vectorizer.ts +++ b/src/collections/config/types/vectorizer.ts @@ -21,9 +21,11 @@ export type Vectorizer = | 'text2vec-azure-openai' | 'text2vec-cohere' | 'text2vec-contextionary' + | 'text2vec-databricks' | 'text2vec-gpt4all' | 'text2vec-huggingface' | 'text2vec-jina' + | 'text2vec-mistral' | 'text2vec-octoai' | 'text2vec-ollama' | 'text2vec-openai' @@ -32,9 +34,9 @@ export type Vectorizer = | 'text2vec-voyageai' | 'none'; -/** The configuration for image vectorization using a neural network. +/** The configuration for image vectorization using a neural network module. * - * See the [documentation](https://weaviate.io/developers/weaviate/modules/retriever-vectorizer-modules/img2vec-neural) for detailed usage. + * See the [documentation](https://weaviate.io/developers/weaviate/modules/img2vec-neural) for detailed usage. */ export type Img2VecNeuralConfig = { /** The image fields used when vectorizing. This is a required field and must match the property fields of the collection that are defined as `DataType.BLOB`. */ @@ -49,9 +51,9 @@ export type Multi2VecField = { weight?: number; }; -/** The configuration for multi-media vectorization using CLIP. +/** The configuration for multi-media vectorization using the CLIP module. * - * See the [documentation](https://weaviate.io/developers/weaviate/modules/retriever-vectorizer-modules/multi2vec-clip) for detailed usage. + * See the [documentation](https://weaviate.io/developers/weaviate/model-providers/transformers/embeddings-multimodal) for detailed usage. */ export type Multi2VecClipConfig = { /** The image fields used when vectorizing. */ @@ -71,9 +73,9 @@ export type Multi2VecClipConfig = { }; }; -/** The configuration for multi-media vectorization using Bind. +/** The configuration for multi-media vectorization using the Bind module. * - * See the [documentation](https://weaviate.io/developers/weaviate/modules/retriever-vectorizer-modules/multi2vec-bind) for detailed usage. + * See the [documentation](https://weaviate.io/developers/weaviate/model-providers/imagebind/embeddings-multimodal) for detailed usage. */ export type Multi2VecBindConfig = { /** The audio fields used when vectorizing. */ @@ -111,9 +113,9 @@ export type Multi2VecBindConfig = { }; }; -/** The configuration for multi-media vectorization using Palm. +/** The configuration for multi-media vectorization using the PaLM model. * - * See the [documentation](https://weaviate.io/developers/weaviate/modules/retriever-vectorizer-modules/text2vec-palm) for detailed usage. + * 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. */ @@ -143,9 +145,9 @@ export type Multi2VecPalmConfig = { }; }; -/** The configuration for reference-based vectorization using centroids. +/** The configuration for reference-based vectorization using the centroid method. * - * See the [documentation](https://weaviate.io/developers/weaviate/modules/retriever-vectorizer-modules/ref2vec-centroid) for detailed usage. + * See the [documentation](https://weaviate.io/developers/weaviate/modules/ref2vec-centroid) for detailed usage. */ export type Ref2VecCentroidConfig = { /** The properties used as reference points for vectorization. */ @@ -154,7 +156,7 @@ export type Ref2VecCentroidConfig = { method: 'mean' | string; }; -/** The configuration for text vectorization using AWS. +/** The configuration for text vectorization using the AWS module. * * See the [documentation](https://weaviate.io/developers/weaviate/modules/retriever-vectorizer-modules/text2vec-aws) for detailed usage. */ @@ -171,9 +173,9 @@ export type Text2VecAWSConfig = { vectorizeCollectionName?: boolean; }; -/** The configuration for text vectorization using Azure OpenAI. +/** The configuration for text vectorization using the OpenAI module with Azure. * - * See the [documentation](https://weaviate.io/developers/weaviate/modules/retriever-vectorizer-modules/text2vec-azure-openai) for detailed usage. + * See the [documentation](https://weaviate.io/developers/weaviate/model-providers/openai/embeddings) for detailed usage. */ export type Text2VecAzureOpenAIConfig = { /** The base URL to use where API requests should go. */ @@ -186,9 +188,9 @@ export type Text2VecAzureOpenAIConfig = { vectorizeCollectionName?: boolean; }; -/** The configuration for text vectorization using Cohere. +/** The configuration for text vectorization using the Cohere module. * - * See the [documentation](https://weaviate.io/developers/weaviate/modules/retriever-vectorizer-modules/text2vec-cohere) for detailed usage. + * See the [documentation](https://weaviate.io/developers/weaviate/model-providers/cohere/embeddings) for detailed usage. */ export type Text2VecCohereConfig = { /** The base URL to use where API requests should go. */ @@ -201,18 +203,28 @@ export type Text2VecCohereConfig = { vectorizeCollectionName?: boolean; }; -/** The configuration for text vectorization using Contextionary. +/** The configuration for text vectorization using the Contextionary module. * - * See the [documentation](https://weaviate.io/developers/weaviate/modules/retriever-vectorizer-modules/text2vec-contextionary) for detailed usage. + * See the [documentation](https://weaviate.io/developers/weaviate/modules/text2vec-contextionary) for detailed usage. */ export type Text2VecContextionaryConfig = { /** Whether to vectorize the collection name. */ vectorizeCollectionName?: boolean; }; -/** The configuration for text vectorization using GPT4All. +/** The configuration for text vectorization using the Databricks module. * - * See the [documentation](https://weaviate.io/developers/weaviate/modules/retriever-vectorizer-modules/text2vec-gpt4all) for detailed usage. + * See the [documentation](https://weaviate.io/developers/weaviate/model-providers/databricks/embeddings) for detailed usage. + */ +export type Text2VecDatabricksConfig = { + endpoint: string; + instruction?: string; + vectorizeCollectionName?: boolean; +}; + +/** The configuration for text vectorization using the GPT-4-All module. + * + * See the [documentation](https://weaviate.io/developers/weaviate/model-providers/gpt4all/embeddings) for detailed usage. */ export type Text2VecGPT4AllConfig = { /** Whether to vectorize the collection name. */ @@ -220,9 +232,9 @@ export type Text2VecGPT4AllConfig = { }; /** - * The configuration for text vectorization using Hugging Face. + * The configuration for text vectorization using the HuggingFace module. * - * See the [documentation](https://weaviate.io/developers/weaviate/modules/retriever-vectorizer-modules/text2vec-huggingface) for detailed usage. + * See the [documentation](https://weaviate.io/developers/weaviate/model-providers/huggingface/embeddings) for detailed usage. */ export type Text2VecHuggingFaceConfig = { /** The endpoint URL to use. */ @@ -244,9 +256,9 @@ export type Text2VecHuggingFaceConfig = { }; /** - * The configuration for text vectorization using Jina. + * The configuration for text vectorization using the Jina module. * - * See the [documentation](https://weaviate.io/developers/weaviate/modules/retriever-vectorizer-modules/text2vec-jina) for detailed usage. + * See the [documentation](https://weaviate.io/developers/weaviate/model-providers/jinaai/embeddings) for detailed usage. */ export type Text2VecJinaConfig = { /** The model to use. */ @@ -256,9 +268,21 @@ export type Text2VecJinaConfig = { }; /** - * The configuration for text vectorization using OctoAI. + * The configuration for text vectorization using the Mistral module. + * + * See the [documentation](https://weaviate.io/developers/weaviate/model-providers/mistral/embeddings) for detailed usage. + */ +export type Text2VecMistralConfig = { + /** The model to use. */ + model?: 'mistral-embed' | string; + /** Whether to vectorize the collection name. */ + vectorizeCollectionName?: boolean; +}; + +/** + * The configuration for text vectorization using the OctoAI module. * - * See the [documentation](https://weaviate.io/developers/weaviate/modules/retriever-vectorizer-modules/text2vec-octoai) for detailed usage. + * See the [documentation](https://weaviate.io/developers/weaviate/model-providers/octoai/embeddings) for detailed usage. */ export type Text2VecOctoAIConfig = { /** The base URL to use where API requests should go. */ @@ -270,9 +294,9 @@ export type Text2VecOctoAIConfig = { }; /** - * The configuration for text vectorization using Ollama. + * The configuration for text vectorization using the Ollama module. * - * See the [documentation](https://weaviate.io/developers/weaviate/modules/retriever-vectorizer-modules/text2vec-ollama) for detailed usage. + * See the [documentation](https://weaviate.io/developers/weaviate/model-providers/ollama/embeddings) for detailed usage. */ export type Text2VecOllamaConfig = { /** The base URL to use where API requests should go. */ @@ -284,9 +308,9 @@ export type Text2VecOllamaConfig = { }; /** - * The configuration for text vectorization using OpenAI. + * The configuration for text vectorization using the OpenAI module. * - * See the [documentation](https://weaviate.io/developers/weaviate/modules/retriever-vectorizer-modules/text2vec-openai) for detailed usage. + * See the [documentation](https://weaviate.io/developers/weaviate/model-providers/openai/embeddings) for detailed usage. */ export type Text2VecOpenAIConfig = { /** The base URL to use where API requests should go. */ @@ -304,9 +328,9 @@ export type Text2VecOpenAIConfig = { }; /** - * The configuration for text vectorization using Palm. + * The configuration for text vectorization using the PaLM module. * - * See the [documentation](https://weaviate.io/developers/weaviate/modules/retriever-vectorizer-modules/text2vec-palm) for detailed usage. + * See the [documentation](https://weaviate.io/developers/weaviate/model-providers/google/embeddings) for detailed usage. */ export type Text2VecPalmConfig = { /** The API endpoint to use without a leading scheme such as `http://`. */ @@ -321,6 +345,11 @@ export type Text2VecPalmConfig = { vectorizeCollectionName?: boolean; }; +/** + * The configuration for text vectorization using the Transformers module. + * + * See the [documentation](https://weaviate.io/developers/weaviate/model-providers/transformers/embeddings) for detailed usage. + */ export type Text2VecTransformersConfig = { /** The inference url to use where API requests should go. You can use either this OR (`passage_inference_url` & `query_inference_url`). */ inferenceUrl?: string; @@ -335,9 +364,9 @@ export type Text2VecTransformersConfig = { }; /** - * The configuration for text vectorization using Voyage AI. + * The configuration for text vectorization using the VoyageAI module. * - * See the [documentation](https://weaviate.io/developers/weaviate/modules/retriever-vectorizer-modules/text2vec-voyageai) for detailed usage. + * See the [documentation](https://weaviate.io/developers/weaviate/model-providers/voyageai/embeddings) for detailed usage. */ export type Text2VecVoyageAIConfig = { /** The base URL to use where API requests should go. */ @@ -362,6 +391,7 @@ export type VectorizerConfig = | Text2VecAzureOpenAIConfig | Text2VecContextionaryConfig | Text2VecCohereConfig + | Text2VecDatabricksConfig | Text2VecGPT4AllConfig | Text2VecHuggingFaceConfig | Text2VecJinaConfig @@ -387,12 +417,16 @@ export type VectorizerConfigType = V extends 'img2vec-neural' ? Text2VecContextionaryConfig | undefined : V extends 'text2vec-cohere' ? Text2VecCohereConfig | undefined + : V extends 'text2vec-databricks' + ? Text2VecDatabricksConfig : V extends 'text2vec-gpt4all' ? Text2VecGPT4AllConfig | undefined : V extends 'text2vec-huggingface' ? Text2VecHuggingFaceConfig | undefined : V extends 'text2vec-jina' ? Text2VecJinaConfig | undefined + : V extends 'text2vec-mistral' + ? Text2VecMistralConfig | undefined : V extends 'text2vec-octoai' ? Text2VecOctoAIConfig | undefined : V extends 'text2vec-ollama' diff --git a/src/collections/configure/generative.ts b/src/collections/configure/generative.ts index 3ccb6b05..ebe8b15a 100644 --- a/src/collections/configure/generative.ts +++ b/src/collections/configure/generative.ts @@ -1,8 +1,11 @@ import { GenerativeAWSConfig, + GenerativeAnthropicConfig, GenerativeAnyscaleConfig, GenerativeAzureOpenAIConfig, GenerativeCohereConfig, + GenerativeDatabricksConfig, + GenerativeFriendliAIConfig, GenerativeMistralConfig, GenerativeOctoAIConfig, GenerativeOllamaConfig, @@ -12,9 +15,12 @@ import { } from '../config/types/index.js'; import { GenerativeAWSConfigCreate, + GenerativeAnthropicConfigCreate, GenerativeAnyscaleConfigCreate, GenerativeAzureOpenAIConfigCreate, GenerativeCohereConfigCreate, + GenerativeDatabricksConfigCreate, + GenerativeFriendliAIConfigCreate, GenerativeMistralConfigCreate, GenerativeOctoAIConfigCreate, GenerativeOllamaConfigCreate, @@ -23,12 +29,28 @@ import { } from '../index.js'; export default { + /** + * Create a `ModuleConfig<'generative-anthropic', GenerativeAnthropicConfig | undefined>` object for use when performing AI generation using the `generative-anthropic` module. + * + * See the [documentation](https://weaviate.io/developers/weaviate/model-providers/anthropic/generative) for detailed usage. + * + * @param {GenerativeAnthropicConfigCreate} [config] The configuration for the `generative-anthropic` module. + * @returns {ModuleConfig<'generative-anthropic', GenerativeAnthropicConfig | undefined>} The configuration object. + */ + anthropic( + config?: GenerativeAnthropicConfigCreate + ): ModuleConfig<'generative-anthropic', GenerativeAnthropicConfig | undefined> { + return { + name: 'generative-anthropic', + config, + }; + }, /** * Create a `ModuleConfig<'generative-anyscale', GenerativeAnyscaleConfig | undefined>` object for use when performing AI generation using the `generative-anyscale` module. * - * See the [documentation](https://weaviate.io/developers/weaviate/modules/reader-generator-modules/generative-anyscale) for detailed usage. + * See the [documentation](https://weaviate.io/developers/weaviate/model-providers/anyscale/generative) for detailed usage. * - * @param {GenerativeAnyscaleConfigCreate} config The configuration for the `generative-aws` module. + * @param {GenerativeAnyscaleConfigCreate} [config] The configuration for the `generative-aws` module. * @returns {ModuleConfig<'generative-anyscale', GenerativeAnyscaleConfig | undefined>} The configuration object. */ anyscale( @@ -42,7 +64,7 @@ export default { /** * Create a `ModuleConfig<'generative-aws', GenerativeAWSConfig>` object for use when performing AI generation using the `generative-aws` module. * - * See the [documentation](https://weaviate.io/developers/weaviate/modules/reader-generator-modules/generative-aws) for detailed usage. + * See the [documentation](https://weaviate.io/developers/weaviate/model-providers/aws/generative) for detailed usage. * * @param {GenerativeAWSConfigCreate} config The configuration for the `generative-aws` module. * @returns {ModuleConfig<'generative-aws', GenerativeAWSConfig>} The configuration object. @@ -56,7 +78,7 @@ export default { /** * Create a `ModuleConfig<'generative-openai', GenerativeAzureOpenAIConfig>` object for use when performing AI generation using the `generative-openai` module. * - * See the [documentation](https://weaviate.io/developers/weaviate/modules/reader-generator-modules/generative-openai) for detailed usage. + * See the [documentation](https://weaviate.io/developers/weaviate/model-providers/openai/generative) for detailed usage. * * @param {GenerativeAzureOpenAIConfigCreate} config The configuration for the `generative-openai` module. * @returns {ModuleConfig<'generative-openai', GenerativeAzureOpenAIConfig>} The configuration object. @@ -81,10 +103,10 @@ export default { /** * Create a `ModuleConfig<'generative-cohere', GenerativeCohereConfig>` object for use when performing AI generation using the `generative-cohere` module. * - * See the [documentation](https://weaviate.io/developers/weaviate/modules/reader-generator-modules/generative-cohere) for detailed usage. + * See the [documentation](https://weaviate.io/developers/weaviate/model-providers/cohere/generative) for detailed usage. * * @param {GenerativeCohereConfigCreate} [config] The configuration for the `generative-cohere` module. - * @returns {ModuleConfig<'generative-cohere', GenerativeCohereConfig>} The configuration object. + * @returns {ModuleConfig<'generative-cohere', GenerativeCohereConfig | undefined>} The configuration object. */ cohere: ( config?: GenerativeCohereConfigCreate @@ -103,10 +125,39 @@ export default { : undefined, }; }, + /** + * Create a `ModuleConfig<'generative-databricks', GenerativeDatabricksConfig>` object for use when performing AI generation using the `generative-databricks` module. + * + * See the [documentation](https://weaviate.io/developers/weaviate/model-providers/databricks/generative) for detailed usage. + * + * @param {GenerativeDatabricksConfigCreate} config The configuration for the `generative-databricks` module. + * @returns {ModuleConfig<'generative-databricks', GenerativeDatabricksConfig>} The configuration object. + */ + databricks: ( + config: GenerativeDatabricksConfigCreate + ): ModuleConfig<'generative-databricks', GenerativeDatabricksConfig> => { + return { + name: 'generative-databricks', + config, + }; + }, + /** + * Create a `ModuleConfig<'generative-friendliai', GenerativeFriendliAIConfig | undefined>` object for use when performing AI generation using the `generative-friendliai` module. + * + * See the [documentation](https://weaviate.io/developers/weaviate/model-providers/friendliai/generative) for detailed usage. + */ + friendliai( + config?: GenerativeFriendliAIConfigCreate + ): ModuleConfig<'generative-friendliai', GenerativeFriendliAIConfig | undefined> { + return { + name: 'generative-friendliai', + config, + }; + }, /** * Create a `ModuleConfig<'generative-mistral', GenerativeMistralConfig | undefined>` object for use when performing AI generation using the `generative-mistral` module. * - * See the [documentation](https://weaviate.io/developers/weaviate/modules/reader-generator-modules/generative-mistral) for detailed usage. + * See the [documentation](https://weaviate.io/developers/weaviate/model-providers/mistral/generative) for detailed usage. * * @param {GenerativeMistralConfigCreate} [config] The configuration for the `generative-mistral` module. * @returns {ModuleConfig<'generative-mistral', GenerativeMistralConfig | undefined>} The configuration object. @@ -122,7 +173,7 @@ export default { /** * Create a `ModuleConfig<'generative-octoai', GenerativeOpenAIConfig | undefined>` object for use when performing AI generation using the `generative-octoai` module. * - * See the [documentation](https://weaviate.io/developers/weaviate/modules/reader-generator-modules/generative-octoai) for detailed usage. + * See the [documentation](https://weaviate.io/developers/weaviate/model-providers/octoai/generative) for detailed usage. * * @param {GenerativeOctoAIConfigCreate} [config] The configuration for the `generative-octoai` module. * @returns {ModuleConfig<'generative-octoai', GenerativeOctoAIConfig | undefined>} The configuration object. @@ -138,7 +189,7 @@ export default { /** * Create a `ModuleConfig<'generative-ollama', GenerativeOllamaConfig | undefined>` object for use when performing AI generation using the `generative-ollama` module. * - * See the [documentation](https://weaviate.io/developers/weaviate/modules/reader-generator-modules/generative-ollama) for detailed usage. + * See the [documentation](https://weaviate.io/developers/weaviate/model-providers/ollama/generative) for detailed usage. * * @param {GenerativeOllamaConfigCreate} [config] The configuration for the `generative-openai` module. * @returns {ModuleConfig<'generative-ollama', GenerativeOllamaConfig | undefined>} The configuration object. @@ -154,7 +205,7 @@ export default { /** * Create a `ModuleConfig<'generative-openai', GenerativeOpenAIConfig | undefined>` object for use when performing AI generation using the `generative-openai` module. * - * See the [documentation](https://weaviate.io/developers/weaviate/modules/reader-generator-modules/generative-openai) for detailed usage. + * See the [documentation](https://weaviate.io/developers/weaviate/model-providers/openai/generative) for detailed usage. * * @param {GenerativeOpenAIConfigCreate} [config] The configuration for the `generative-openai` module. * @returns {ModuleConfig<'generative-openai', GenerativeOpenAIConfig | undefined>} The configuration object. @@ -180,7 +231,7 @@ export default { /** * Create a `ModuleConfig<'generative-palm', GenerativePaLMConfig>` object for use when performing AI generation using the `generative-palm` module. * - * See the [documentation](https://weaviate.io/developers/weaviate/modules/reader-generator-modules/generative-palm) for detailed usage. + * 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. diff --git a/src/collections/configure/reranker.ts b/src/collections/configure/reranker.ts index f16a8c00..0070e3ed 100644 --- a/src/collections/configure/reranker.ts +++ b/src/collections/configure/reranker.ts @@ -9,7 +9,7 @@ export default { /** * Create a `ModuleConfig<'reranker-cohere', RerankerCohereConfig>` object for use when reranking using the `reranker-cohere` module. * - * See the [documentation](https://weaviate.io/developers/weaviate/modules/retriever-vectorizer-modules/reranker-cohere) for detailed usage. + * See the [documentation](https://weaviate.io/developers/weaviate/model-providers/cohere/reranker) for detailed usage. * * @param {RerankerCohereConfig} [config] The configuration for the `reranker-cohere` module. * @returns {ModuleConfig<'reranker-cohere', RerankerCohereConfig>} The configuration object. @@ -25,7 +25,7 @@ export default { /** * Create a `ModuleConfig<'reranker-jinaai', RerankerJinaAIConfig>` object for use when reranking using the `reranker-jinaai` module. * - * See the [documentation](https://weaviate.io/developers/weaviate/modules/retriever-vectorizer-modules/reranker-jinaai) for detailed usage. + * See the [documentation](https://weaviate.io/developers/weaviate/model-providers/jinaai/reranker) for detailed usage. * * @param {RerankerJinaAIConfig} [config] The configuration for the `reranker-jinaai` module. * @returns {ModuleConfig<'reranker-jinaai', RerankerJinaAIConfig | undefined>} The configuration object. @@ -41,7 +41,7 @@ export default { /** * Create a `ModuleConfig<'reranker-transformers', Record>` object for use when reranking using the `reranker-transformers` module. * - * See the [documentation](https://weaviate.io/developers/weaviate/modules/retriever-vectorizer-modules/reranker-transformers) for detailed usage. + * See the [documentation](https://weaviate.io/developers/weaviate/model-providers/transformers/reranker) for detailed usage. * * @returns {ModuleConfig<'reranker-transformers', Record>} The configuration object. */ @@ -54,7 +54,7 @@ export default { /** * Create a `ModuleConfig<'reranker-voyageai', RerankerVoyageAIConfig>` object for use when reranking using the `reranker-voyageai` module. * - * See the [documentation](https://weaviate.io/developers/weaviate/modules/retriever-vectorizer-modules/reranker-voyageai) for detailed usage. + * See the [documentation](https://weaviate.io/developers/weaviate/model-providers/voyageai/reranker) for detailed usage. * * @param {RerankerVoyageAIConfig} [config] The configuration for the `reranker-voyage-ai` module. * @returns {ModuleConfig<'reranker-voyage-ai', RerankerVoyageAIConfig | undefined>} The configuration object. diff --git a/src/collections/configure/types/generative.ts b/src/collections/configure/types/generative.ts index 52f23aaf..59df7f88 100644 --- a/src/collections/configure/types/generative.ts +++ b/src/collections/configure/types/generative.ts @@ -1,6 +1,9 @@ import { GenerativeAWSConfig, + GenerativeAnthropicConfig, GenerativeAnyscaleConfig, + GenerativeDatabricksConfig, + GenerativeFriendliAIConfig, GenerativeMistralConfig, GenerativeOctoAIConfig, GenerativeOllamaConfig, @@ -16,9 +19,11 @@ export type GenerativeOpenAIConfigBaseCreate = { topP?: number; }; -export type GenerativeOpenAIConfigCreate = GenerativeOpenAIConfigBaseCreate & { - model?: string; -}; +export type GenerativeAnthropicConfigCreate = GenerativeAnthropicConfig; + +export type GenerativeAnyscaleConfigCreate = GenerativeAnyscaleConfig; + +export type GenerativeAWSConfigCreate = GenerativeAWSConfig; export type GenerativeAzureOpenAIConfigCreate = GenerativeOpenAIConfigBaseCreate & { resourceName: string; @@ -34,9 +39,9 @@ export type GenerativeCohereConfigCreate = { temperature?: number; }; -export type GenerativeAnyscaleConfigCreate = GenerativeAnyscaleConfig; +export type GenerativeDatabricksConfigCreate = GenerativeDatabricksConfig; -export type GenerativeAWSConfigCreate = GenerativeAWSConfig; +export type GenerativeFriendliAIConfigCreate = GenerativeFriendliAIConfig; export type GenerativeMistralConfigCreate = GenerativeMistralConfig; @@ -44,19 +49,48 @@ export type GenerativeOctoAIConfigCreate = GenerativeOctoAIConfig; export type GenerativeOllamaConfigCreate = GenerativeOllamaConfig; +export type GenerativeOpenAIConfigCreate = GenerativeOpenAIConfigBaseCreate & { + model?: string; +}; + export type GenerativePaLMConfigCreate = GenerativePaLMConfig; export type GenerativeConfigCreate = - | GenerativeOpenAIConfigCreate + | GenerativeAnthropicConfigCreate + | GenerativeAnyscaleConfigCreate + | GenerativeAWSConfigCreate + | GenerativeAzureOpenAIConfigCreate | GenerativeCohereConfigCreate + | GenerativeDatabricksConfigCreate + | GenerativeFriendliAIConfigCreate + | GenerativeMistralConfigCreate + | GenerativeOctoAIConfigCreate + | GenerativeOllamaConfigCreate + | GenerativeOpenAIConfigCreate | GenerativePaLMConfigCreate | Record | undefined; -export type GenerativeConfigCreateType = G extends 'generative-openai' - ? GenerativeOpenAIConfigCreate +export type GenerativeConfigCreateType = G extends 'generative-anthropic' + ? GenerativeAnthropicConfigCreate + : G extends 'generative-aws' + ? GenerativeAWSConfigCreate + : G extends 'generative-azure-openai' + ? GenerativeAzureOpenAIConfigCreate : G extends 'generative-cohere' ? GenerativeCohereConfigCreate + : G extends 'generative-databricks' + ? GenerativeDatabricksConfigCreate + : G extends 'generative-friendliai' + ? GenerativeFriendliAIConfigCreate + : G extends 'generative-mistral' + ? GenerativeMistralConfigCreate + : G extends 'generative-octoai' + ? GenerativeOctoAIConfigCreate + : G extends 'generative-ollama' + ? GenerativeOllamaConfigCreate + : G extends 'generative-openai' + ? GenerativeOpenAIConfigCreate : G extends 'generative-palm' ? GenerativePaLMConfigCreate : G extends 'none' diff --git a/src/collections/configure/types/vectorizer.ts b/src/collections/configure/types/vectorizer.ts index 6f41ccc5..46b88cc3 100644 --- a/src/collections/configure/types/vectorizer.ts +++ b/src/collections/configure/types/vectorizer.ts @@ -7,9 +7,11 @@ import { Text2VecAzureOpenAIConfig, Text2VecCohereConfig, Text2VecContextionaryConfig, + Text2VecDatabricksConfig, Text2VecGPT4AllConfig, Text2VecHuggingFaceConfig, Text2VecJinaConfig, + Text2VecMistralConfig, Text2VecOctoAIConfig, Text2VecOllamaConfig, Text2VecOpenAIConfig, @@ -139,12 +141,16 @@ export type Text2VecCohereConfigCreate = Text2VecCohereConfig; export type Text2VecContextionaryConfigCreate = Text2VecContextionaryConfig; +export type Text2VecDatabricksConfigCreate = Text2VecDatabricksConfig; + export type Text2VecGPT4AllConfigCreate = Text2VecGPT4AllConfig; export type Text2VecHuggingFaceConfigCreate = Text2VecHuggingFaceConfig; export type Text2VecJinaConfigCreate = Text2VecJinaConfig; +export type Text2VecMistralConfigCreate = Text2VecMistralConfig; + export type Text2VecOctoAIConfigCreate = Text2VecOctoAIConfig; export type Text2VecOllamaConfigCreate = Text2VecOllamaConfig; @@ -173,12 +179,16 @@ export type VectorizerConfigCreateType = V extends 'img2vec-neural' ? Text2VecContextionaryConfigCreate | undefined : V extends 'text2vec-cohere' ? Text2VecCohereConfigCreate | undefined + : V extends 'text2vec-databricks' + ? Text2VecDatabricksConfigCreate : V extends 'text2vec-gpt4all' ? Text2VecGPT4AllConfigCreate | undefined : V extends 'text2vec-huggingface' ? Text2VecHuggingFaceConfigCreate | undefined : V extends 'text2vec-jina' ? Text2VecJinaConfigCreate | undefined + : V extends 'text2vec-mistral' + ? Text2VecMistralConfigCreate | undefined : V extends 'text2vec-octoai' ? Text2VecOctoAIConfigCreate | undefined : V extends 'text2vec-ollama' diff --git a/src/collections/configure/unit.test.ts b/src/collections/configure/unit.test.ts index f1ffd18d..fbd28df3 100644 --- a/src/collections/configure/unit.test.ts +++ b/src/collections/configure/unit.test.ts @@ -1,8 +1,11 @@ import { GenerativeAWSConfig, + GenerativeAnthropicConfig, GenerativeAnyscaleConfig, GenerativeAzureOpenAIConfig, GenerativeCohereConfig, + GenerativeDatabricksConfig, + GenerativeFriendliAIConfig, GenerativeMistralConfig, GenerativeOctoAIConfig, GenerativeOllamaConfig, @@ -701,6 +704,50 @@ describe('Unit testing of the vectorizer factory class', () => { }); }); + it('should create the correct Text2VecDatabricksConfig type with required & defaults', () => { + const config = configure.vectorizer.text2VecDatabricks({ + name: 'test', + endpoint: 'endpoint', + }); + expect(config).toEqual>({ + name: 'test', + vectorIndex: { + name: 'hnsw', + config: undefined, + }, + vectorizer: { + name: 'text2vec-databricks', + config: { + endpoint: 'endpoint', + }, + }, + }); + }); + + it('should create the correct Text2VecDatabricksConfig type with all values', () => { + const config = configure.vectorizer.text2VecDatabricks({ + name: 'test', + endpoint: 'endpoint', + instruction: 'instruction', + vectorizeCollectionName: true, + }); + expect(config).toEqual>({ + name: 'test', + vectorIndex: { + name: 'hnsw', + config: undefined, + }, + vectorizer: { + name: 'text2vec-databricks', + config: { + endpoint: 'endpoint', + instruction: 'instruction', + vectorizeCollectionName: true, + }, + }, + }); + }); + it('should create the correct Text2VecGPT4AllConfig type with defaults', () => { const config = configure.vectorizer.text2VecGPT4All(); expect(config).toEqual>({ @@ -822,6 +869,43 @@ describe('Unit testing of the vectorizer factory class', () => { }); }); + it('should create the correct Text2VecMistralConfig type with defaults', () => { + const config = configure.vectorizer.text2VecMistral(); + expect(config).toEqual>({ + name: undefined, + vectorIndex: { + name: 'hnsw', + config: undefined, + }, + vectorizer: { + name: 'text2vec-mistral', + config: undefined, + }, + }); + }); + + it('should create the correct Text2VecMistralConfig type with all values', () => { + const config = configure.vectorizer.text2VecMistral({ + name: 'test', + model: 'model', + vectorizeCollectionName: true, + }); + expect(config).toEqual>({ + name: 'test', + vectorIndex: { + name: 'hnsw', + config: undefined, + }, + vectorizer: { + name: 'text2vec-mistral', + config: { + model: 'model', + vectorizeCollectionName: true, + }, + }, + }); + }); + it('should create the correct Text2VecOctoAIConfig type with defaults', () => { const config = configure.vectorizer.text2VecOctoAI(); expect(config).toEqual>({ @@ -1066,6 +1150,36 @@ describe('Unit testing of the vectorizer factory class', () => { }); describe('Unit testing of the generative factory class', () => { + it('should create the correct GenerativeAnthropicConfig type with required & default values', () => { + const config = configure.generative.anthropic(); + expect(config).toEqual>({ + name: 'generative-anthropic', + config: undefined, + }); + }); + + it('should create the correct GenerativeAnthropicConfig type with all values', () => { + const config = configure.generative.anthropic({ + maxTokens: 100, + model: 'model', + stopSequences: ['stop1', 'stop2'], + temperature: 0.5, + topK: 10, + topP: 0.8, + }); + expect(config).toEqual>({ + name: 'generative-anthropic', + config: { + maxTokens: 100, + model: 'model', + stopSequences: ['stop1', 'stop2'], + temperature: 0.5, + topK: 10, + topP: 0.8, + }, + }); + }); + it('should create the correct GenerativeAnyscaleConfig type with required & default values', () => { const config = configure.generative.anyscale(); expect(config).toEqual>({ @@ -1190,6 +1304,64 @@ describe('Unit testing of the generative factory class', () => { }); }); + it('should create the correct GenerativeDatabricksConfig type with required & default values', () => { + const config = configure.generative.databricks({ + endpoint: 'endpoint', + }); + expect(config).toEqual>({ + name: 'generative-databricks', + config: { + endpoint: 'endpoint', + }, + }); + }); + + it('should create the correct GenerativeDatabricksConfig type with all values', () => { + const config = configure.generative.databricks({ + endpoint: 'endpoint', + maxTokens: 100, + temperature: 0.5, + topK: 10, + topP: 0.8, + }); + expect(config).toEqual>({ + name: 'generative-databricks', + config: { + endpoint: 'endpoint', + maxTokens: 100, + temperature: 0.5, + topK: 10, + topP: 0.8, + }, + }); + }); + + it('should create the correct GenerativeFriendliAIConfig type with required & default values', () => { + const config = configure.generative.friendliai(); + expect(config).toEqual>({ + name: 'generative-friendliai', + config: undefined, + }); + }); + + it('should create the correct GenerativeFriendliAIConfig type with all values', () => { + const config = configure.generative.friendliai({ + baseURL: 'base-url', + maxTokens: 100, + model: 'model', + temperature: 0.5, + }); + expect(config).toEqual>({ + name: 'generative-friendliai', + config: { + baseURL: 'base-url', + maxTokens: 100, + model: 'model', + temperature: 0.5, + }, + }); + }); + it('should create the correct GenerativeMistralConfig type with required & default values', () => { const config = configure.generative.mistral(); expect(config).toEqual>({ diff --git a/src/collections/configure/vectorizer.ts b/src/collections/configure/vectorizer.ts index 60711d8d..61477951 100644 --- a/src/collections/configure/vectorizer.ts +++ b/src/collections/configure/vectorizer.ts @@ -64,7 +64,7 @@ export const vectorizer = { /** * Create a `VectorConfigCreate` object with the vectorizer set to `'img2vec-neural'`. * - * See the [documentation](https://weaviate.io/developers/weaviate/modules/retriever-vectorizer-modules/img2vec-neural) for detailed usage. + * See the [documentation](https://weaviate.io/developers/weaviate/modules/img2vec-neural) for detailed usage. * * @param {ConfigureNonTextVectorizerOptions} [opts] The configuration options for the `img2vec-neural` vectorizer. * @returns {VectorConfigCreate[], N, I, 'img2vec-neural'>} The configuration object. @@ -84,7 +84,7 @@ export const vectorizer = { /** * Create a `VectorConfigCreate` object with the vectorizer set to `'multi2vec-bind'`. * - * See the [documentation](https://weaviate.io/developers/weaviate/modules/retriever-vectorizer-modules/multi2vec-bind) for detailed usage. + * See the [documentation](https://weaviate.io/developers/weaviate/model-providers/imagebind/embeddings-multimodal) for detailed usage. * * @param {ConfigureNonTextVectorizerOptions} [opts] The configuration options for the `multi2vec-bind` vectorizer. * @returns {VectorConfigCreate[], N, I, 'multi2vec-bind'>} The configuration object. @@ -132,7 +132,7 @@ export const vectorizer = { /** * Create a `VectorConfigCreate` object with the vectorizer set to `'multi2vec-clip'`. * - * See the [documentation](https://weaviate.io/developers/weaviate/modules/retriever-vectorizer-modules/multi2vec-clip) for detailed usage. + * See the [documentation](https://weaviate.io/developers/weaviate/model-providers/transformers/embeddings-multimodal) for detailed usage. * * @param {ConfigureNonTextVectorizerOptions} [opts] The configuration options for the `multi2vec-clip` vectorizer. * @returns {VectorConfigCreate[], N, I, 'multi2vec-clip'>} The configuration object. @@ -165,7 +165,7 @@ export const vectorizer = { /** * Create a `VectorConfigCreate` object with the vectorizer set to `'multi2vec-palm'`. * - * See the [documentation](https://weaviate.io/developers/weaviate/modules/retriever-vectorizer-modules/multi2vec-palm) for detailed usage. + * See the [documentation](https://weaviate.io/developers/weaviate/model-providers/google/embeddings-multimodal) for detailed usage. * * @param {ConfigureNonTextVectorizerOptions} opts The configuration options for the `multi2vec-palm` vectorizer. * @returns {VectorConfigCreate[], N, I, 'multi2vec-palm'>} The configuration object. @@ -198,7 +198,7 @@ export const vectorizer = { /** * Create a `VectorConfigCreate` object with the vectorizer set to `'ref2vec-centroid'`. * - * See the [documentation](https://weaviate.io/developers/weaviate/modules/retriever-vectorizer-modules/ref2vec-centroid) for detailed usage. + * See the [documentation](https://weaviate.io/developers/weaviate/modules/ref2vec-centroid) for detailed usage. * * @param {ConfigureNonTextVectorizerOptions} opts The configuration options for the `ref2vec-centroid` vectorizer. * @returns {VectorConfigCreate} The configuration object. @@ -218,7 +218,7 @@ export const vectorizer = { /** * Create a `VectorConfigCreate` object with the vectorizer set to `'text2vec-aws'`. * - * See the [documentation](https://weaviate.io/developers/weaviate/modules/retriever-vectorizer-modules/text2vec-aws) for detailed usage. + * See the [documentation](https://weaviate.io/developers/weaviate/model-providers/aws/embeddings) for detailed usage. * * @param {ConfigureTextVectorizerOptions} opts The configuration options for the `text2vec-aws` vectorizer. * @returns { VectorConfigCreate, N, I, 'text2vec-aws'>} The configuration object. @@ -239,7 +239,7 @@ export const vectorizer = { /** * Create a `VectorConfigCreate` object with the vectorizer set to `'text2vec-azure-openai'`. * - * See the [documentation](https://weaviate.io/developers/weaviate/modules/retriever-vectorizer-modules/text2vec-openai) for detailed usage. + * See the [documentation](https://weaviate.io/developers/weaviate/model-providers/openai/embeddings) for detailed usage. * * @param {ConfigureTextVectorizerOptions} opts The configuration options for the `text2vec-azure-openai` vectorizer. * @returns {VectorConfigCreate, N, I, 'text2vec-azure-openai'>} The configuration object. @@ -260,7 +260,7 @@ export const vectorizer = { /** * Create a `VectorConfigCreate` object with the vectorizer set to `'text2vec-cohere'`. * - * See the [documentation](https://weaviate.io/developers/weaviate/modules/retriever-vectorizer-modules/text2vec-cohere) for detailed usage. + * See the [documentation](https://weaviate.io/developers/weaviate/model-providers/cohere/embeddings) for detailed usage. * * @param {ConfigureTextVectorizerOptions} [opts] The configuration options for the `text2vec-cohere` vectorizer. * @returns {VectorConfigCreate, N, I, 'text2vec-cohere'>} The configuration object. @@ -281,7 +281,7 @@ export const vectorizer = { /** * Create a `VectorConfigCreate` object with the vectorizer set to `'text2vec-contextionary'`. * - * See the [documentation](https://weaviate.io/developers/weaviate/modules/retriever-vectorizer-modules/text2vec-contextionary) for detailed usage. + * See the [documentation](https://weaviate.io/developers/weaviate/modules/text2vec-contextionary) for detailed usage. * * @param {ConfigureTextVectorizerOptions} [opts] The configuration for the `text2vec-contextionary` vectorizer. * @returns {VectorConfigCreate, N, I, 'text2vec-contextionary'>} The configuration object. @@ -299,10 +299,31 @@ export const vectorizer = { }, }); }, + /** + * Create a `VectorConfigCreate` object with the vectorizer set to `'text2vec-databricks'`. + * + * See the [documentation](https://weaviate.io/developers/weaviate/model-providers/databricks/embeddings) for detailed usage. + * + * @param {ConfigureTextVectorizerOptions} opts The configuration for the `text2vec-databricks` vectorizer. + * @returns {VectorConfigCreate, N, I, 'text2vec-databricks'>} The configuration object. + */ + text2VecDatabricks: ( + opts: ConfigureTextVectorizerOptions + ): VectorConfigCreate, N, I, 'text2vec-databricks'> => { + const { name, sourceProperties, vectorIndexConfig, ...config } = opts; + return makeVectorizer(name, { + sourceProperties, + vectorIndexConfig, + vectorizerConfig: { + name: 'text2vec-databricks', + config: config, + }, + }); + }, /** * Create a `VectorConfigCreate` object with the vectorizer set to `'text2vec-gpt4all'`. * - * See the [documentation](https://weaviate.io/developers/weaviate/modules/retriever-vectorizer-modules/text2vec-gpt4all) for detailed usage. + * See the [documentation](https://weaviate.io/developers/weaviate/model-providers/gpt4all/embeddings) for detailed usage. * * @param {ConfigureTextVectorizerOptions} [opts] The configuration for the `text2vec-contextionary` vectorizer. * @returns {VectorConfigCreate, N, I, 'text2vec-gpt4all'>} The configuration object. @@ -323,7 +344,7 @@ export const vectorizer = { /** * Create a `VectorConfigCreate` object with the vectorizer set to `'text2vec-huggingface'`. * - * See the [documentation](https://weaviate.io/developers/weaviate/modules/retriever-vectorizer-modules/text2vec-huggingface) for detailed usage. + * See the [documentation](https://weaviate.io/developers/weaviate/model-providers/huggingface/embeddings) for detailed usage. * * @param {ConfigureTextVectorizerOptions} [opts] The configuration for the `text2vec-contextionary` vectorizer. * @returns {VectorConfigCreate, N, I, 'text2vec-huggingface'>} The configuration object. @@ -344,7 +365,7 @@ export const vectorizer = { /** * Create a `VectorConfigCreate` object with the vectorizer set to `'text2vec-jina'`. * - * See the [documentation](https://weaviate.io/developers/weaviate/modules/retriever-vectorizer-modules/text2vec-jina) for detailed usage. + * See the [documentation](https://weaviate.io/developers/weaviate/model-providers/jinaai/embeddings) for detailed usage. * * @param {ConfigureTextVectorizerOptions} [opts] The configuration for the `text2vec-jina` vectorizer. * @returns {VectorConfigCreate, N, I, 'text2vec-jina'>} The configuration object. @@ -363,7 +384,33 @@ export const vectorizer = { }); }, /** + * Create a `VectorConfigCreate` object with the vectorizer set to `'text2vec-mistral'`. + * + * See the [documentation](https://weaviate.io/developers/weaviate/model-providers/mistral/embeddings) for detailed usage. + * + * @param {ConfigureTextVectorizerOptions} [opts] The configuration for the `text2vec-mistral` vectorizer. + * @returns {VectorConfigCreate, N, I, 'text2vec-mistral'>} The configuration object. + */ + text2VecMistral: ( + opts?: ConfigureTextVectorizerOptions + ): VectorConfigCreate, N, I, 'text2vec-mistral'> => { + const { name, sourceProperties, vectorIndexConfig, ...config } = opts || {}; + return makeVectorizer(name, { + sourceProperties, + vectorIndexConfig, + vectorizerConfig: { + name: 'text2vec-mistral', + config: Object.keys(config).length === 0 ? undefined : config, + }, + }); + }, + /** + * Create a `VectorConfigCreate` object with the vectorizer set to `'text2vec-octoai'`. + * + * See the [documentation](https://weaviate.io/developers/weaviate/model-providers/octoai/embeddings) for detailed usage. * + * @param {ConfigureTextVectorizerOptions} [opts] The configuration for the `text2vec-octoai` vectorizer. + * @returns {VectorConfigCreate, N, I, 'text2vec-octoai'>} The configuration object. */ text2VecOctoAI: ( opts?: ConfigureTextVectorizerOptions @@ -381,7 +428,7 @@ export const vectorizer = { /** * Create a `VectorConfigCreate` object with the vectorizer set to `'text2vec-openai'`. * - * See the [documentation](https://weaviate.io/developers/weaviate/modules/retriever-vectorizer-modules/text2vec-openai) for detailed usage. + * See the [documentation](https://weaviate.io/developers/weaviate/model-providers/openai/embeddings) for detailed usage. * * @param {ConfigureTextVectorizerOptions} [opts] The configuration for the `text2vec-openai` vectorizer. * @returns {VectorConfigCreate, N, I, 'text2vec-openai'>} The configuration object. @@ -402,7 +449,7 @@ export const vectorizer = { /** * Create a `VectorConfigCreate` object with the vectorizer set to `'text2vec-ollama'`. * - * See the [documentation](https://weaviate.io/developers/weaviate/modules/retriever-vectorizer-modules/text2vec-ollama) for detailed usage. + * See the [documentation](https://weaviate.io/developers/weaviate/model-providers/ollama/embeddings) for detailed usage. * * @param {ConfigureTextVectorizerOptions} [opts] The configuration for the `text2vec-ollama` vectorizer. * @returns {VectorConfigCreate, N, I, 'text2vec-ollama'>} The configuration object. @@ -423,7 +470,7 @@ export const vectorizer = { /** * Create a `VectorConfigCreate` object with the vectorizer set to `'text2vec-palm'`. * - * See the [documentation](https://weaviate.io/developers/weaviate/modules/retriever-vectorizer-modules/text2vec-palm) for detailed usage. + * See the [documentation](https://weaviate.io/developers/weaviate/model-providers/google/embeddings) for detailed usage. * * @param {ConfigureTextVectorizerOptions} opts The configuration for the `text2vec-palm` vectorizer. * @returns {VectorConfigCreate, N, I, 'text2vec-palm'>} The configuration object. @@ -444,7 +491,7 @@ export const vectorizer = { /** * Create a `VectorConfigCreate` object with the vectorizer set to `'text2vec-transformers'`. * - * See the [documentation](https://weaviate.io/developers/weaviate/modules/retriever-vectorizer-modules/text2vec-transformers) for detailed usage. + * See the [documentation](https://weaviate.io/developers/weaviate/model-providers/transformers/embeddings) for detailed usage. * * @param {ConfigureTextVectorizerOptions} [opts] The configuration for the `text2vec-transformers` vectorizer. * @returns {VectorConfigCreate, N, I, 'text2vec-transformers'>} The configuration object. @@ -465,7 +512,7 @@ export const vectorizer = { /** * Create a `VectorConfigCreate` object with the vectorizer set to `'text2vec-voyageai'`. * - * See the [documentation](https://weaviate.io/developers/weaviate/modules/retriever-vectorizer-modules/text2vec-voyageai) for detailed usage. + * See the [documentation](https://weaviate.io/developers/weaviate/model-providers/voyageai/embeddings) for detailed usage. * * @param {ConfigureTextVectorizerOptions} [opts] The configuration for the `text2vec-voyageai` vectorizer. * @returns {VectorConfigCreate, N, I, 'text2vec-voyageai'>} The configuration object. diff --git a/src/collections/index.ts b/src/collections/index.ts index da7d49d5..0472c459 100644 --- a/src/collections/index.ts +++ b/src/collections/index.ts @@ -129,7 +129,9 @@ const collections = (connection: Connection, dbVersionSupport: DbVersionSupport) const moduleConfig: any = {}; if (config.generative) { - moduleConfig[config.generative.name] = config.generative.config ? config.generative.config : {}; + const generative = + config.generative.name === 'generative-azure-openai' ? 'generative-openai' : config.generative.name; + moduleConfig[generative] = config.generative.config ? config.generative.config : {}; } if (config.reranker) { moduleConfig[config.reranker.name] = config.reranker.config ? config.reranker.config : {};