Skip to content

Commit

Permalink
Merge pull request #187 from weaviate/add-support-for-text2vec-jinaai…
Browse files Browse the repository at this point in the history
…-module

Add support for text2vec-jinaai module
  • Loading branch information
antas-marcin authored Nov 8, 2023
2 parents ac4b600 + ebb0ede commit babb881
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .cicd/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ function check_creates_template() {
check_modules "--set modules.text2vec-gpt4all.enabled=true --set modules.text-spellcheck.enabled=true" "value: text2vec-gpt4all,text-spellcheck"
check_modules "--set modules.multi2vec-bind.enabled=true" "value: multi2vec-bind"
check_modules "--set modules.multi2vec-bind.enabled=true --set modules.text-spellcheck.enabled=true" "value: text-spellcheck,multi2vec-bind"
check_modules "--set modules.text2vec-jinaai.enabled=true" "value: text2vec-jinaai"

check_modules "--set modules.text2vec-openai.enabled=true --set modules.text2vec-openai.azureApiKey=azureApiKey" "value: text2vec-openai"
check_modules "--set modules.qna-openai.enabled=true --set modules.qna-openai.azureApiKey=azureApiKey" "value: qna-openai"
Expand All @@ -148,6 +149,7 @@ function check_creates_template() {
check_string_existence "--set modules.text2vec-openai.enabled=true --set modules.text2vec-openai.azureApiKey=azureApiKey" "name: AZURE_APIKEY"
check_string_existence "--set modules.qna-openai.enabled=true --set modules.qna-openai.azureApiKey=azureApiKey" "name: AZURE_APIKEY"
check_string_existence "--set modules.generative-openai.enabled=true --set modules.generative-openai.azureApiKey=azureApiKey" "name: AZURE_APIKEY"
check_string_existence "--set modules.text2vec-jinaai.enabled=true --set modules.text2vec-jinaai.apiKey=jinaaiApiKey" "name: JINAAI_APIKEY"

_settingPassageQueryOn="--set modules.text2vec-contextionary.enabled=false --set modules.text2vec-transformers.passageQueryServices.passage.enabled=true --set modules.text2vec-transformers.passageQueryServices.query.enabled=true"
check_setting_has_value "$_settingPassageQueryOn" "name: TRANSFORMERS_PASSAGE_INFERENCE_API" "value: http://transformers-inference-passage.default.svc.cluster.local:8080"
Expand Down
3 changes: 3 additions & 0 deletions weaviate/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@
{{- if (index .Values "modules" "text2vec-palm" "enabled") -}}
{{ $modules = append $modules "text2vec-palm" }}
{{- end -}}
{{- if (index .Values "modules" "text2vec-jinaai" "enabled") -}}
{{ $modules = append $modules "text2vec-jinaai" }}
{{- end -}}
{{- if (index .Values "modules" "ref2vec-centroid" "enabled") -}}
{{ $modules = append $modules "ref2vec-centroid" }}
{{- end -}}
Expand Down
12 changes: 12 additions & 0 deletions weaviate/templates/apiKeyJinaAISecret.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{{ if and (index .Values "modules" "text2vec-jinaai" "enabled") (index .Values "modules" "text2vec-jinaai" "apiKey") }}
apiVersion: v1
kind: Secret
metadata:
name: weaviate-jinaai
labels:
app.kubernetes.io/name: weaviate
app.kubernetes.io/managed-by: helm
type: Opaque
data:
apiKey: {{ index .Values "modules" "text2vec-jinaai" "apiKey" | b64enc }}
{{ end }}
7 changes: 7 additions & 0 deletions weaviate/templates/weaviateStatefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,13 @@ spec:
name: weaviate-palm
key: apiKey
{{- end }}
{{- if and (index .Values "modules" "text2vec-jinaai" "enabled") (index .Values "modules" "text2vec-jinaai" "apiKey") }}
- name: JINAAI_APIKEY
valueFrom:
secretKeyRef:
name: weaviate-jinaai
key: apiKey
{{- end }}
{{- if and (index .Values "backups" "filesystem" "enabled") (index .Values "backups" "filesystem" "envconfig") }}
{{- range $key, $value := index .Values "backups" "filesystem" "envconfig" }}
- name: {{ $key }}
Expand Down
14 changes: 14 additions & 0 deletions weaviate/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -785,6 +785,20 @@ modules:
# an environment variable
apiKey: ''

# The text2vec-jinaai module uses JinaAI Embeddings API
# to dynamically compute vector embeddings based on the
# sentence's context.
# More information about JinaAI Embeddings API can be found here:
# https://jina.ai/embeddings
text2vec-jinaai:

# enable if you want to use JinaAI module
enabled: false

# Set your JinaAI API Key to be passed to Weaviate pod as
# an environment variable
apiKey: ''

# The ref2vec-centroid module
ref2vec-centroid:

Expand Down

0 comments on commit babb881

Please sign in to comment.