Skip to content

Commit de54a41

Browse files
authored
Merge pull request #274 from weaviate/add-support-for-multi2vec-cohere-module
Add support for multi2vec-cohere module
2 parents b8bbefc + b8c9ad2 commit de54a41

File tree

6 files changed

+29
-5
lines changed

6 files changed

+29
-5
lines changed

.cicd/test.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,11 @@ function check_creates_template() {
126126
check_modules "--set modules.qna-openai.enabled=true --set modules.qna-openai.apiKey=apiKey --set modules.generative-openai.enabled=true --set modules.generative-openai.apiKey=apiKey" "value: qna-openai,generative-openai"
127127
check_modules "--set modules.generative-cohere.enabled=true" "value: generative-cohere"
128128
check_modules "--set modules.reranker-cohere.enabled=true" "value: reranker-cohere"
129+
check_modules "--set modules.multi2vec-cohere.enabled=true" "value: multi2vec-cohere"
129130
check_modules "--set modules.text2vec-cohere.enabled=true --set modules.text2vec-cohere.apiKey=apiKey --set modules.generative-cohere.enabled=true --set modules.generative-cohere.apiKey=apiKey" "value: generative-cohere,text2vec-cohere"
130131
check_modules "--set modules.text2vec-cohere.enabled=true --set modules.text2vec-cohere.apiKey=apiKey --set modules.generative-cohere.enabled=true --set modules.generative-cohere.apiKey=apiKey --set modules.reranker-cohere.enabled=true --set modules.reranker-cohere.apiKey=apiKey" "value: generative-cohere,text2vec-cohere,reranker-cohere"
131132
check_modules "--set modules.text2vec-cohere.enabled=true --set modules.text2vec-cohere.apiKey=apiKey --set modules.reranker-cohere.enabled=true --set modules.reranker-cohere.apiKey=apiKey" "value: text2vec-cohere,reranker-cohere"
133+
check_modules "--set modules.text2vec-cohere.enabled=true --set modules.text2vec-cohere.apiKey=apiKey --set modules.multi2vec-cohere.enabled=true --set modules.multi2vec-cohere.apiKey=apiKey" "value: multi2vec-cohere,text2vec-cohere"
132134
check_modules "--set modules.generative-cohere.enabled=true --set modules.generative-cohere.apiKey=apiKey" "value: generative-cohere"
133135
check_modules "--set modules.text2vec-palm.enabled=true" "value: text2vec-palm"
134136
check_modules "--set modules.generative-palm.enabled=true" "value: generative-palm"
@@ -223,6 +225,7 @@ function check_creates_template() {
223225
check_string_existence "--set modules.generative-databricks.enabled=true --set modules.generative-databricks.token=databricksToken --set modules.text2vec-databricks.enabled=true --set modules.text2vec-databricks.token=databricksToken" "name: DATABRICKS_TOKEN"
224226
check_string_existence "--set modules.text2vec-mistral.enabled=true --set modules.text2vec-mistral.apiKey=mistralApiKey" "name: MISTRAL_APIKEY"
225227
check_string_existence "--set modules.generative-mistral.enabled=true --set modules.generative-mistral.apiKey=mistralApiKey --set modules.text2vec-mistral.enabled=true --set modules.text2vec-mistral.apiKey=mistralApiKey" "name: MISTRAL_APIKEY"
228+
check_string_existence "--set modules.multi2vec-cohere.enabled=true --set modules.multi2vec-cohere.apiKey=apiKey" "name: COHERE_APIKEY"
226229

227230
check_setting_has_value "--set replicas=3 --set env.RAFT_BOOTSTRAP_EXPECT=3" "name: RAFT_JOIN" "value: \"weaviate-0,weaviate-1,weaviate-2\""
228231
check_setting_has_value "--set replicas=3 --set env.RAFT_BOOTSTRAP_EXPECT=3" "name: RAFT_BOOTSTRAP_EXPECT" "value: \"3\""

weaviate/Chart.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ type: application
77
# This is the chart version. This version number should be incremented each time you make changes
88
# to the chart and its templates, including the app version.
99
# Versions are expected to follow Semantic Versioning (https://semver.org/)
10-
version: 17.3.0
10+
version: 17.3.1
1111

1212
# This is the version number of the application being deployed. This version number should be
1313
# incremented each time you make changes to the application. Versions are not expected to
1414
# follow Semantic Versioning. They should reflect the version the application is using.
15-
appVersion: 1.27.0
15+
appVersion: 1.27.2
1616
icon: https://raw.githubusercontent.com/weaviate/weaviate/19de0956c69b66c5552447e84d016f4fe29d12c9/docs/assets/weaviate-logo.png

weaviate/templates/_helpers.tpl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,9 @@
8080
{{- if (index .Values "modules" "multi2vec-google" "enabled") -}}
8181
{{ $modules = append $modules "multi2vec-google" }}
8282
{{- end -}}
83+
{{- if (index .Values "modules" "multi2vec-cohere" "enabled") -}}
84+
{{ $modules = append $modules "multi2vec-cohere" }}
85+
{{- end -}}
8386
{{- if (index .Values "modules" "text2vec-openai" "enabled") -}}
8487
{{ $modules = append $modules "text2vec-openai" }}
8588
{{- end -}}

weaviate/templates/apiKeyCohereSecret.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
{{- $t2vCohere := and (index .Values "modules" "text2vec-cohere" "enabled") (index .Values "modules" "text2vec-cohere" "apiKey") -}}
22
{{- $generativeCohere := and (index .Values "modules" "generative-cohere" "enabled") (index .Values "modules" "generative-cohere" "apiKey") }}
33
{{- $rerankerCohere := and (index .Values "modules" "reranker-cohere" "enabled") (index .Values "modules" "reranker-cohere" "apiKey") }}
4-
{{- $cohere := or ($t2vCohere) ($generativeCohere) ($rerankerCohere) }}
4+
{{- $multi2vecCohere := and (index .Values "modules" "multi2vec-cohere" "enabled") (index .Values "modules" "multi2vec-cohere" "apiKey") }}
5+
{{- $cohere := or ($t2vCohere) ($generativeCohere) ($rerankerCohere) ($multi2vecCohere) }}
56
{{- if $cohere }}
67

78
{{- $apiKeys := list }}
@@ -14,6 +15,9 @@
1415
{{- if $rerankerCohere }}
1516
{{- $apiKeys = append $apiKeys (index .Values "modules" "reranker-cohere" "apiKey") -}}
1617
{{- end }}
18+
{{- if $multi2vecCohere }}
19+
{{- $apiKeys = append $apiKeys (index .Values "modules" "multi2vec-cohere" "apiKey") -}}
20+
{{- end }}
1721

1822
{{- if gt (len ($apiKeys | uniq)) 1 -}}
1923
{{- fail "Cohere modules activated, but their keys differ. Use the same key on all activated Cohere modules." }}
@@ -32,6 +36,8 @@ data:
3236
apiKey: {{ index .Values "modules" "generative-cohere" "apiKey" | b64enc }}
3337
{{- else if (index .Values "modules" "reranker-cohere" "apiKey") }}
3438
apiKey: {{ index .Values "modules" "reranker-cohere" "apiKey" | b64enc }}
39+
{{- else if (index .Values "modules" "multi2vec-cohere" "apiKey") }}
40+
apiKey: {{ index .Values "modules" "multi2vec-cohere" "apiKey" | b64enc }}
3541
{{- else }}
3642
apiKey: {{ index .Values "modules" "text2vec-cohere" "apiKey" | b64enc }}
3743
{{- end }}

weaviate/templates/weaviateStatefulset.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ spec:
218218
name: weaviate-huggingface
219219
key: apiKey
220220
{{- end }}
221-
{{- if or (and (index .Values "modules" "text2vec-cohere" "enabled") (index .Values "modules" "text2vec-cohere" "apiKey")) (and (index .Values "modules" "generative-cohere" "enabled") (index .Values "modules" "generative-cohere" "apiKey")) (and (index .Values "modules" "reranker-cohere" "enabled") (index .Values "modules" "reranker-cohere" "apiKey")) }}
221+
{{- if or (and (index .Values "modules" "text2vec-cohere" "enabled") (index .Values "modules" "text2vec-cohere" "apiKey")) (and (index .Values "modules" "generative-cohere" "enabled") (index .Values "modules" "generative-cohere" "apiKey")) (and (index .Values "modules" "reranker-cohere" "enabled") (index .Values "modules" "reranker-cohere" "apiKey")) (and (index .Values "modules" "multi2vec-cohere" "enabled") (index .Values "modules" "multi2vec-cohere" "apiKey")) }}
222222
- name: COHERE_APIKEY
223223
valueFrom:
224224
secretKeyRef:

weaviate/values.yaml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ image:
77
# of weaviate. In accordance with Infra-as-code, you should pin this value
88
# down and only change it if you explicitly want to upgrade the Weaviate
99
# version.
10-
tag: 1.27.0
10+
tag: 1.27.2
1111
repo: semitechnologies/weaviate
1212
# Image pull policy: https://kubernetes.io/docs/concepts/containers/images/#image-pull-policy
1313
pullPolicy: IfNotPresent
@@ -1225,6 +1225,18 @@ modules:
12251225
# an environment variable
12261226
apiKey: ''
12271227

1228+
# The multi2vec-cohere module uses Cohere API
1229+
# to dynamically compute vector embeddings.
1230+
# More information about Cohere API can be found here: https://docs.cohere.ai/
1231+
multi2vec-cohere:
1232+
1233+
# enable if you want to use Cohere module
1234+
enabled: false
1235+
1236+
# Set your Cohere API Key to be passed to Weaviate pod as
1237+
# an environment variable
1238+
apiKey: ''
1239+
12281240
# The qna-transformers module uses neural networks, such as BERT,
12291241
# DistilBERT, to find an answer in text to a given question
12301242
qna-transformers:

0 commit comments

Comments
 (0)