Quellcode durchsuchen

feat: add stream for Gemini (#8678)

AAEE86 vor 7 Monaten
Ursprung
Commit
9a4b53a212

+ 9 - 0
api/core/model_runtime/model_providers/google/llm/gemini-1.5-flash-8b-exp-0827.yaml

@@ -32,6 +32,15 @@ parameter_rules:
     max: 8192
   - name: response_format
     use_template: response_format
+  - name: stream
+    label:
+      zh_Hans: 流式输出
+      en_US: Stream
+    type: boolean
+    help:
+      zh_Hans: 流式输出允许模型在生成文本的过程中逐步返回结果,而不是一次性生成全部结果后再返回。
+      en_US: Streaming output allows the model to return results incrementally as it generates text, rather than generating all the results at once.
+    default: false
 pricing:
   input: '0.00'
   output: '0.00'

+ 9 - 0
api/core/model_runtime/model_providers/google/llm/gemini-1.5-flash-exp-0827.yaml

@@ -32,6 +32,15 @@ parameter_rules:
     max: 8192
   - name: response_format
     use_template: response_format
+  - name: stream
+    label:
+      zh_Hans: 流式输出
+      en_US: Stream
+    type: boolean
+    help:
+      zh_Hans: 流式输出允许模型在生成文本的过程中逐步返回结果,而不是一次性生成全部结果后再返回。
+      en_US: Streaming output allows the model to return results incrementally as it generates text, rather than generating all the results at once.
+    default: false
 pricing:
   input: '0.00'
   output: '0.00'

+ 9 - 0
api/core/model_runtime/model_providers/google/llm/gemini-1.5-flash-latest.yaml

@@ -32,6 +32,15 @@ parameter_rules:
     max: 8192
   - name: response_format
     use_template: response_format
+  - name: stream
+    label:
+      zh_Hans: 流式输出
+      en_US: Stream
+    type: boolean
+    help:
+      zh_Hans: 流式输出允许模型在生成文本的过程中逐步返回结果,而不是一次性生成全部结果后再返回。
+      en_US: Streaming output allows the model to return results incrementally as it generates text, rather than generating all the results at once.
+    default: false
 pricing:
   input: '0.00'
   output: '0.00'

+ 9 - 0
api/core/model_runtime/model_providers/google/llm/gemini-1.5-pro-exp-0801.yaml

@@ -32,6 +32,15 @@ parameter_rules:
     max: 8192
   - name: response_format
     use_template: response_format
+  - name: stream
+    label:
+      zh_Hans: 流式输出
+      en_US: Stream
+    type: boolean
+    help:
+      zh_Hans: 流式输出允许模型在生成文本的过程中逐步返回结果,而不是一次性生成全部结果后再返回。
+      en_US: Streaming output allows the model to return results incrementally as it generates text, rather than generating all the results at once.
+    default: false
 pricing:
   input: '0.00'
   output: '0.00'

+ 9 - 0
api/core/model_runtime/model_providers/google/llm/gemini-1.5-pro-exp-0827.yaml

@@ -32,6 +32,15 @@ parameter_rules:
     max: 8192
   - name: response_format
     use_template: response_format
+  - name: stream
+    label:
+      zh_Hans: 流式输出
+      en_US: Stream
+    type: boolean
+    help:
+      zh_Hans: 流式输出允许模型在生成文本的过程中逐步返回结果,而不是一次性生成全部结果后再返回。
+      en_US: Streaming output allows the model to return results incrementally as it generates text, rather than generating all the results at once.
+    default: false
 pricing:
   input: '0.00'
   output: '0.00'

+ 9 - 0
api/core/model_runtime/model_providers/google/llm/gemini-1.5-pro-latest.yaml

@@ -32,6 +32,15 @@ parameter_rules:
     max: 8192
   - name: response_format
     use_template: response_format
+  - name: stream
+    label:
+      zh_Hans: 流式输出
+      en_US: Stream
+    type: boolean
+    help:
+      zh_Hans: 流式输出允许模型在生成文本的过程中逐步返回结果,而不是一次性生成全部结果后再返回。
+      en_US: Streaming output allows the model to return results incrementally as it generates text, rather than generating all the results at once.
+    default: false
 pricing:
   input: '0.00'
   output: '0.00'

+ 9 - 0
api/core/model_runtime/model_providers/google/llm/gemini-pro-vision.yaml

@@ -27,6 +27,15 @@ parameter_rules:
     default: 4096
     min: 1
     max: 4096
+  - name: stream
+    label:
+      zh_Hans: 流式输出
+      en_US: Stream
+    type: boolean
+    help:
+      zh_Hans: 流式输出允许模型在生成文本的过程中逐步返回结果,而不是一次性生成全部结果后再返回。
+      en_US: Streaming output allows the model to return results incrementally as it generates text, rather than generating all the results at once.
+    default: false
 pricing:
   input: '0.00'
   output: '0.00'

+ 9 - 0
api/core/model_runtime/model_providers/google/llm/gemini-pro.yaml

@@ -31,6 +31,15 @@ parameter_rules:
     max: 2048
   - name: response_format
     use_template: response_format
+  - name: stream
+    label:
+      zh_Hans: 流式输出
+      en_US: Stream
+    type: boolean
+    help:
+      zh_Hans: 流式输出允许模型在生成文本的过程中逐步返回结果,而不是一次性生成全部结果后再返回。
+      en_US: Streaming output allows the model to return results incrementally as it generates text, rather than generating all the results at once.
+    default: false
 pricing:
   input: '0.00'
   output: '0.00'