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.

feat: add openai o1 & update pricing and max_token of other models (#11780)

-LAN-a5db7c9acb20
diff --git a/api/core/model_runtime/model_providers/openai/llm/_position.yaml b/api/core/model_runtime/model_providers/openai/llm/_position.yaml
index 099aae38a65..be279d95208 100644
--- a/api/core/model_runtime/model_providers/openai/llm/_position.yaml
+++ b/api/core/model_runtime/model_providers/openai/llm/_position.yaml
@@ -1,4 +1,7 @@
-- gpt-4o-audio-preview
+- o1
+- o1-2024-12-17
+- o1-mini
+- o1-mini-2024-09-12
- gpt-4
- gpt-4o
- gpt-4o-2024-05-13
@@ -7,10 +10,6 @@
- chatgpt-4o-latest
- gpt-4o-mini
- gpt-4o-mini-2024-07-18
-- o1-preview
-- o1-preview-2024-09-12
-- o1-mini
-- o1-mini-2024-09-12
- gpt-4-turbo
- gpt-4-turbo-2024-04-09
- gpt-4-turbo-preview
@@ -25,4 +24,7 @@
- gpt-3.5-turbo-1106
- gpt-3.5-turbo-0613
- gpt-3.5-turbo-instruct
+- gpt-4o-audio-preview
+- o1-preview
+- o1-preview-2024-09-12
- text-davinci-003
diff --git a/api/core/model_runtime/model_providers/openai/llm/chatgpt-4o-latest.yaml b/api/core/model_runtime/model_providers/openai/llm/chatgpt-4o-latest.yaml
index b47449a49ab..19a5399a735 100644
--- a/api/core/model_runtime/model_providers/openai/llm/chatgpt-4o-latest.yaml
+++ b/api/core/model_runtime/model_providers/openai/llm/chatgpt-4o-latest.yaml
@@ -22,7 +22,7 @@ parameter_rules:
use_template: frequency_penalty
- name: max_tokens
use_template: max_tokens
- default: 512
+ default: 16384
min: 1
max: 16384
- name: response_format
diff --git a/api/core/model_runtime/model_providers/openai/llm/gpt-4o-2024-05-13.yaml b/api/core/model_runtime/model_providers/openai/llm/gpt-4o-2024-05-13.yaml
index b630d6f6307..2c86ec94607 100644
--- a/api/core/model_runtime/model_providers/openai/llm/gpt-4o-2024-05-13.yaml
+++ b/api/core/model_runtime/model_providers/openai/llm/gpt-4o-2024-05-13.yaml
@@ -22,9 +22,9 @@ parameter_rules:
use_template: frequency_penalty
- name: max_tokens
use_template: max_tokens
- default: 512
+ default: 16384
min: 1
- max: 4096
+ max: 16384
- name: response_format
label:
zh_Hans: 回复格式
diff --git a/api/core/model_runtime/model_providers/openai/llm/gpt-4o-2024-08-06.yaml b/api/core/model_runtime/model_providers/openai/llm/gpt-4o-2024-08-06.yaml
index 73b7f697007..cabbe987172 100644
--- a/api/core/model_runtime/model_providers/openai/llm/gpt-4o-2024-08-06.yaml
+++ b/api/core/model_runtime/model_providers/openai/llm/gpt-4o-2024-08-06.yaml
@@ -22,7 +22,7 @@ parameter_rules:
use_template: frequency_penalty
- name: max_tokens
use_template: max_tokens
- default: 512
+ default: 16384
min: 1
max: 16384
- name: response_format
diff --git a/api/core/model_runtime/model_providers/openai/llm/gpt-4o-2024-11-20.yaml b/api/core/model_runtime/model_providers/openai/llm/gpt-4o-2024-11-20.yaml
index ebd5ab38c3b..2c7c1c6eb56 100644
--- a/api/core/model_runtime/model_providers/openai/llm/gpt-4o-2024-11-20.yaml
+++ b/api/core/model_runtime/model_providers/openai/llm/gpt-4o-2024-11-20.yaml
@@ -22,7 +22,7 @@ parameter_rules:
use_template: frequency_penalty
- name: max_tokens
use_template: max_tokens
- default: 512
+ default: 16384
min: 1
max: 16384
- name: response_format
diff --git a/api/core/model_runtime/model_providers/openai/llm/gpt-4o-audio-preview.yaml b/api/core/model_runtime/model_providers/openai/llm/gpt-4o-audio-preview.yaml
index 6571cd094fc..e707acc507c 100644
--- a/api/core/model_runtime/model_providers/openai/llm/gpt-4o-audio-preview.yaml
+++ b/api/core/model_runtime/model_providers/openai/llm/gpt-4o-audio-preview.yaml
@@ -22,9 +22,9 @@ parameter_rules:
use_template: frequency_penalty
- name: max_tokens
use_template: max_tokens
- default: 512
+ default: 16384
min: 1
- max: 4096
+ max: 16384
- name: response_format
label:
zh_Hans: 回复格式
diff --git a/api/core/model_runtime/model_providers/openai/llm/gpt-4o-mini-2024-07-18.yaml b/api/core/model_runtime/model_providers/openai/llm/gpt-4o-mini-2024-07-18.yaml
index df38270f79b..0c1b74c5134 100644
--- a/api/core/model_runtime/model_providers/openai/llm/gpt-4o-mini-2024-07-18.yaml
+++ b/api/core/model_runtime/model_providers/openai/llm/gpt-4o-mini-2024-07-18.yaml
@@ -22,7 +22,7 @@ parameter_rules:
use_template: frequency_penalty
- name: max_tokens
use_template: max_tokens
- default: 512
+ default: 16384
min: 1
max: 16384
- name: response_format
diff --git a/api/core/model_runtime/model_providers/openai/llm/gpt-4o-mini.yaml b/api/core/model_runtime/model_providers/openai/llm/gpt-4o-mini.yaml
index 5e3c94fbe25..0d52f06339a 100644
--- a/api/core/model_runtime/model_providers/openai/llm/gpt-4o-mini.yaml
+++ b/api/core/model_runtime/model_providers/openai/llm/gpt-4o-mini.yaml
@@ -22,7 +22,7 @@ parameter_rules:
use_template: frequency_penalty
- name: max_tokens
use_template: max_tokens
- default: 512
+ default: 16384
min: 1
max: 16384
- name: response_format
diff --git a/api/core/model_runtime/model_providers/openai/llm/gpt-4o.yaml b/api/core/model_runtime/model_providers/openai/llm/gpt-4o.yaml
index 3090a9e090c..a4681fe18d2 100644
--- a/api/core/model_runtime/model_providers/openai/llm/gpt-4o.yaml
+++ b/api/core/model_runtime/model_providers/openai/llm/gpt-4o.yaml
@@ -22,9 +22,9 @@ parameter_rules:
use_template: frequency_penalty
- name: max_tokens
use_template: max_tokens
- default: 512
+ default: 16384
min: 1
- max: 4096
+ max: 16384
- name: response_format
label:
zh_Hans: 回复格式
@@ -38,7 +38,7 @@ parameter_rules:
- text
- json_object
pricing:
- input: '5.00'
- output: '15.00'
+ input: '2.50'
+ output: '10.00'
unit: '0.000001'
currency: USD
diff --git a/api/core/model_runtime/model_providers/openai/llm/o1-2024-12-17.yaml b/api/core/model_runtime/model_providers/openai/llm/o1-2024-12-17.yaml
new file mode 100644
index 00000000000..7acbd0e2b11
--- /dev/null
+++ b/api/core/model_runtime/model_providers/openai/llm/o1-2024-12-17.yaml
@@ -0,0 +1,35 @@
+model: o1-2024-12-17
+label:
+ en_US: o1-2024-12-17
+model_type: llm
+features:
+ - multi-tool-call
+ - agent-thought
+ - stream-tool-call
+ - vision
+model_properties:
+ mode: chat
+ context_size: 200000
+parameter_rules:
+ - name: max_tokens
+ use_template: max_tokens
+ default: 50000
+ min: 1
+ max: 50000
+ - name: response_format
+ label:
+ zh_Hans: 回复格式
+ en_US: response_format
+ type: string
+ help:
+ zh_Hans: 指定模型必须输出的格式
+ en_US: specifying the format that the model must output
+ required: false
+ options:
+ - text
+ - json_object
+pricing:
+ input: '15.00'
+ output: '60.00'
+ unit: '0.000001'
+ currency: USD
diff --git a/api/core/model_runtime/model_providers/openai/llm/o1.yaml b/api/core/model_runtime/model_providers/openai/llm/o1.yaml
new file mode 100644
index 00000000000..3a84cf418ec
--- /dev/null
+++ b/api/core/model_runtime/model_providers/openai/llm/o1.yaml
@@ -0,0 +1,36 @@
+model: o1
+label:
+ zh_Hans: o1
+ en_US: o1
+model_type: llm
+features:
+ - multi-tool-call
+ - agent-thought
+ - stream-tool-call
+ - vision
+model_properties:
+ mode: chat
+ context_size: 200000
+parameter_rules:
+ - name: max_tokens
+ use_template: max_tokens
+ default: 50000
+ min: 1
+ max: 50000
+ - name: response_format
+ label:
+ zh_Hans: 回复格式
+ en_US: response_format
+ type: string
+ help:
+ zh_Hans: 指定模型必须输出的格式
+ en_US: specifying the format that the model must output
+ required: false
+ options:
+ - text
+ - json_object
+pricing:
+ input: '15.00'
+ output: '60.00'
+ unit: '0.000001'
+ currency: USD