mirror of
https://github.com/langgenius/dify.git
synced 2024-11-16 11:42:29 +08:00
feat: update aws bedrock (#3326)
Co-authored-by: chenhe <guchenhe@gmail.com>
This commit is contained in:
parent
b98e363a5c
commit
7c520b52c1
|
@ -2,8 +2,6 @@ model: amazon.titan-text-express-v1
|
|||
label:
|
||||
en_US: Titan Text G1 - Express
|
||||
model_type: llm
|
||||
features:
|
||||
- agent-thought
|
||||
model_properties:
|
||||
mode: chat
|
||||
context_size: 8192
|
||||
|
|
|
@ -2,8 +2,6 @@ model: amazon.titan-text-lite-v1
|
|||
label:
|
||||
en_US: Titan Text G1 - Lite
|
||||
model_type: llm
|
||||
features:
|
||||
- agent-thought
|
||||
model_properties:
|
||||
mode: chat
|
||||
context_size: 4096
|
||||
|
|
|
@ -50,3 +50,4 @@ pricing:
|
|||
output: '0.024'
|
||||
unit: '0.001'
|
||||
currency: USD
|
||||
deprecated: true
|
||||
|
|
|
@ -22,7 +22,7 @@ parameter_rules:
|
|||
min: 0
|
||||
max: 500
|
||||
default: 0
|
||||
- name: max_tokens_to_sample
|
||||
- name: max_tokens
|
||||
use_template: max_tokens
|
||||
required: true
|
||||
default: 4096
|
||||
|
|
|
@ -8,9 +8,9 @@ model_properties:
|
|||
parameter_rules:
|
||||
- name: temperature
|
||||
use_template: temperature
|
||||
- name: top_p
|
||||
- name: p
|
||||
use_template: top_p
|
||||
- name: top_k
|
||||
- name: k
|
||||
label:
|
||||
zh_Hans: 取样数量
|
||||
en_US: Top k
|
||||
|
@ -19,7 +19,7 @@ parameter_rules:
|
|||
zh_Hans: 仅从每个后续标记的前 K 个选项中采样。
|
||||
en_US: Only sample from the top K options for each subsequent token.
|
||||
required: false
|
||||
- name: max_tokens_to_sample
|
||||
- name: max_tokens
|
||||
use_template: max_tokens
|
||||
required: true
|
||||
default: 4096
|
||||
|
|
|
@ -503,7 +503,7 @@ class BedrockLargeLanguageModel(LargeLanguageModel):
|
|||
|
||||
if model_prefix == "amazon":
|
||||
payload["textGenerationConfig"] = { **model_parameters }
|
||||
payload["textGenerationConfig"]["stopSequences"] = ["User:"] + (stop if stop else [])
|
||||
payload["textGenerationConfig"]["stopSequences"] = ["User:"]
|
||||
|
||||
payload["inputText"] = self._convert_messages_to_prompt(prompt_messages, model_prefix)
|
||||
|
||||
|
@ -513,10 +513,6 @@ class BedrockLargeLanguageModel(LargeLanguageModel):
|
|||
payload["maxTokens"] = model_parameters.get("maxTokens")
|
||||
payload["prompt"] = self._convert_messages_to_prompt(prompt_messages, model_prefix)
|
||||
|
||||
# jurassic models only support a single stop sequence
|
||||
if stop:
|
||||
payload["stopSequences"] = stop[0]
|
||||
|
||||
if model_parameters.get("presencePenalty"):
|
||||
payload["presencePenalty"] = {model_parameters.get("presencePenalty")}
|
||||
if model_parameters.get("frequencyPenalty"):
|
||||
|
|
Loading…
Reference in New Issue
Block a user