forked from langgenius/dify
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'langgenius:main' into lindorm-vdb
- Loading branch information
Showing
131 changed files
with
1,378 additions
and
529 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
api/core/model_runtime/model_providers/bedrock/get_bedrock_client.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import boto3 | ||
from botocore.config import Config | ||
|
||
|
||
def get_bedrock_client(service_name, credentials=None): | ||
client_config = Config(region_name=credentials["aws_region"]) | ||
aws_access_key_id = credentials["aws_access_key_id"] | ||
aws_secret_access_key = credentials["aws_secret_access_key"] | ||
if aws_access_key_id and aws_secret_access_key: | ||
# use aksk to call bedrock | ||
client = boto3.client( | ||
service_name=service_name, | ||
config=client_config, | ||
aws_access_key_id=aws_access_key_id, | ||
aws_secret_access_key=aws_secret_access_key, | ||
) | ||
else: | ||
# use iam without aksk to call | ||
client = boto3.client(service_name=service_name, config=client_config) | ||
|
||
return client |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
api/core/model_runtime/model_providers/google/llm/gemini-2.0-flash-exp.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
model: gemini-2.0-flash-exp | ||
label: | ||
en_US: Gemini 2.0 Flash Exp | ||
model_type: llm | ||
features: | ||
- agent-thought | ||
- vision | ||
- tool-call | ||
- stream-tool-call | ||
- document | ||
model_properties: | ||
mode: chat | ||
context_size: 1048576 | ||
parameter_rules: | ||
- name: temperature | ||
use_template: temperature | ||
- name: top_p | ||
use_template: top_p | ||
- name: top_k | ||
label: | ||
zh_Hans: 取样数量 | ||
en_US: Top k | ||
type: int | ||
help: | ||
zh_Hans: 仅从每个后续标记的前 K 个选项中采样。 | ||
en_US: Only sample from the top K options for each subsequent token. | ||
required: false | ||
- name: max_output_tokens | ||
use_template: max_tokens | ||
default: 8192 | ||
min: 1 | ||
max: 8192 | ||
- name: json_schema | ||
use_template: json_schema | ||
pricing: | ||
input: '0.00' | ||
output: '0.00' | ||
unit: '0.000001' | ||
currency: USD |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
api/core/model_runtime/model_providers/groq/llm/gemma-7b-it.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
model: gemma-7b-it | ||
label: | ||
zh_Hans: Gemma 7B Instruction Tuned | ||
en_US: Gemma 7B Instruction Tuned | ||
model_type: llm | ||
features: | ||
- agent-thought | ||
model_properties: | ||
mode: chat | ||
context_size: 8192 | ||
parameter_rules: | ||
- name: temperature | ||
use_template: temperature | ||
- name: top_p | ||
use_template: top_p | ||
- name: max_tokens | ||
use_template: max_tokens | ||
default: 512 | ||
min: 1 | ||
max: 8192 | ||
pricing: | ||
input: '0.05' | ||
output: '0.1' | ||
unit: '0.000001' | ||
currency: USD |
25 changes: 25 additions & 0 deletions
25
api/core/model_runtime/model_providers/groq/llm/gemma2-9b-it.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
model: gemma2-9b-it | ||
label: | ||
zh_Hans: Gemma 2 9B Instruction Tuned | ||
en_US: Gemma 2 9B Instruction Tuned | ||
model_type: llm | ||
features: | ||
- agent-thought | ||
model_properties: | ||
mode: chat | ||
context_size: 8192 | ||
parameter_rules: | ||
- name: temperature | ||
use_template: temperature | ||
- name: top_p | ||
use_template: top_p | ||
- name: max_tokens | ||
use_template: max_tokens | ||
default: 512 | ||
min: 1 | ||
max: 8192 | ||
pricing: | ||
input: '0.05' | ||
output: '0.1' | ||
unit: '0.000001' | ||
currency: USD |
5 changes: 3 additions & 2 deletions
5
api/core/model_runtime/model_providers/groq/llm/llama-3.1-70b-versatile.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
api/core/model_runtime/model_providers/groq/llm/llama-3.2-11b-text-preview.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
api/core/model_runtime/model_providers/groq/llm/llama-3.2-90b-text-preview.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
api/core/model_runtime/model_providers/groq/llm/llama3-groq-70b-8192-tool-use-preview.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
model: llama3-groq-70b-8192-tool-use-preview | ||
label: | ||
zh_Hans: Llama3-groq-70b-8192-tool-use (PREVIEW) | ||
en_US: Llama3-groq-70b-8192-tool-use (PREVIEW) | ||
model_type: llm | ||
features: | ||
- agent-thought | ||
model_properties: | ||
mode: chat | ||
context_size: 8192 | ||
parameter_rules: | ||
- name: temperature | ||
use_template: temperature | ||
- name: top_p | ||
use_template: top_p | ||
- name: max_tokens | ||
use_template: max_tokens | ||
default: 512 | ||
min: 1 | ||
max: 8192 | ||
pricing: | ||
input: '0.05' | ||
output: '0.08' | ||
unit: '0.000001' | ||
currency: USD |
39 changes: 39 additions & 0 deletions
39
api/core/model_runtime/model_providers/vertex_ai/llm/gemini-2.0-flash-exp.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
model: gemini-2.0-flash-exp | ||
label: | ||
en_US: Gemini 2.0 Flash Exp | ||
model_type: llm | ||
features: | ||
- agent-thought | ||
- vision | ||
- tool-call | ||
- stream-tool-call | ||
- document | ||
model_properties: | ||
mode: chat | ||
context_size: 1048576 | ||
parameter_rules: | ||
- name: temperature | ||
use_template: temperature | ||
- name: top_p | ||
use_template: top_p | ||
- name: top_k | ||
label: | ||
zh_Hans: 取样数量 | ||
en_US: Top k | ||
type: int | ||
help: | ||
zh_Hans: 仅从每个后续标记的前 K 个选项中采样。 | ||
en_US: Only sample from the top K options for each subsequent token. | ||
required: false | ||
- name: max_output_tokens | ||
use_template: max_tokens | ||
default: 8192 | ||
min: 1 | ||
max: 8192 | ||
- name: json_schema | ||
use_template: json_schema | ||
pricing: | ||
input: '0.00' | ||
output: '0.00' | ||
unit: '0.000001' | ||
currency: USD |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.