@lobehub/chat 1.71.0 → 1.71.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +33 -0
- package/changelog/v1.json +12 -0
- package/locales/ar/components.json +1 -0
- package/locales/ar/models.json +3 -0
- package/locales/bg-BG/components.json +1 -0
- package/locales/bg-BG/models.json +3 -0
- package/locales/de-DE/components.json +1 -0
- package/locales/de-DE/models.json +3 -0
- package/locales/en-US/components.json +1 -0
- package/locales/en-US/models.json +3 -0
- package/locales/es-ES/components.json +1 -0
- package/locales/es-ES/models.json +3 -0
- package/locales/fa-IR/components.json +1 -0
- package/locales/fa-IR/models.json +3 -0
- package/locales/fr-FR/components.json +1 -0
- package/locales/fr-FR/models.json +3 -0
- package/locales/it-IT/components.json +1 -0
- package/locales/it-IT/models.json +3 -0
- package/locales/ja-JP/components.json +1 -0
- package/locales/ja-JP/models.json +3 -0
- package/locales/ko-KR/components.json +1 -0
- package/locales/ko-KR/models.json +3 -0
- package/locales/nl-NL/components.json +1 -0
- package/locales/nl-NL/models.json +3 -0
- package/locales/pl-PL/components.json +1 -0
- package/locales/pl-PL/models.json +3 -0
- package/locales/pt-BR/components.json +1 -0
- package/locales/pt-BR/models.json +3 -0
- package/locales/ru-RU/components.json +1 -0
- package/locales/ru-RU/models.json +3 -0
- package/locales/tr-TR/components.json +1 -0
- package/locales/tr-TR/models.json +3 -0
- package/locales/vi-VN/components.json +1 -0
- package/locales/vi-VN/models.json +3 -0
- package/locales/zh-CN/components.json +1 -0
- package/locales/zh-CN/models.json +3 -0
- package/locales/zh-TW/components.json +1 -0
- package/locales/zh-TW/models.json +3 -0
- package/package.json +1 -1
- package/src/components/ModelSelect/index.tsx +16 -0
- package/src/config/aiModels/google.ts +19 -0
- package/src/config/aiModels/vertexai.ts +24 -6
- package/src/config/modelProviders/vertexai.ts +1 -1
- package/src/libs/agent-runtime/google/index.ts +19 -7
- package/src/libs/agent-runtime/utils/streams/google-ai.test.ts +90 -0
- package/src/libs/agent-runtime/utils/streams/google-ai.ts +2 -1
- package/src/libs/agent-runtime/utils/streams/index.ts +1 -0
- package/src/locales/default/components.ts +1 -0
- package/src/types/aiModel.ts +4 -1
package/CHANGELOG.md
CHANGED
@@ -2,6 +2,39 @@
|
|
2
2
|
|
3
3
|
# Changelog
|
4
4
|
|
5
|
+
### [Version 1.71.1](https://github.com/lobehub/lobe-chat/compare/v1.71.0...v1.71.1)
|
6
|
+
|
7
|
+
<sup>Released on **2025-03-15**</sup>
|
8
|
+
|
9
|
+
#### 🐛 Bug Fixes
|
10
|
+
|
11
|
+
- **misc**: Fix google gemini output relative issue.
|
12
|
+
|
13
|
+
#### 💄 Styles
|
14
|
+
|
15
|
+
- **misc**: Update Vertex AI models.
|
16
|
+
|
17
|
+
<br/>
|
18
|
+
|
19
|
+
<details>
|
20
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
21
|
+
|
22
|
+
#### What's fixed
|
23
|
+
|
24
|
+
- **misc**: Fix google gemini output relative issue, closes [#6970](https://github.com/lobehub/lobe-chat/issues/6970) ([fdcaaf3](https://github.com/lobehub/lobe-chat/commit/fdcaaf3))
|
25
|
+
|
26
|
+
#### Styles
|
27
|
+
|
28
|
+
- **misc**: Update Vertex AI models, closes [#6967](https://github.com/lobehub/lobe-chat/issues/6967) ([d4432f1](https://github.com/lobehub/lobe-chat/commit/d4432f1))
|
29
|
+
|
30
|
+
</details>
|
31
|
+
|
32
|
+
<div align="right">
|
33
|
+
|
34
|
+
[](#readme-top)
|
35
|
+
|
36
|
+
</div>
|
37
|
+
|
5
38
|
## [Version 1.71.0](https://github.com/lobehub/lobe-chat/compare/v1.70.11...v1.71.0)
|
6
39
|
|
7
40
|
<sup>Released on **2025-03-14**</sup>
|
package/changelog/v1.json
CHANGED
@@ -76,6 +76,7 @@
|
|
76
76
|
"custom": "نموذج مخصص، الإعداد الافتراضي يدعم الاستدعاء الوظيفي والتعرف البصري، يرجى التحقق من قدرة النموذج على القيام بذلك بناءً على الحالة الفعلية",
|
77
77
|
"file": "يدعم هذا النموذج قراءة وتعرف الملفات المرفوعة",
|
78
78
|
"functionCall": "يدعم هذا النموذج استدعاء الوظائف",
|
79
|
+
"imageOutput": "يدعم هذا النموذج إنشاء الصور",
|
79
80
|
"reasoning": "يدعم هذا النموذج التفكير العميق",
|
80
81
|
"search": "يدعم هذا النموذج البحث عبر الإنترنت",
|
81
82
|
"tokens": "يدعم هذا النموذج حتى {{tokens}} رمزًا في جلسة واحدة",
|
package/locales/ar/models.json
CHANGED
@@ -836,6 +836,9 @@
|
|
836
836
|
"gemini-2.0-flash-exp": {
|
837
837
|
"description": "نموذج جمنيس 2.0 فلاش، تم تحسينه لتحقيق أهداف مثل الكفاءة من حيث التكلفة وانخفاض الكمون."
|
838
838
|
},
|
839
|
+
"gemini-2.0-flash-exp-image-generation": {
|
840
|
+
"description": "نموذج تجريبي Gemini 2.0 Flash، يدعم توليد الصور"
|
841
|
+
},
|
839
842
|
"gemini-2.0-flash-lite": {
|
840
843
|
"description": "نموذج جمنّي 2.0 فلاش هو نسخة معدلة، تم تحسينها لتحقيق الكفاءة من حيث التكلفة والحد من التأخير."
|
841
844
|
},
|
@@ -76,6 +76,7 @@
|
|
76
76
|
"custom": "Потребителски модел, по подразбиране поддържа функционалност за функционални обаждания и визуално разпознаване, моля, потвърдете наличието на тези възможности спрямо реалните условия",
|
77
77
|
"file": "Този модел поддържа качване на файлове и разпознаване",
|
78
78
|
"functionCall": "Този модел поддържа функционални обаждания (Function Call)",
|
79
|
+
"imageOutput": "Този модел поддържа генериране на изображения",
|
79
80
|
"reasoning": "Този модел поддържа дълбочинно мислене",
|
80
81
|
"search": "Този модел поддържа търсене в мрежата",
|
81
82
|
"tokens": "Този модел поддържа до {{tokens}} токена за една сесия",
|
@@ -836,6 +836,9 @@
|
|
836
836
|
"gemini-2.0-flash-exp": {
|
837
837
|
"description": "Gemini 2.0 Flash моделна вариация, оптимизирана за икономичност и ниска латентност."
|
838
838
|
},
|
839
|
+
"gemini-2.0-flash-exp-image-generation": {
|
840
|
+
"description": "Gemini 2.0 Flash експериментален модел, който поддържа генериране на изображения"
|
841
|
+
},
|
839
842
|
"gemini-2.0-flash-lite": {
|
840
843
|
"description": "Gemini 2.0 Flash е вариант на модела, оптимизиран за икономичност и ниска латентност."
|
841
844
|
},
|
@@ -76,6 +76,7 @@
|
|
76
76
|
"custom": "Benutzerdefiniertes Modell, standardmäßig unterstützt es sowohl Funktionsaufrufe als auch visuelle Erkennung. Bitte überprüfen Sie die Verfügbarkeit dieser Fähigkeiten basierend auf den tatsächlichen Gegebenheiten.",
|
77
77
|
"file": "Dieses Modell unterstützt das Hochladen von Dateien und deren Erkennung.",
|
78
78
|
"functionCall": "Dieses Modell unterstützt Funktionsaufrufe.",
|
79
|
+
"imageOutput": "Dieses Modell unterstützt die Generierung von Bildern",
|
79
80
|
"reasoning": "Dieses Modell unterstützt tiefes Denken",
|
80
81
|
"search": "Dieses Modell unterstützt die Online-Suche",
|
81
82
|
"tokens": "Dieses Modell unterstützt maximal {{tokens}} Tokens pro Sitzung.",
|
@@ -836,6 +836,9 @@
|
|
836
836
|
"gemini-2.0-flash-exp": {
|
837
837
|
"description": "Gemini 2.0 Flash-Modellvariante, die auf Kosteneffizienz und niedrige Latenz optimiert ist."
|
838
838
|
},
|
839
|
+
"gemini-2.0-flash-exp-image-generation": {
|
840
|
+
"description": "Gemini 2.0 Flash Experimentmodell, das die Bildgenerierung unterstützt"
|
841
|
+
},
|
839
842
|
"gemini-2.0-flash-lite": {
|
840
843
|
"description": "Gemini 2.0 Flash ist eine Modellvariante, die auf Kosteneffizienz und niedrige Latenz optimiert ist."
|
841
844
|
},
|
@@ -76,6 +76,7 @@
|
|
76
76
|
"custom": "Custom model, by default, supports both function call and visual recognition. Please verify the availability of the above capabilities based on actual situations.",
|
77
77
|
"file": "This model supports file upload for reading and recognition.",
|
78
78
|
"functionCall": "This model supports function call.",
|
79
|
+
"imageOutput": "This model supports image generation",
|
79
80
|
"reasoning": "This model supports deep thinking",
|
80
81
|
"search": "This model supports online search",
|
81
82
|
"tokens": "This model supports up to {{tokens}} tokens in a single session.",
|
@@ -836,6 +836,9 @@
|
|
836
836
|
"gemini-2.0-flash-exp": {
|
837
837
|
"description": "Gemini 2.0 Flash model variant optimized for cost-effectiveness and low latency."
|
838
838
|
},
|
839
|
+
"gemini-2.0-flash-exp-image-generation": {
|
840
|
+
"description": "Gemini 2.0 Flash experimental model, supports image generation"
|
841
|
+
},
|
839
842
|
"gemini-2.0-flash-lite": {
|
840
843
|
"description": "Gemini 2.0 Flash is a variant of the model optimized for cost-effectiveness and low latency."
|
841
844
|
},
|
@@ -76,6 +76,7 @@
|
|
76
76
|
"custom": "Modelo personalizado: admite llamadas de función y reconocimiento visual. Verifique la disponibilidad de estas capacidades según sea necesario.",
|
77
77
|
"file": "Este modelo admite la carga y reconocimiento de archivos.",
|
78
78
|
"functionCall": "Este modelo admite llamadas de función.",
|
79
|
+
"imageOutput": "Este modelo admite la generación de imágenes",
|
79
80
|
"reasoning": "Este modelo admite un pensamiento profundo",
|
80
81
|
"search": "Este modelo admite búsqueda en línea",
|
81
82
|
"tokens": "Este modelo admite un máximo de {{tokens}} tokens por sesión.",
|
@@ -836,6 +836,9 @@
|
|
836
836
|
"gemini-2.0-flash-exp": {
|
837
837
|
"description": "Variante del modelo Gemini 2.0 Flash, optimizada para objetivos como la rentabilidad y la baja latencia."
|
838
838
|
},
|
839
|
+
"gemini-2.0-flash-exp-image-generation": {
|
840
|
+
"description": "Modelo experimental Gemini 2.0 Flash, que admite la generación de imágenes"
|
841
|
+
},
|
839
842
|
"gemini-2.0-flash-lite": {
|
840
843
|
"description": "Variante del modelo Gemini 2.0 Flash, optimizada para objetivos como la rentabilidad y la baja latencia."
|
841
844
|
},
|
@@ -76,6 +76,7 @@
|
|
76
76
|
"custom": "مدل سفارشی، تنظیمات پیشفرض از فراخوانی توابع و تشخیص بصری پشتیبانی میکند، لطفاً قابلیتهای فوق را بر اساس شرایط واقعی بررسی کنید",
|
77
77
|
"file": "این مدل از بارگذاری و شناسایی فایلها پشتیبانی میکند",
|
78
78
|
"functionCall": "این مدل از فراخوانی توابع (Function Call) پشتیبانی میکند",
|
79
|
+
"imageOutput": "این مدل از تولید تصویر پشتیبانی میکند",
|
79
80
|
"reasoning": "این مدل از تفکر عمیق پشتیبانی میکند",
|
80
81
|
"search": "این مدل از جستجوی آنلاین پشتیبانی میکند",
|
81
82
|
"tokens": "این مدل در هر جلسه حداکثر از {{tokens}} توکن پشتیبانی میکند",
|
@@ -836,6 +836,9 @@
|
|
836
836
|
"gemini-2.0-flash-exp": {
|
837
837
|
"description": "مدل متغیر Gemini 2.0 Flash که برای بهینهسازی هزینه و تأخیر کم طراحی شده است."
|
838
838
|
},
|
839
|
+
"gemini-2.0-flash-exp-image-generation": {
|
840
|
+
"description": "مدل آزمایشی Gemini 2.0 Flash، از تولید تصویر پشتیبانی میکند"
|
841
|
+
},
|
839
842
|
"gemini-2.0-flash-lite": {
|
840
843
|
"description": "مدل متغیر Gemini 2.0 Flash برای بهینهسازی هزینه و تأخیر کم طراحی شده است."
|
841
844
|
},
|
@@ -76,6 +76,7 @@
|
|
76
76
|
"custom": "Modèle personnalisé par défaut prenant en charge à la fois les appels de fonction et la reconnaissance visuelle. Veuillez vérifier la disponibilité de ces capacités en fonction de vos besoins réels.",
|
77
77
|
"file": "Ce modèle prend en charge la lecture et la reconnaissance de fichiers téléchargés.",
|
78
78
|
"functionCall": "Ce modèle prend en charge les appels de fonction.",
|
79
|
+
"imageOutput": "Ce modèle prend en charge la génération d'images",
|
79
80
|
"reasoning": "Ce modèle prend en charge une réflexion approfondie",
|
80
81
|
"search": "Ce modèle prend en charge la recherche en ligne",
|
81
82
|
"tokens": "Ce modèle prend en charge jusqu'à {{tokens}} jetons par session.",
|
@@ -836,6 +836,9 @@
|
|
836
836
|
"gemini-2.0-flash-exp": {
|
837
837
|
"description": "Modèle variant Gemini 2.0 Flash, optimisé pour des objectifs tels que le rapport coût-efficacité et la faible latence."
|
838
838
|
},
|
839
|
+
"gemini-2.0-flash-exp-image-generation": {
|
840
|
+
"description": "Modèle expérimental Gemini 2.0 Flash, prenant en charge la génération d'images"
|
841
|
+
},
|
839
842
|
"gemini-2.0-flash-lite": {
|
840
843
|
"description": "Une variante du modèle Gemini 2.0 Flash, optimisée pour des objectifs tels que le rapport coût-efficacité et la faible latence."
|
841
844
|
},
|
@@ -76,6 +76,7 @@
|
|
76
76
|
"custom": "Modello personalizzato: di default supporta sia la chiamata di funzioni che il riconoscimento visivo. Verifica l'effettiva disponibilità di tali funzionalità.",
|
77
77
|
"file": "Questo modello supporta il caricamento e il riconoscimento di file.",
|
78
78
|
"functionCall": "Questo modello supporta la chiamata di funzioni.",
|
79
|
+
"imageOutput": "Questo modello supporta la generazione di immagini",
|
79
80
|
"reasoning": "Questo modello supporta un pensiero profondo",
|
80
81
|
"search": "Questo modello supporta la ricerca online",
|
81
82
|
"tokens": "Questo modello supporta un massimo di {{tokens}} token per sessione.",
|
@@ -836,6 +836,9 @@
|
|
836
836
|
"gemini-2.0-flash-exp": {
|
837
837
|
"description": "Gemini 2.0 Flash è una variante del modello ottimizzata per obiettivi come il rapporto costo-efficacia e la bassa latenza."
|
838
838
|
},
|
839
|
+
"gemini-2.0-flash-exp-image-generation": {
|
840
|
+
"description": "Modello sperimentale Gemini 2.0 Flash, supporta la generazione di immagini"
|
841
|
+
},
|
839
842
|
"gemini-2.0-flash-lite": {
|
840
843
|
"description": "Gemini 2.0 Flash è una variante del modello Flash, ottimizzata per obiettivi come il rapporto costo-efficacia e la bassa latenza."
|
841
844
|
},
|
@@ -76,6 +76,7 @@
|
|
76
76
|
"custom": "カスタムモデル、デフォルトでは関数呼び出しとビジョン認識の両方をサポートしています。上記機能の有効性を確認してください。",
|
77
77
|
"file": "このモデルはファイルのアップロードと認識をサポートしています。",
|
78
78
|
"functionCall": "このモデルは関数呼び出し(Function Call)をサポートしています。",
|
79
|
+
"imageOutput": "このモデルは画像生成をサポートしています",
|
79
80
|
"reasoning": "このモデルは深い思考をサポートしています",
|
80
81
|
"search": "このモデルはオンライン検索をサポートしています",
|
81
82
|
"tokens": "このモデルは1つのセッションあたり最大{{tokens}}トークンをサポートしています。",
|
@@ -836,6 +836,9 @@
|
|
836
836
|
"gemini-2.0-flash-exp": {
|
837
837
|
"description": "Gemini 2.0 Flash モデルのバリアントで、コスト効率と低遅延などの目標に最適化されています。"
|
838
838
|
},
|
839
|
+
"gemini-2.0-flash-exp-image-generation": {
|
840
|
+
"description": "Gemini 2.0 Flash 実験モデル、画像生成をサポート"
|
841
|
+
},
|
839
842
|
"gemini-2.0-flash-lite": {
|
840
843
|
"description": "Gemini 2.0 Flashモデルのバリアントで、コスト効率と低遅延などの目標に最適化されています。"
|
841
844
|
},
|
@@ -76,6 +76,7 @@
|
|
76
76
|
"custom": "사용자 정의 모델, 기본적으로 함수 호출 및 시각 인식을 모두 지원하며, 실제 기능을 확인하세요",
|
77
77
|
"file": "이 모델은 파일 업로드 및 인식을 지원합니다",
|
78
78
|
"functionCall": "이 모델은 함수 호출을 지원합니다",
|
79
|
+
"imageOutput": "이 모델은 이미지를 생성하는 기능을 지원합니다.",
|
79
80
|
"reasoning": "이 모델은 깊이 있는 사고를 지원합니다.",
|
80
81
|
"search": "이 모델은 온라인 검색을 지원합니다.",
|
81
82
|
"tokens": "이 모델은 단일 세션당 최대 {{tokens}} 토큰을 지원합니다",
|
@@ -836,6 +836,9 @@
|
|
836
836
|
"gemini-2.0-flash-exp": {
|
837
837
|
"description": "Gemini 2.0 Flash 모델 변형으로, 비용 효율성과 저지연 등의 목표를 위해 최적화되었습니다."
|
838
838
|
},
|
839
|
+
"gemini-2.0-flash-exp-image-generation": {
|
840
|
+
"description": "Gemini 2.0 Flash 실험 모델, 이미지 생성을 지원합니다."
|
841
|
+
},
|
839
842
|
"gemini-2.0-flash-lite": {
|
840
843
|
"description": "Gemini 2.0 플래시 모델 변형으로, 비용 효율성과 낮은 지연 시간 등의 목표를 위해 최적화되었습니다."
|
841
844
|
},
|
@@ -76,6 +76,7 @@
|
|
76
76
|
"custom": "Custom model, by default, supports both function call and visual recognition. Please verify the availability of the above capabilities based on actual needs.",
|
77
77
|
"file": "This model supports file upload for reading and recognition.",
|
78
78
|
"functionCall": "This model supports function call.",
|
79
|
+
"imageOutput": "Dit model ondersteunt het genereren van afbeeldingen",
|
79
80
|
"reasoning": "Dit model ondersteunt diepgaand denken",
|
80
81
|
"search": "Dit model ondersteunt online zoeken",
|
81
82
|
"tokens": "This model supports up to {{tokens}} tokens in a single session.",
|
@@ -836,6 +836,9 @@
|
|
836
836
|
"gemini-2.0-flash-exp": {
|
837
837
|
"description": "Gemini 2.0 Flash modelvariant, geoptimaliseerd voor kosteneffectiviteit en lage latentie."
|
838
838
|
},
|
839
|
+
"gemini-2.0-flash-exp-image-generation": {
|
840
|
+
"description": "Gemini 2.0 Flash experimenteel model, ondersteunt afbeeldingsgeneratie"
|
841
|
+
},
|
839
842
|
"gemini-2.0-flash-lite": {
|
840
843
|
"description": "Gemini 2.0 Flash is een modelvariant die is geoptimaliseerd voor kosteneffectiviteit en lage latentie."
|
841
844
|
},
|
@@ -76,6 +76,7 @@
|
|
76
76
|
"custom": "Niestandardowy model, domyślnie obsługujący zarówno wywołania funkcji, jak i rozpoznawanie wizualne. Proszę zweryfikować możliwość użycia tych funkcji w praktyce.",
|
77
77
|
"file": "Ten model obsługuje wczytywanie plików i rozpoznawanie",
|
78
78
|
"functionCall": "Ten model obsługuje wywołania funkcji (Function Call).",
|
79
|
+
"imageOutput": "Ten model wspiera generowanie obrazów",
|
79
80
|
"reasoning": "Ten model wspiera głębokie myślenie",
|
80
81
|
"search": "Ten model wspiera wyszukiwanie w sieci",
|
81
82
|
"tokens": "Ten model obsługuje maksymalnie {{tokens}} tokenów w pojedynczej sesji.",
|
@@ -836,6 +836,9 @@
|
|
836
836
|
"gemini-2.0-flash-exp": {
|
837
837
|
"description": "Gemini 2.0 Flash to wariant modelu, zoptymalizowany pod kątem efektywności kosztowej i niskiego opóźnienia."
|
838
838
|
},
|
839
|
+
"gemini-2.0-flash-exp-image-generation": {
|
840
|
+
"description": "Model eksperymentalny Gemini 2.0 Flash, wspierający generowanie obrazów"
|
841
|
+
},
|
839
842
|
"gemini-2.0-flash-lite": {
|
840
843
|
"description": "Gemini 2.0 Flash to wariant modelu, zoptymalizowany pod kątem efektywności kosztowej i niskiego opóźnienia."
|
841
844
|
},
|
@@ -76,6 +76,7 @@
|
|
76
76
|
"custom": "Modelo personalizado, por padrão, suporta chamadas de função e reconhecimento visual. Por favor, verifique a disponibilidade dessas capacidades de acordo com a situação real.",
|
77
77
|
"file": "Este modelo suporta leitura e reconhecimento de arquivos enviados.",
|
78
78
|
"functionCall": "Este modelo suporta chamadas de função.",
|
79
|
+
"imageOutput": "Este modelo suporta a geração de imagens",
|
79
80
|
"reasoning": "Este modelo suporta pensamento profundo",
|
80
81
|
"search": "Este modelo suporta pesquisa online",
|
81
82
|
"tokens": "Este modelo suporta no máximo {{tokens}} tokens por sessão.",
|
@@ -836,6 +836,9 @@
|
|
836
836
|
"gemini-2.0-flash-exp": {
|
837
837
|
"description": "Variante do modelo Gemini 2.0 Flash, otimizada para custo-benefício e baixa latência."
|
838
838
|
},
|
839
|
+
"gemini-2.0-flash-exp-image-generation": {
|
840
|
+
"description": "Modelo experimental Gemini 2.0 Flash, suporta geração de imagens"
|
841
|
+
},
|
839
842
|
"gemini-2.0-flash-lite": {
|
840
843
|
"description": "Variante do modelo Gemini 2.0 Flash, otimizada para custo-benefício e baixa latência."
|
841
844
|
},
|
@@ -76,6 +76,7 @@
|
|
76
76
|
"custom": "Пользовательская модель по умолчанию поддерживает как вызов функций, так и распознавание изображений. Пожалуйста, проверьте доступность указанных возможностей в вашем случае",
|
77
77
|
"file": "Эта модель поддерживает загрузку и распознавание файлов",
|
78
78
|
"functionCall": "Эта модель поддерживает вызов функций",
|
79
|
+
"imageOutput": "Эта модель поддерживает генерацию изображений",
|
79
80
|
"reasoning": "Эта модель поддерживает глубокое мышление",
|
80
81
|
"search": "Эта модель поддерживает поиск в интернете",
|
81
82
|
"tokens": "Эта модель поддерживает до {{tokens}} токенов в одной сессии",
|
@@ -836,6 +836,9 @@
|
|
836
836
|
"gemini-2.0-flash-exp": {
|
837
837
|
"description": "Модельный вариант Gemini 2.0 Flash, оптимизированный для достижения таких целей, как экономическая эффективность и низкая задержка."
|
838
838
|
},
|
839
|
+
"gemini-2.0-flash-exp-image-generation": {
|
840
|
+
"description": "Экспериментальная модель Gemini 2.0 Flash, поддерживающая генерацию изображений"
|
841
|
+
},
|
839
842
|
"gemini-2.0-flash-lite": {
|
840
843
|
"description": "Модельный вариант Gemini 2.0 Flash, оптимизированный для достижения таких целей, как экономическая эффективность и низкая задержка."
|
841
844
|
},
|
@@ -76,6 +76,7 @@
|
|
76
76
|
"custom": "Özel model, varsayılan olarak hem fonksiyon çağrısını hem de görüntü tanımayı destekler, yukarıdaki yeteneklerin kullanılabilirliğini doğrulamak için lütfen gerçek durumu kontrol edin",
|
77
77
|
"file": "Bu model dosya yükleme ve tanımayı destekler",
|
78
78
|
"functionCall": "Bu model fonksiyon çağrısını destekler",
|
79
|
+
"imageOutput": "Bu model resim oluşturmayı destekler",
|
79
80
|
"reasoning": "Bu model derin düşünmeyi destekler",
|
80
81
|
"search": "Bu model çevrimiçi aramayı destekler",
|
81
82
|
"tokens": "Bu model tek bir oturumda en fazla {{tokens}} Token destekler",
|
@@ -836,6 +836,9 @@
|
|
836
836
|
"gemini-2.0-flash-exp": {
|
837
837
|
"description": "Gemini 2.0 Flash modeli varyantı, maliyet etkinliği ve düşük gecikme gibi hedefler için optimize edilmiştir."
|
838
838
|
},
|
839
|
+
"gemini-2.0-flash-exp-image-generation": {
|
840
|
+
"description": "Gemini 2.0 Flash deneysel modeli, görüntü oluşturmayı destekler"
|
841
|
+
},
|
839
842
|
"gemini-2.0-flash-lite": {
|
840
843
|
"description": "Gemini 2.0 Flash model varyantı, maliyet etkinliği ve düşük gecikme gibi hedefler için optimize edilmiştir."
|
841
844
|
},
|
@@ -76,6 +76,7 @@
|
|
76
76
|
"custom": "Mô hình tùy chỉnh, mặc định hỗ trợ cả cuộc gọi hàm và nhận diện hình ảnh, vui lòng xác minh khả năng sử dụng của chúng theo tình hình cụ thể",
|
77
77
|
"file": "Mô hình này hỗ trợ tải lên và nhận diện tệp",
|
78
78
|
"functionCall": "Mô hình này hỗ trợ cuộc gọi hàm (Function Call)",
|
79
|
+
"imageOutput": "Mô hình này hỗ trợ tạo ra hình ảnh",
|
79
80
|
"reasoning": "Mô hình này hỗ trợ tư duy sâu sắc",
|
80
81
|
"search": "Mô hình này hỗ trợ tìm kiếm trực tuyến",
|
81
82
|
"tokens": "Mỗi phiên của mô hình này hỗ trợ tối đa {{tokens}} Tokens",
|
@@ -836,6 +836,9 @@
|
|
836
836
|
"gemini-2.0-flash-exp": {
|
837
837
|
"description": "Biến thể mô hình Gemini 2.0 Flash, được tối ưu hóa cho hiệu quả chi phí và độ trễ thấp."
|
838
838
|
},
|
839
|
+
"gemini-2.0-flash-exp-image-generation": {
|
840
|
+
"description": "Mô hình thử nghiệm Gemini 2.0 Flash, hỗ trợ tạo hình ảnh"
|
841
|
+
},
|
839
842
|
"gemini-2.0-flash-lite": {
|
840
843
|
"description": "Biến thể mô hình Gemini 2.0 Flash được tối ưu hóa cho hiệu quả chi phí và độ trễ thấp."
|
841
844
|
},
|
@@ -76,6 +76,7 @@
|
|
76
76
|
"custom": "自定义模型,默认设定同时支持函数调用与视觉识别,请根据实际情况验证上述能力的可用性",
|
77
77
|
"file": "该模型支持上传文件读取与识别",
|
78
78
|
"functionCall": "该模型支持函数调用(Function Call)",
|
79
|
+
"imageOutput": "该模型支持生成图片",
|
79
80
|
"reasoning": "该模型支持深度思考",
|
80
81
|
"search": "该模型支持联网搜索",
|
81
82
|
"tokens": "该模型单个会话最多支持 {{tokens}} Tokens",
|
@@ -836,6 +836,9 @@
|
|
836
836
|
"gemini-2.0-flash-exp": {
|
837
837
|
"description": "Gemini 2.0 Flash 模型变体,针对成本效益和低延迟等目标进行了优化。"
|
838
838
|
},
|
839
|
+
"gemini-2.0-flash-exp-image-generation": {
|
840
|
+
"description": "Gemini 2.0 Flash 实验模型,支持图像生成"
|
841
|
+
},
|
839
842
|
"gemini-2.0-flash-lite": {
|
840
843
|
"description": "Gemini 2.0 Flash 模型变体,针对成本效益和低延迟等目标进行了优化。"
|
841
844
|
},
|
@@ -836,6 +836,9 @@
|
|
836
836
|
"gemini-2.0-flash-exp": {
|
837
837
|
"description": "Gemini 2.0 Flash 模型變體,針對成本效益和低延遲等目標進行了優化。"
|
838
838
|
},
|
839
|
+
"gemini-2.0-flash-exp-image-generation": {
|
840
|
+
"description": "Gemini 2.0 Flash 實驗模型,支持圖像生成"
|
841
|
+
},
|
839
842
|
"gemini-2.0-flash-lite": {
|
840
843
|
"description": "Gemini 2.0 Flash 模型變體,針對成本效益和低延遲等目標進行了優化。"
|
841
844
|
},
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@lobehub/chat",
|
3
|
-
"version": "1.71.
|
3
|
+
"version": "1.71.1",
|
4
4
|
"description": "Lobe Chat - an open-source, high-performance chatbot framework that supports speech synthesis, multimodal, and extensible Function Call plugin system. Supports one-click free deployment of your private ChatGPT/LLM web application.",
|
5
5
|
"keywords": [
|
6
6
|
"framework",
|
@@ -7,6 +7,7 @@ import {
|
|
7
7
|
AtomIcon,
|
8
8
|
LucideEye,
|
9
9
|
LucideGlobe,
|
10
|
+
LucideImage,
|
10
11
|
LucidePaperclip,
|
11
12
|
ToyBrick,
|
12
13
|
} from 'lucide-react';
|
@@ -56,6 +57,10 @@ const useStyles = createStyles(({ css, token, isDarkMode }) => ({
|
|
56
57
|
color: ${token.green};
|
57
58
|
background: ${token.green1};
|
58
59
|
`,
|
60
|
+
tagGreenDeep: css`
|
61
|
+
color: ${token.green9};
|
62
|
+
background: ${token.green3};
|
63
|
+
`,
|
59
64
|
tagPurple: css`
|
60
65
|
color: ${token.purple};
|
61
66
|
background: ${token.purple1};
|
@@ -98,6 +103,17 @@ export const ModelInfoTags = memo<ModelInfoTagsProps>(
|
|
98
103
|
</div>
|
99
104
|
</Tooltip>
|
100
105
|
)}
|
106
|
+
{model.imageOutput && (
|
107
|
+
<Tooltip
|
108
|
+
placement={placement}
|
109
|
+
styles={{ root: { pointerEvents: 'none' } }}
|
110
|
+
title={t('ModelSelect.featureTag.imageOutput')}
|
111
|
+
>
|
112
|
+
<div className={cx(styles.tag, styles.tagGreen)} style={{ cursor: 'pointer' }} title="">
|
113
|
+
<Icon icon={LucideImage} />
|
114
|
+
</div>
|
115
|
+
</Tooltip>
|
116
|
+
)}
|
101
117
|
{model.vision && (
|
102
118
|
<Tooltip
|
103
119
|
placement={placement}
|
@@ -94,6 +94,7 @@ const googleChatModels: AIChatModelCard[] = [
|
|
94
94
|
},
|
95
95
|
{
|
96
96
|
abilities: {
|
97
|
+
imageOutput: true,
|
97
98
|
vision: true,
|
98
99
|
},
|
99
100
|
contextWindowTokens: 32_768,
|
@@ -109,6 +110,24 @@ const googleChatModels: AIChatModelCard[] = [
|
|
109
110
|
releasedAt: '2025-02-05',
|
110
111
|
type: 'chat',
|
111
112
|
},
|
113
|
+
{
|
114
|
+
abilities: {
|
115
|
+
imageOutput: true,
|
116
|
+
vision: true,
|
117
|
+
},
|
118
|
+
contextWindowTokens: 32_768,
|
119
|
+
description: 'Gemini 2.0 Flash 实验模型,支持图像生成',
|
120
|
+
displayName: 'Gemini 2.0 Flash (Image Generation) Experimental',
|
121
|
+
enabled: true,
|
122
|
+
id: 'gemini-2.0-flash-exp-image-generation',
|
123
|
+
maxOutput: 8192,
|
124
|
+
pricing: {
|
125
|
+
input: 0,
|
126
|
+
output: 0,
|
127
|
+
},
|
128
|
+
releasedAt: '2025-03-14',
|
129
|
+
type: 'chat',
|
130
|
+
},
|
112
131
|
{
|
113
132
|
abilities: {
|
114
133
|
vision: true,
|
@@ -35,9 +35,27 @@ const vertexaiChatModels: AIChatModelCard[] = [
|
|
35
35
|
id: 'gemini-2.0-flash',
|
36
36
|
maxOutput: 8192,
|
37
37
|
pricing: {
|
38
|
-
cachedInput: 0.
|
39
|
-
input: 0.
|
40
|
-
output: 0.
|
38
|
+
cachedInput: 0.0375,
|
39
|
+
input: 0.15,
|
40
|
+
output: 0.6,
|
41
|
+
},
|
42
|
+
releasedAt: '2025-02-05',
|
43
|
+
type: 'chat',
|
44
|
+
},
|
45
|
+
{
|
46
|
+
abilities: {
|
47
|
+
functionCall: true,
|
48
|
+
vision: true,
|
49
|
+
},
|
50
|
+
contextWindowTokens: 1_048_576 + 8192,
|
51
|
+
description: 'Gemini 2.0 Flash 模型变体,针对成本效益和低延迟等目标进行了优化。',
|
52
|
+
displayName: 'Gemini 2.0 Flash-Lite',
|
53
|
+
id: 'gemini-2.0-flash-lite',
|
54
|
+
maxOutput: 8192,
|
55
|
+
pricing: {
|
56
|
+
cachedInput: 0.018_75,
|
57
|
+
input: 0.075,
|
58
|
+
output: 0.3,
|
41
59
|
},
|
42
60
|
releasedAt: '2025-02-05',
|
43
61
|
type: 'chat',
|
@@ -54,9 +72,9 @@ const vertexaiChatModels: AIChatModelCard[] = [
|
|
54
72
|
id: 'gemini-2.0-flash-001',
|
55
73
|
maxOutput: 8192,
|
56
74
|
pricing: {
|
57
|
-
cachedInput: 0.
|
58
|
-
input: 0.
|
59
|
-
output: 0.
|
75
|
+
cachedInput: 0.0375,
|
76
|
+
input: 0.15,
|
77
|
+
output: 0.6,
|
60
78
|
},
|
61
79
|
releasedAt: '2025-02-05',
|
62
80
|
type: 'chat',
|
@@ -10,7 +10,6 @@ import {
|
|
10
10
|
SchemaType,
|
11
11
|
} from '@google/generative-ai';
|
12
12
|
|
13
|
-
import { VertexAIStream } from '@/libs/agent-runtime/utils/streams/vertex-ai';
|
14
13
|
import type { ChatModelCard } from '@/types/llm';
|
15
14
|
import { imageUrlToBase64 } from '@/utils/imageToBase64';
|
16
15
|
import { safeParseJSON } from '@/utils/safeParseJSON';
|
@@ -28,11 +27,24 @@ import { ModelProvider } from '../types/type';
|
|
28
27
|
import { AgentRuntimeError } from '../utils/createError';
|
29
28
|
import { debugStream } from '../utils/debugStream';
|
30
29
|
import { StreamingResponse } from '../utils/response';
|
31
|
-
import {
|
30
|
+
import {
|
31
|
+
GoogleGenerativeAIStream,
|
32
|
+
VertexAIStream,
|
33
|
+
convertIterableToStream,
|
34
|
+
} from '../utils/streams';
|
32
35
|
import { parseDataUri } from '../utils/uriParser';
|
33
36
|
|
34
37
|
const modelsOffSafetySettings = new Set(['gemini-2.0-flash-exp']);
|
35
|
-
|
38
|
+
|
39
|
+
const modelsWithModalities = new Set([
|
40
|
+
'gemini-2.0-flash-exp',
|
41
|
+
'gemini-2.0-flash-exp-image-generation',
|
42
|
+
]);
|
43
|
+
|
44
|
+
const modelsDisableInstuction = new Set([
|
45
|
+
'gemini-2.0-flash-exp',
|
46
|
+
'gemini-2.0-flash-exp-image-generation',
|
47
|
+
]);
|
36
48
|
|
37
49
|
export interface GoogleModelCard {
|
38
50
|
displayName: string;
|
@@ -97,9 +109,7 @@ export class LobeGoogleAI implements LobeRuntimeAI {
|
|
97
109
|
generationConfig: {
|
98
110
|
maxOutputTokens: payload.max_tokens,
|
99
111
|
// @ts-expect-error - Google SDK 0.24.0 doesn't have this property for now with
|
100
|
-
response_modalities: modelsWithModalities.has(model)
|
101
|
-
? ['Text', 'Image']
|
102
|
-
: undefined,
|
112
|
+
response_modalities: modelsWithModalities.has(model) ? ['Text', 'Image'] : undefined,
|
103
113
|
temperature: payload.temperature,
|
104
114
|
topP: payload.top_p,
|
105
115
|
},
|
@@ -129,7 +139,9 @@ export class LobeGoogleAI implements LobeRuntimeAI {
|
|
129
139
|
)
|
130
140
|
.generateContentStream({
|
131
141
|
contents,
|
132
|
-
systemInstruction:
|
142
|
+
systemInstruction: modelsDisableInstuction.has(model)
|
143
|
+
? undefined
|
144
|
+
: (payload.system as string),
|
133
145
|
tools: this.buildGoogleTools(payload.tools, payload),
|
134
146
|
});
|
135
147
|
|
@@ -193,4 +193,94 @@ describe('GoogleGenerativeAIStream', () => {
|
|
193
193
|
`data: {"inputImageTokens":258,"inputTextTokens":8,"totalInputTokens":266,"totalTokens":266}\n\n`,
|
194
194
|
]);
|
195
195
|
});
|
196
|
+
|
197
|
+
it('should handle stop with content', async () => {
|
198
|
+
vi.spyOn(uuidModule, 'nanoid').mockReturnValueOnce('1');
|
199
|
+
|
200
|
+
const data = [
|
201
|
+
{
|
202
|
+
candidates: [
|
203
|
+
{
|
204
|
+
content: { parts: [{ text: '234' }], role: 'model' },
|
205
|
+
safetyRatings: [
|
206
|
+
{ category: 'HARM_CATEGORY_HATE_SPEECH', probability: 'NEGLIGIBLE' },
|
207
|
+
{ category: 'HARM_CATEGORY_DANGEROUS_CONTENT', probability: 'NEGLIGIBLE' },
|
208
|
+
{ category: 'HARM_CATEGORY_HARASSMENT', probability: 'NEGLIGIBLE' },
|
209
|
+
{ category: 'HARM_CATEGORY_SEXUALLY_EXPLICIT', probability: 'NEGLIGIBLE' },
|
210
|
+
],
|
211
|
+
},
|
212
|
+
],
|
213
|
+
text: () => '234',
|
214
|
+
usageMetadata: {
|
215
|
+
promptTokenCount: 20,
|
216
|
+
totalTokenCount: 20,
|
217
|
+
promptTokensDetails: [{ modality: 'TEXT', tokenCount: 20 }],
|
218
|
+
},
|
219
|
+
modelVersion: 'gemini-2.0-flash-exp-image-generation',
|
220
|
+
},
|
221
|
+
{
|
222
|
+
text: () => '567890\n',
|
223
|
+
candidates: [
|
224
|
+
{
|
225
|
+
content: { parts: [{ text: '567890\n' }], role: 'model' },
|
226
|
+
finishReason: 'STOP',
|
227
|
+
safetyRatings: [
|
228
|
+
{ category: 'HARM_CATEGORY_HATE_SPEECH', probability: 'NEGLIGIBLE' },
|
229
|
+
{ category: 'HARM_CATEGORY_DANGEROUS_CONTENT', probability: 'NEGLIGIBLE' },
|
230
|
+
{ category: 'HARM_CATEGORY_HARASSMENT', probability: 'NEGLIGIBLE' },
|
231
|
+
{ category: 'HARM_CATEGORY_SEXUALLY_EXPLICIT', probability: 'NEGLIGIBLE' },
|
232
|
+
],
|
233
|
+
},
|
234
|
+
],
|
235
|
+
usageMetadata: {
|
236
|
+
promptTokenCount: 19,
|
237
|
+
candidatesTokenCount: 11,
|
238
|
+
totalTokenCount: 30,
|
239
|
+
promptTokensDetails: [{ modality: 'TEXT', tokenCount: 19 }],
|
240
|
+
candidatesTokensDetails: [{ modality: 'TEXT', tokenCount: 11 }],
|
241
|
+
},
|
242
|
+
modelVersion: 'gemini-2.0-flash-exp-image-generation',
|
243
|
+
},
|
244
|
+
];
|
245
|
+
|
246
|
+
const mockGoogleStream = new ReadableStream({
|
247
|
+
start(controller) {
|
248
|
+
data.forEach((item) => {
|
249
|
+
controller.enqueue(item);
|
250
|
+
});
|
251
|
+
|
252
|
+
controller.close();
|
253
|
+
},
|
254
|
+
});
|
255
|
+
|
256
|
+
const protocolStream = GoogleGenerativeAIStream(mockGoogleStream);
|
257
|
+
|
258
|
+
const decoder = new TextDecoder();
|
259
|
+
const chunks = [];
|
260
|
+
|
261
|
+
// @ts-ignore
|
262
|
+
for await (const chunk of protocolStream) {
|
263
|
+
chunks.push(decoder.decode(chunk, { stream: true }));
|
264
|
+
}
|
265
|
+
|
266
|
+
expect(chunks).toEqual(
|
267
|
+
[
|
268
|
+
'id: chat_1',
|
269
|
+
'event: text',
|
270
|
+
'data: "234"\n',
|
271
|
+
|
272
|
+
'id: chat_1',
|
273
|
+
'event: text',
|
274
|
+
`data: "567890\\n"\n`,
|
275
|
+
// stop
|
276
|
+
'id: chat_1',
|
277
|
+
'event: stop',
|
278
|
+
`data: "STOP"\n`,
|
279
|
+
// usage
|
280
|
+
'id: chat_1',
|
281
|
+
'event: usage',
|
282
|
+
`data: {"inputTextTokens":19,"totalInputTokens":19,"totalOutputTokens":11,"totalTokens":30}\n`,
|
283
|
+
].map((i) => i + '\n'),
|
284
|
+
);
|
285
|
+
});
|
196
286
|
});
|
@@ -71,6 +71,7 @@ const transformGoogleGenerativeAIStream = (
|
|
71
71
|
if (chunk.usageMetadata) {
|
72
72
|
const usage = chunk.usageMetadata;
|
73
73
|
return [
|
74
|
+
!!text ? { data: text, id: context?.id, type: 'text' } : undefined,
|
74
75
|
{ data: candidate.finishReason, id: context?.id, type: 'stop' },
|
75
76
|
{
|
76
77
|
data: {
|
@@ -88,7 +89,7 @@ const transformGoogleGenerativeAIStream = (
|
|
88
89
|
id: context?.id,
|
89
90
|
type: 'usage',
|
90
91
|
},
|
91
|
-
];
|
92
|
+
].filter(Boolean) as StreamProtocolChunk[];
|
92
93
|
}
|
93
94
|
return { data: candidate.finishReason, id: context?.id, type: 'stop' };
|
94
95
|
}
|
@@ -78,6 +78,7 @@ export default {
|
|
78
78
|
custom: '自定义模型,默认设定同时支持函数调用与视觉识别,请根据实际情况验证上述能力的可用性',
|
79
79
|
file: '该模型支持上传文件读取与识别',
|
80
80
|
functionCall: '该模型支持函数调用(Function Call)',
|
81
|
+
imageOutput: '该模型支持生成图片',
|
81
82
|
reasoning: '该模型支持深度思考',
|
82
83
|
search: '该模型支持联网搜索',
|
83
84
|
tokens: '该模型单个会话最多支持 {{tokens}} Tokens',
|
package/src/types/aiModel.ts
CHANGED
@@ -28,6 +28,10 @@ export interface ModelAbilities {
|
|
28
28
|
* whether model supports function call
|
29
29
|
*/
|
30
30
|
functionCall?: boolean;
|
31
|
+
/**
|
32
|
+
* whether model supports image output
|
33
|
+
*/
|
34
|
+
imageOutput?: boolean;
|
31
35
|
/**
|
32
36
|
* whether model supports reasoning
|
33
37
|
*/
|
@@ -36,7 +40,6 @@ export interface ModelAbilities {
|
|
36
40
|
* whether model supports search web
|
37
41
|
*/
|
38
42
|
search?: boolean;
|
39
|
-
|
40
43
|
/**
|
41
44
|
* whether model supports vision
|
42
45
|
*/
|