Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

[seanguo] add support of amazon titan v2 and modify the price of amazon titan v1 (#4643)

longzhihunfe9bf5fc4afd
diff --git a/api/core/model_runtime/model_providers/bedrock/llm/_position.yaml b/api/core/model_runtime/model_providers/bedrock/llm/_position.yaml
index 7f4d2035cc2..732d1c2a935 100644
--- a/api/core/model_runtime/model_providers/bedrock/llm/_position.yaml
+++ b/api/core/model_runtime/model_providers/bedrock/llm/_position.yaml
@@ -12,6 +12,7 @@
- meta.llama3-70b-instruct-v1:0
- meta.llama2-13b-chat-v1
- meta.llama2-70b-chat-v1
+- mistral.mistral-small-2402-v1:0
- mistral.mistral-large-2402-v1:0
- mistral.mixtral-8x7b-instruct-v0:1
- mistral.mistral-7b-instruct-v0:2
diff --git a/api/core/model_runtime/model_providers/bedrock/llm/mistral.mistral-small-2402-v1:0.yaml b/api/core/model_runtime/model_providers/bedrock/llm/mistral.mistral-small-2402-v1:0.yaml
new file mode 100644
index 00000000000..582f4a6d9ff
--- /dev/null
+++ b/api/core/model_runtime/model_providers/bedrock/llm/mistral.mistral-small-2402-v1:0.yaml
@@ -0,0 +1,27 @@
+model: mistral.mistral-small-2402-v1:0
+label:
+ en_US: Mistral Small
+model_type: llm
+model_properties:
+ mode: completion
+ context_size: 32000
+parameter_rules:
+ - name: temperature
+ use_template: temperature
+ required: false
+ default: 0.7
+ - name: top_p
+ use_template: top_p
+ required: false
+ default: 1
+ - name: max_tokens
+ use_template: max_tokens
+ required: true
+ default: 512
+ min: 1
+ max: 4096
+pricing:
+ input: '0.001'
+ output: '0.03'
+ unit: '0.001'
+ currency: USD
diff --git a/api/core/model_runtime/model_providers/bedrock/text_embedding/_position.yaml b/api/core/model_runtime/model_providers/bedrock/text_embedding/_position.yaml
index 5419ff530b9..afbea06a3e2 100644
--- a/api/core/model_runtime/model_providers/bedrock/text_embedding/_position.yaml
+++ b/api/core/model_runtime/model_providers/bedrock/text_embedding/_position.yaml
@@ -1,3 +1,4 @@
- amazon.titan-embed-text-v1
+- amazon.titan-embed-text-v2:0
- cohere.embed-english-v3
- cohere.embed-multilingual-v3
diff --git a/api/core/model_runtime/model_providers/bedrock/text_embedding/amazon.titan-embed-text-v1.yaml b/api/core/model_runtime/model_providers/bedrock/text_embedding/amazon.titan-embed-text-v1.yaml
index 6a1cf75be1a..e5a55971a19 100644
--- a/api/core/model_runtime/model_providers/bedrock/text_embedding/amazon.titan-embed-text-v1.yaml
+++ b/api/core/model_runtime/model_providers/bedrock/text_embedding/amazon.titan-embed-text-v1.yaml
@@ -4,5 +4,5 @@ model_properties:
context_size: 8192
pricing:
input: '0.0001'
- unit: '0.001'
+ unit: '0.0001'
currency: USD
diff --git a/api/core/model_runtime/model_providers/bedrock/text_embedding/amazon.titan-embed-text-v2.yaml b/api/core/model_runtime/model_providers/bedrock/text_embedding/amazon.titan-embed-text-v2.yaml
new file mode 100644
index 00000000000..5069efeb109
--- /dev/null
+++ b/api/core/model_runtime/model_providers/bedrock/text_embedding/amazon.titan-embed-text-v2.yaml
@@ -0,0 +1,8 @@
+model: amazon.titan-embed-text-v2:0
+model_type: text-embedding
+model_properties:
+ context_size: 8192
+pricing:
+ input: '0.00002'
+ unit: '0.00001'
+ currency: USD