Skip to content

Commit 34a9081

Browse files
authored
Merge pull request #244 from weaviate/add-support-for-generative-anthropic-module
Add support for generative-anthropic module
2 parents ff23327 + fc51b5e commit 34a9081

File tree

5 files changed

+37
-0
lines changed

5 files changed

+37
-0
lines changed

.cicd/test.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,8 @@ function check_creates_template() {
160160
check_modules "--set modules.text2vec-octoai.enabled=true" "value: text2vec-octoai"
161161
check_modules "--set modules.generative-octoai.enabled=true" "value: generative-octoai"
162162
check_modules "--set offload.s3.enabled=true" "value: offload-s3"
163+
check_modules "--set modules.generative-anthropic.enabled=true" "value: generative-anthropic"
164+
check_modules "--set modules.generative-anthropic.enabled=true --set modules.generative-anthropic.apiKey=apiKey" "value: generative-anthropic"
163165

164166
check_modules "--set modules.text2vec-openai.enabled=true --set modules.text2vec-openai.azureApiKey=azureApiKey" "value: text2vec-openai"
165167
check_modules "--set modules.qna-openai.enabled=true --set modules.qna-openai.azureApiKey=azureApiKey" "value: qna-openai"
@@ -199,6 +201,7 @@ function check_creates_template() {
199201
check_string_existence "--set offload.s3.enabled=true --set modules.generative-aws.enabled=true --set offload.s3.envconfig.OFFLOAD_S3_BUCKET=/custom-bucket --set modules.text2vec-aws.enabled=true" "name: OFFLOAD_S3_BUCKET"
200202
check_string_existence "--set offload.s3.enabled=true --set modules.generative-aws.enabled=true --set offload.s3.envconfig.OFFLOAD_S3_PATH=/custom-path --set modules.text2vec-aws.enabled=true" "name: OFFLOAD_S3_PATH"
201203
check_string_existence "--set initContainers.ensureFileOwnershipContainer.enabled=true --set containerSecurityContext.runAsUser=1000 --set containerSecurityContext.fsGroup=2000" "name: ensure-file-ownership"
204+
check_string_existence "--set modules.text2vec-openai.enabled=true --set modules.generative-anthropic.enabled=true --set modules.generative-anthropic.apiKey=azureApiKey" "name: ANTHROPIC_APIKEY"
202205

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

weaviate/templates/_helpers.tpl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@
4444
{{- if (index .Values "modules" "generative-octoai" "enabled") -}}
4545
{{ $modules = append $modules "generative-octoai" }}
4646
{{- end -}}
47+
{{- if (index .Values "modules" "generative-anthropic" "enabled") -}}
48+
{{ $modules = append $modules "generative-anthropic" }}
49+
{{- end -}}
4750
{{- if or (index .Values "modules" "img2vec-neural" "enabled") (index .Values "modules" "img2vec-neural" "inferenceUrl") -}}
4851
{{ $modules = append $modules "img2vec-neural" }}
4952
{{- end -}}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{{ if and (index .Values "modules" "generative-anthropic" "enabled") (index .Values "modules" "generative-anthropic" "apiKey") }}
2+
apiVersion: v1
3+
kind: Secret
4+
metadata:
5+
name: weaviate-anthropic
6+
labels:
7+
app.kubernetes.io/name: weaviate
8+
app.kubernetes.io/managed-by: helm
9+
type: Opaque
10+
data:
11+
apiKey: {{ index .Values "modules" "generative-anthropic" "apiKey" | b64enc }}
12+
{{ end }}

weaviate/templates/weaviateStatefulset.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,13 @@ spec:
253253
name: weaviate-anyscale
254254
key: apiKey
255255
{{- end }}
256+
{{- if and (index .Values "modules" "generative-anthropic" "enabled") (index .Values "modules" "generative-anthropic" "apiKey") }}
257+
- name: ANTHROPIC_APIKEY
258+
valueFrom:
259+
secretKeyRef:
260+
name: weaviate-anthropic
261+
key: apiKey
262+
{{- end }}
256263
{{- if and (index .Values "modules" "generative-mistral" "enabled") (index .Values "modules" "generative-mistral" "apiKey") }}
257264
- name: MISTRAL_APIKEY
258265
valueFrom:

weaviate/values.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1358,6 +1358,18 @@ modules:
13581358
# an environment variable
13591359
apiKey: ''
13601360

1361+
# The generative-anthropic module uses Anthropic API.
1362+
# More information about Anthropic API can be found here:
1363+
# https://docs.anthropic.com/en/api/getting-started
1364+
generative-anthropic:
1365+
1366+
# enable if you want to use Anthropic module
1367+
enabled: false
1368+
1369+
# Set your Anthropic API Key to be passed to Weaviate pod as
1370+
# an environment variable
1371+
apiKey: ''
1372+
13611373
# The img2vec-neural module uses neural networks, to generate
13621374
# a vector representation of the image
13631375
img2vec-neural:

0 commit comments

Comments
 (0)