@lobehub/chat 1.111.7 → 1.111.9
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/.i18nrc.js +1 -1
- package/CHANGELOG.md +50 -0
- package/changelog/v1.json +18 -0
- package/locales/ar/chat.json +3 -0
- package/locales/bg-BG/chat.json +3 -0
- package/locales/de-DE/chat.json +3 -0
- package/locales/de-DE/error.json +12 -0
- package/locales/en-US/chat.json +3 -0
- package/locales/en-US/error.json +12 -0
- package/locales/es-ES/chat.json +3 -0
- package/locales/fa-IR/chat.json +3 -0
- package/locales/fr-FR/chat.json +3 -0
- package/locales/fr-FR/error.json +12 -0
- package/locales/it-IT/chat.json +3 -0
- package/locales/ja-JP/chat.json +3 -0
- package/locales/ja-JP/error.json +12 -0
- package/locales/ko-KR/chat.json +3 -0
- package/locales/ko-KR/error.json +12 -0
- package/locales/nl-NL/chat.json +3 -0
- package/locales/pl-PL/chat.json +3 -0
- package/locales/pt-BR/chat.json +3 -0
- package/locales/ru-RU/chat.json +3 -0
- package/locales/tr-TR/chat.json +3 -0
- package/locales/vi-VN/chat.json +3 -0
- package/locales/zh-CN/chat.json +3 -0
- package/locales/zh-TW/chat.json +3 -0
- package/locales/zh-TW/error.json +12 -0
- package/package.json +1 -1
- package/packages/model-runtime/src/azureOpenai/index.ts +22 -5
- package/packages/model-runtime/src/openai/index.ts +4 -1
- package/packages/model-runtime/src/types/chat.ts +5 -1
- package/packages/model-runtime/src/utils/streams/google-ai.test.ts +40 -0
- package/packages/model-runtime/src/utils/streams/google-ai.ts +31 -0
- package/packages/types/src/agent/chatConfig.ts +6 -0
- package/packages/types/src/aiModel.ts +2 -0
- package/src/config/aiModels/aihubmix.ts +10 -12
- package/src/config/aiModels/openai.ts +7 -4
- package/src/features/ChatInput/ActionBar/Model/ControlsForm.tsx +24 -0
- package/src/features/ChatInput/ActionBar/Model/GPT5ReasoningEffortSlider.tsx +58 -0
- package/src/features/ChatInput/ActionBar/Model/TextVerbositySlider.tsx +57 -0
- package/src/locales/default/chat.ts +3 -0
- package/src/locales/default/error.ts +12 -0
- package/src/services/chat.ts +8 -0
package/.i18nrc.js
CHANGED
package/CHANGELOG.md
CHANGED
@@ -2,6 +2,56 @@
|
|
2
2
|
|
3
3
|
# Changelog
|
4
4
|
|
5
|
+
### [Version 1.111.9](https://github.com/lobehub/lobe-chat/compare/v1.111.8...v1.111.9)
|
6
|
+
|
7
|
+
<sup>Released on **2025-08-12**</sup>
|
8
|
+
|
9
|
+
#### 💄 Styles
|
10
|
+
|
11
|
+
- **misc**: Improve Gemini error display with promptFeedback.
|
12
|
+
|
13
|
+
<br/>
|
14
|
+
|
15
|
+
<details>
|
16
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
17
|
+
|
18
|
+
#### Styles
|
19
|
+
|
20
|
+
- **misc**: Improve Gemini error display with promptFeedback, closes [#8707](https://github.com/lobehub/lobe-chat/issues/8707) ([51ad399](https://github.com/lobehub/lobe-chat/commit/51ad399))
|
21
|
+
|
22
|
+
</details>
|
23
|
+
|
24
|
+
<div align="right">
|
25
|
+
|
26
|
+
[](#readme-top)
|
27
|
+
|
28
|
+
</div>
|
29
|
+
|
30
|
+
### [Version 1.111.8](https://github.com/lobehub/lobe-chat/compare/v1.111.7...v1.111.8)
|
31
|
+
|
32
|
+
<sup>Released on **2025-08-11**</sup>
|
33
|
+
|
34
|
+
#### 💄 Styles
|
35
|
+
|
36
|
+
- **misc**: Support new GPT-5 Verbosity params.
|
37
|
+
|
38
|
+
<br/>
|
39
|
+
|
40
|
+
<details>
|
41
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
42
|
+
|
43
|
+
#### Styles
|
44
|
+
|
45
|
+
- **misc**: Support new GPT-5 Verbosity params, closes [#8715](https://github.com/lobehub/lobe-chat/issues/8715) ([0a724aa](https://github.com/lobehub/lobe-chat/commit/0a724aa))
|
46
|
+
|
47
|
+
</details>
|
48
|
+
|
49
|
+
<div align="right">
|
50
|
+
|
51
|
+
[](#readme-top)
|
52
|
+
|
53
|
+
</div>
|
54
|
+
|
5
55
|
### [Version 1.111.7](https://github.com/lobehub/lobe-chat/compare/v1.111.6...v1.111.7)
|
6
56
|
|
7
57
|
<sup>Released on **2025-08-11**</sup>
|
package/changelog/v1.json
CHANGED
@@ -1,4 +1,22 @@
|
|
1
1
|
[
|
2
|
+
{
|
3
|
+
"children": {
|
4
|
+
"improvements": [
|
5
|
+
"Improve Gemini error display with promptFeedback."
|
6
|
+
]
|
7
|
+
},
|
8
|
+
"date": "2025-08-12",
|
9
|
+
"version": "1.111.9"
|
10
|
+
},
|
11
|
+
{
|
12
|
+
"children": {
|
13
|
+
"improvements": [
|
14
|
+
"Support new GPT-5 Verbosity params."
|
15
|
+
]
|
16
|
+
},
|
17
|
+
"date": "2025-08-11",
|
18
|
+
"version": "1.111.8"
|
19
|
+
},
|
2
20
|
{
|
3
21
|
"children": {
|
4
22
|
"improvements": [
|
package/locales/ar/chat.json
CHANGED
package/locales/bg-BG/chat.json
CHANGED
package/locales/de-DE/chat.json
CHANGED
package/locales/de-DE/error.json
CHANGED
@@ -113,6 +113,18 @@
|
|
113
113
|
"PluginServerError": "Fehler bei der Serveranfrage des Plugins. Bitte überprüfen Sie die Fehlerinformationen unten in Ihrer Plugin-Beschreibungsdatei, Plugin-Konfiguration oder Serverimplementierung",
|
114
114
|
"PluginSettingsInvalid": "Das Plugin muss korrekt konfiguriert werden, um verwendet werden zu können. Bitte überprüfen Sie Ihre Konfiguration auf Richtigkeit",
|
115
115
|
"ProviderBizError": "Fehler bei der Anforderung des {{provider}}-Dienstes. Bitte überprüfen Sie die folgenden Informationen oder versuchen Sie es erneut.",
|
116
|
+
|
117
|
+
"GoogleAIBlockReason": {
|
118
|
+
"BLOCKLIST": "Ihr Inhalt enthält verbotene Begriffe. Bitte überprüfen und ändern Sie Ihre Eingabe, bevor Sie es erneut versuchen.",
|
119
|
+
"IMAGE_SAFETY": "Der generierte Bildinhalt wurde aus Sicherheitsgründen blockiert. Bitte versuchen Sie, Ihre Bildgenerierungsanfrage zu ändern.",
|
120
|
+
"LANGUAGE": "Die von Ihnen verwendete Sprache wird nicht unterstützt. Bitte versuchen Sie es mit Englisch oder anderen unterstützten Sprachen.",
|
121
|
+
"OTHER": "Inhalt wurde aus unbekannten Gründen blockiert. Bitte versuchen Sie, Ihre Anfrage umzuformulieren oder wenden Sie sich an den technischen Support.",
|
122
|
+
"PROHIBITED_CONTENT": "Ihr Inhalt könnte verbotene Inhaltstypen enthalten. Bitte passen Sie Ihre Anfrage an, um sicherzustellen, dass sie den Nutzungsrichtlinien entspricht.",
|
123
|
+
"RECITATION": "Ihr Inhalt wurde aufgrund möglicher Urheberrechtsprobleme blockiert. Bitte versuchen Sie, originalen Inhalt zu verwenden oder Ihre Anfrage umzuformulieren.",
|
124
|
+
"SAFETY": "Ihr Inhalt wurde aufgrund von Sicherheitsrichtlinien blockiert. Bitte versuchen Sie, Ihre Anfrage anzupassen, um potenziell schädliche oder unangemessene Inhalte zu vermeiden.",
|
125
|
+
"SPII": "Ihr Inhalt könnte sensible persönlich identifizierbare Informationen enthalten. Zum Schutz der Privatsphäre entfernen Sie bitte relevante sensible Informationen, bevor Sie es erneut versuchen.",
|
126
|
+
"default": "Inhalt wurde blockiert: {{blockReason}}. Bitte passen Sie Ihren Anfrageinhalt an und versuchen Sie es erneut."
|
127
|
+
},
|
116
128
|
"QuotaLimitReached": "Es tut uns leid, die aktuelle Token-Nutzung oder die Anzahl der Anfragen hat das Kontingent (Quota) für diesen Schlüssel erreicht. Bitte erhöhen Sie das Kontingent für diesen Schlüssel oder versuchen Sie es später erneut.",
|
117
129
|
"StreamChunkError": "Fehler beim Parsen des Nachrichtenchunks der Streaming-Anfrage. Bitte überprüfen Sie, ob die aktuelle API-Schnittstelle den Standards entspricht, oder wenden Sie sich an Ihren API-Anbieter.",
|
118
130
|
"SubscriptionKeyMismatch": "Es tut uns leid, aufgrund eines vorübergehenden Systemfehlers ist das aktuelle Abonnement vorübergehend ungültig. Bitte klicken Sie auf die Schaltfläche unten, um das Abonnement wiederherzustellen, oder kontaktieren Sie uns per E-Mail für Unterstützung.",
|
package/locales/en-US/chat.json
CHANGED
package/locales/en-US/error.json
CHANGED
@@ -113,6 +113,18 @@
|
|
113
113
|
"PluginServerError": "Plugin server request returned an error. Please check your plugin manifest file, plugin configuration, or server implementation based on the error information below",
|
114
114
|
"PluginSettingsInvalid": "This plugin needs to be correctly configured before it can be used. Please check if your configuration is correct",
|
115
115
|
"ProviderBizError": "Error requesting {{provider}} service, please troubleshoot or retry based on the following information",
|
116
|
+
|
117
|
+
"GoogleAIBlockReason": {
|
118
|
+
"BLOCKLIST": "Your content contains prohibited terms. Please review and modify your input before retrying.",
|
119
|
+
"IMAGE_SAFETY": "Generated image content was blocked for safety reasons. Please try modifying your image generation request.",
|
120
|
+
"LANGUAGE": "The language you used is not supported. Please try using English or other supported languages.",
|
121
|
+
"OTHER": "Content was blocked for unknown reasons. Please try rephrasing your request or contact technical support.",
|
122
|
+
"PROHIBITED_CONTENT": "Your content may contain prohibited content types. Please adjust your request to ensure it complies with usage guidelines.",
|
123
|
+
"RECITATION": "Your content was blocked due to potential copyright issues. Please try using original content or rephrasing your request.",
|
124
|
+
"SAFETY": "Your content was blocked due to safety policies. Please try adjusting your request to avoid potentially harmful or inappropriate content.",
|
125
|
+
"SPII": "Your content may contain sensitive personally identifiable information. For privacy protection, please remove relevant sensitive information before retrying.",
|
126
|
+
"default": "Content was blocked: {{blockReason}}. Please adjust your request content and try again."
|
127
|
+
},
|
116
128
|
"QuotaLimitReached": "We apologize, but the current token usage or number of requests has reached the quota limit for this key. Please increase the quota for this key or try again later.",
|
117
129
|
"StreamChunkError": "Error parsing the message chunk of the streaming request. Please check if the current API interface complies with the standard specifications, or contact your API provider for assistance.",
|
118
130
|
"SubscriptionKeyMismatch": "We apologize for the inconvenience. Due to a temporary system malfunction, your current subscription usage is inactive. Please click the button below to restore your subscription, or contact us via email for support.",
|
package/locales/es-ES/chat.json
CHANGED
package/locales/fa-IR/chat.json
CHANGED
package/locales/fr-FR/chat.json
CHANGED
package/locales/fr-FR/error.json
CHANGED
@@ -113,6 +113,18 @@
|
|
113
113
|
"PluginServerError": "Erreur de réponse du serveur du plugin. Veuillez vérifier le fichier de description du plugin, la configuration du plugin ou la mise en œuvre côté serveur en fonction des informations d'erreur ci-dessous",
|
114
114
|
"PluginSettingsInvalid": "Ce plugin doit être correctement configuré avant de pouvoir être utilisé. Veuillez vérifier votre configuration",
|
115
115
|
"ProviderBizError": "Erreur de service {{provider}}. Veuillez vérifier les informations suivantes ou réessayer.",
|
116
|
+
|
117
|
+
"GoogleAIBlockReason": {
|
118
|
+
"BLOCKLIST": "Votre contenu contient des termes interdits. Veuillez vérifier et modifier votre saisie avant de réessayer.",
|
119
|
+
"IMAGE_SAFETY": "Le contenu d'image généré a été bloqué pour des raisons de sécurité. Veuillez essayer de modifier votre demande de génération d'image.",
|
120
|
+
"LANGUAGE": "La langue que vous avez utilisée n'est pas supportée. Veuillez essayer d'utiliser l'anglais ou d'autres langues supportées.",
|
121
|
+
"OTHER": "Le contenu a été bloqué pour des raisons inconnues. Veuillez essayer de reformuler votre demande ou contacter le support technique.",
|
122
|
+
"PROHIBITED_CONTENT": "Votre contenu peut contenir des types de contenu interdits. Veuillez ajuster votre demande pour vous assurer qu'elle respecte les directives d'utilisation.",
|
123
|
+
"RECITATION": "Votre contenu a été bloqué en raison de problèmes potentiels de droits d'auteur. Veuillez essayer d'utiliser du contenu original ou de reformuler votre demande.",
|
124
|
+
"SAFETY": "Votre contenu a été bloqué en raison des politiques de sécurité. Veuillez essayer d'ajuster votre demande pour éviter du contenu potentiellement nuisible ou inapproprié.",
|
125
|
+
"SPII": "Votre contenu peut contenir des informations personnelles identifiables sensibles. Pour la protection de la vie privée, veuillez supprimer les informations sensibles pertinentes avant de réessayer.",
|
126
|
+
"default": "Contenu bloqué : {{blockReason}}. Veuillez ajuster le contenu de votre demande et réessayer."
|
127
|
+
},
|
116
128
|
"QuotaLimitReached": "Désolé, l'utilisation actuelle des tokens ou le nombre de requêtes a atteint la limite de quota de cette clé. Veuillez augmenter le quota de cette clé ou réessayer plus tard.",
|
117
129
|
"StreamChunkError": "Erreur de parsing du bloc de message de la requête en streaming. Veuillez vérifier si l'API actuelle respecte les normes ou contacter votre fournisseur d'API pour des conseils.",
|
118
130
|
"SubscriptionKeyMismatch": "Nous sommes désolés, en raison d'une défaillance système occasionnelle, l'utilisation actuelle de l'abonnement est temporairement inactive. Veuillez cliquer sur le bouton ci-dessous pour rétablir votre abonnement ou nous contacter par e-mail pour obtenir de l'aide.",
|
package/locales/it-IT/chat.json
CHANGED
package/locales/ja-JP/chat.json
CHANGED
package/locales/ja-JP/error.json
CHANGED
@@ -113,6 +113,18 @@
|
|
113
113
|
"PluginServerError": "プラグインサーバーのリクエストエラーが発生しました。以下のエラーメッセージを参考に、プラグインのマニフェストファイル、設定、サーバー実装を確認してください",
|
114
114
|
"PluginSettingsInvalid": "このプラグインを使用するには、正しい設定が必要です。設定が正しいかどうか確認してください",
|
115
115
|
"ProviderBizError": "リクエスト {{provider}} サービスでエラーが発生しました。以下の情報を確認して再試行してください。",
|
116
|
+
|
117
|
+
"GoogleAIBlockReason": {
|
118
|
+
"BLOCKLIST": "コンテンツに禁止された用語が含まれています。入力内容を確認・修正してから再試行してください。",
|
119
|
+
"IMAGE_SAFETY": "生成された画像コンテンツが安全上の理由でブロックされました。画像生成リクエストを修正して再試行してください。",
|
120
|
+
"LANGUAGE": "使用された言語はサポートされていません。英語またはその他のサポートされている言語で再質問してください。",
|
121
|
+
"OTHER": "不明な理由でコンテンツがブロックされました。リクエストを言い換えるか、テクニカルサポートにお問い合わせください。",
|
122
|
+
"PROHIBITED_CONTENT": "コンテンツに禁止されたコンテンツタイプが含まれている可能性があります。使用ガイドラインに準拠するようリクエストを調整してください。",
|
123
|
+
"RECITATION": "著作権問題の可能性によりコンテンツがブロックされました。オリジナルコンテンツの使用またはリクエストの言い換えを試してください。",
|
124
|
+
"SAFETY": "安全ポリシーによりコンテンツがブロックされました。有害または不適切な内容を避けるようリクエストを調整してください。",
|
125
|
+
"SPII": "コンテンツに機密個人識別情報が含まれている可能性があります。プライバシー保護のため、関連する機密情報を削除してから再試行してください。",
|
126
|
+
"default": "コンテンツがブロックされました:{{blockReason}}。リクエスト内容を調整してから再試行してください。"
|
127
|
+
},
|
116
128
|
"QuotaLimitReached": "申し訳ありませんが、現在のトークン使用量またはリクエスト回数がこのキーのクォータ上限に達しました。キーのクォータを増やすか、後でもう一度お試しください。",
|
117
129
|
"StreamChunkError": "ストリーミングリクエストのメッセージブロック解析エラーです。現在のAPIインターフェースが標準仕様に準拠しているか確認するか、APIプロバイダーにお問い合わせください。",
|
118
130
|
"SubscriptionKeyMismatch": "申し訳ありませんが、システムの一時的な障害により、現在のサブスクリプションの使用量が一時的に無効になっています。下のボタンをクリックしてサブスクリプションを復元するか、サポートを受けるためにメールでお問い合わせください。",
|
package/locales/ko-KR/chat.json
CHANGED
package/locales/ko-KR/error.json
CHANGED
@@ -113,6 +113,18 @@
|
|
113
113
|
"PluginServerError": "플러그인 서버 요청이 오류로 반환되었습니다. 플러그인 설명 파일, 플러그인 구성 또는 서버 구현을 확인해주세요.",
|
114
114
|
"PluginSettingsInvalid": "플러그인을 사용하려면 올바른 구성이 필요합니다. 구성이 올바른지 확인해주세요.",
|
115
115
|
"ProviderBizError": "요청한 {{provider}} 서비스에서 오류가 발생했습니다. 아래 정보를 확인하고 다시 시도해주세요.",
|
116
|
+
|
117
|
+
"GoogleAIBlockReason": {
|
118
|
+
"BLOCKLIST": "콘텐츠에 금지된 용어가 포함되어 있습니다. 입력 내용을 확인하고 수정한 후 다시 시도해주세요.",
|
119
|
+
"IMAGE_SAFETY": "생성된 이미지 콘텐츠가 안전상의 이유로 차단되었습니다. 이미지 생성 요청을 수정하여 다시 시도해주세요.",
|
120
|
+
"LANGUAGE": "사용하신 언어는 지원되지 않습니다. 영어나 기타 지원되는 언어로 다시 질문해주세요.",
|
121
|
+
"OTHER": "알 수 없는 이유로 콘텐츠가 차단되었습니다. 요청을 다시 표현하거나 기술 지원에 문의해주세요.",
|
122
|
+
"PROHIBITED_CONTENT": "콘텐츠에 금지된 콘텐츠 유형이 포함되어 있을 수 있습니다. 사용 가이드라인에 맞도록 요청을 조정해주세요.",
|
123
|
+
"RECITATION": "저작권 문제 가능성으로 인해 콘텐츠가 차단되었습니다. 원본 콘텐츠를 사용하거나 요청을 다시 표현해보세요.",
|
124
|
+
"SAFETY": "안전 정책으로 인해 콘텐츠가 차단되었습니다. 유해하거나 부적절한 내용을 피하도록 요청을 조정해주세요.",
|
125
|
+
"SPII": "콘텐츠에 민감한 개인 식별 정보가 포함되어 있을 수 있습니다. 개인정보 보호를 위해 관련 민감 정보를 제거한 후 다시 시도해주세요.",
|
126
|
+
"default": "콘텐츠가 차단되었습니다: {{blockReason}}. 요청 내용을 조정한 후 다시 시도해주세요."
|
127
|
+
},
|
116
128
|
"QuotaLimitReached": "죄송합니다. 현재 토큰 사용량 또는 요청 횟수가 해당 키의 할당량 한도에 도달했습니다. 해당 키의 할당량을 늘리거나 나중에 다시 시도해 주십시오.",
|
117
129
|
"StreamChunkError": "스트리밍 요청의 메시지 블록 구문 분석 오류입니다. 현재 API 인터페이스가 표준 규격에 부합하는지 확인하거나 API 공급자에게 문의하십시오.",
|
118
130
|
"SubscriptionKeyMismatch": "죄송합니다. 시스템의 일시적인 오류로 인해 현재 구독 사용량이 일시적으로 비활성화되었습니다. 아래 버튼을 클릭하여 구독을 복구하시거나, 이메일로 저희에게 지원을 요청해 주시기 바랍니다.",
|
package/locales/nl-NL/chat.json
CHANGED
package/locales/pl-PL/chat.json
CHANGED
package/locales/pt-BR/chat.json
CHANGED
package/locales/ru-RU/chat.json
CHANGED
package/locales/tr-TR/chat.json
CHANGED
package/locales/vi-VN/chat.json
CHANGED
package/locales/zh-CN/chat.json
CHANGED
package/locales/zh-TW/chat.json
CHANGED
package/locales/zh-TW/error.json
CHANGED
@@ -113,6 +113,18 @@
|
|
113
113
|
"PluginServerError": "外掛伺服器請求回傳錯誤。請根據下面的錯誤資訊檢查您的外掛描述檔案、外掛設定或伺服器實作",
|
114
114
|
"PluginSettingsInvalid": "該外掛需要正確設定後才可以使用。請檢查您的設定是否正確",
|
115
115
|
"ProviderBizError": "請求 {{provider}} 服務出錯,請根據以下資訊排查或重試",
|
116
|
+
|
117
|
+
"GoogleAIBlockReason": {
|
118
|
+
"BLOCKLIST": "您的內容包含被禁止的詞彙。請檢查並修改您的輸入內容後重試。",
|
119
|
+
"IMAGE_SAFETY": "生成的圖像內容因安全原因被阻止。請嘗試修改您的圖像生成請求。",
|
120
|
+
"LANGUAGE": "您使用的語言暫不被支援。請嘗試使用英語或其他支援的語言重新提問。",
|
121
|
+
"OTHER": "內容因未知原因被阻止。請嘗試重新表述您的請求或聯繫技術支援。",
|
122
|
+
"PROHIBITED_CONTENT": "您的內容可能包含禁止的內容類型。請調整您的請求,確保內容符合使用規範。",
|
123
|
+
"RECITATION": "您的內容因可能涉及版權問題而被阻止。請嘗試使用原創內容或重新表述您的請求。",
|
124
|
+
"SAFETY": "您的內容因安全策略而被阻止。請嘗試調整您的請求內容,避免包含可能的有害或不當內容。",
|
125
|
+
"SPII": "您的內容可能包含敏感個人身份資訊。為保護隱私,請移除相關敏感資訊後重試。",
|
126
|
+
"default": "內容被阻止:{{blockReason}}。請調整您的請求內容後重試。"
|
127
|
+
},
|
116
128
|
"QuotaLimitReached": "很抱歉,當前 Token 用量或請求次數已達該金鑰的配額上限,請增加該金鑰的配額或稍後再試",
|
117
129
|
"StreamChunkError": "流式請求的消息塊解析錯誤,請檢查當前 API 介面是否符合標準規範,或聯繫你的 API 供應商諮詢",
|
118
130
|
"SubscriptionKeyMismatch": "很抱歉,由於系統偶發故障,當前訂閱用量暫時失效,請點擊下方按鈕恢復訂閱,或郵件聯繫我們獲取支持",
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@lobehub/chat",
|
3
|
-
"version": "1.111.
|
3
|
+
"version": "1.111.9",
|
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",
|
@@ -56,16 +56,33 @@ export class LobeAzureOpenAI implements LobeRuntimeAI {
|
|
56
56
|
}));
|
57
57
|
|
58
58
|
try {
|
59
|
-
|
59
|
+
// Create parameters with proper typing for OpenAI SDK, handling reasoning_effort compatibility
|
60
|
+
const { reasoning_effort, ...otherParams } = params;
|
61
|
+
|
62
|
+
// Convert 'minimal' to 'low' for OpenAI SDK compatibility
|
63
|
+
const compatibleReasoningEffort = reasoning_effort === 'minimal' ? 'low' : reasoning_effort;
|
64
|
+
|
65
|
+
const baseParams = {
|
60
66
|
messages: await convertOpenAIMessages(
|
61
67
|
updatedMessages as OpenAI.ChatCompletionMessageParam[],
|
62
68
|
),
|
63
69
|
model,
|
64
|
-
...
|
70
|
+
...otherParams,
|
65
71
|
max_completion_tokens: undefined,
|
66
|
-
|
67
|
-
|
68
|
-
|
72
|
+
tool_choice: params.tools ? ('auto' as const) : undefined,
|
73
|
+
};
|
74
|
+
|
75
|
+
// Add reasoning_effort only if it exists and cast to proper type
|
76
|
+
const openaiParams = compatibleReasoningEffort
|
77
|
+
? {
|
78
|
+
...baseParams,
|
79
|
+
reasoning_effort: compatibleReasoningEffort as 'low' | 'medium' | 'high',
|
80
|
+
}
|
81
|
+
: baseParams;
|
82
|
+
|
83
|
+
const response = enableStreaming
|
84
|
+
? await this.client.chat.completions.create({ ...openaiParams, stream: true })
|
85
|
+
: await this.client.chat.completions.create({ ...openaiParams, stream: false });
|
69
86
|
if (enableStreaming) {
|
70
87
|
const stream = response as Stream<OpenAI.ChatCompletionChunk>;
|
71
88
|
const [prod, debug] = stream.tee();
|
@@ -60,7 +60,7 @@ export const LobeOpenAI = createOpenAICompatibleRuntime({
|
|
60
60
|
provider: ModelProvider.OpenAI,
|
61
61
|
responses: {
|
62
62
|
handlePayload: (payload) => {
|
63
|
-
const { enabledSearch, model, tools, ...rest } = payload;
|
63
|
+
const { enabledSearch, model, tools, verbosity, ...rest } = payload;
|
64
64
|
|
65
65
|
const openaiTools = enabledSearch
|
66
66
|
? [
|
@@ -85,6 +85,9 @@ export const LobeOpenAI = createOpenAICompatibleRuntime({
|
|
85
85
|
tools: openaiTools as any,
|
86
86
|
// computer-use series must set truncation as auto
|
87
87
|
...(model.startsWith('computer-use') && { truncation: 'auto' }),
|
88
|
+
text: verbosity
|
89
|
+
? { verbosity }
|
90
|
+
: undefined,
|
88
91
|
}) as any;
|
89
92
|
}
|
90
93
|
|
@@ -107,7 +107,7 @@ export interface ChatStreamPayload {
|
|
107
107
|
effort?: string;
|
108
108
|
summary?: string;
|
109
109
|
};
|
110
|
-
reasoning_effort?: 'low' | 'medium' | 'high';
|
110
|
+
reasoning_effort?: 'minimal' | 'low' | 'medium' | 'high';
|
111
111
|
responseMode?: 'stream' | 'json';
|
112
112
|
/**
|
113
113
|
* @title 是否开启流式请求
|
@@ -119,6 +119,9 @@ export interface ChatStreamPayload {
|
|
119
119
|
* @default 1
|
120
120
|
*/
|
121
121
|
temperature: number;
|
122
|
+
text?: {
|
123
|
+
verbosity?: 'low' | 'medium' | 'high';
|
124
|
+
};
|
122
125
|
/**
|
123
126
|
* use for Claude and Gemini
|
124
127
|
*/
|
@@ -135,6 +138,7 @@ export interface ChatStreamPayload {
|
|
135
138
|
*/
|
136
139
|
top_p?: number;
|
137
140
|
truncation?: 'auto' | 'disabled';
|
141
|
+
verbosity?: 'low' | 'medium' | 'high';
|
138
142
|
}
|
139
143
|
|
140
144
|
export interface ChatMethodOptions {
|
@@ -816,4 +816,44 @@ describe('GoogleGenerativeAIStream', () => {
|
|
816
816
|
].map((i) => i + '\n'),
|
817
817
|
);
|
818
818
|
});
|
819
|
+
|
820
|
+
it('should handle promptFeedback with blockReason (PROHIBITED_CONTENT)', async () => {
|
821
|
+
vi.spyOn(uuidModule, 'nanoid').mockReturnValueOnce('1');
|
822
|
+
|
823
|
+
const data = {
|
824
|
+
promptFeedback: {
|
825
|
+
blockReason: 'PROHIBITED_CONTENT',
|
826
|
+
},
|
827
|
+
usageMetadata: {
|
828
|
+
promptTokenCount: 4438,
|
829
|
+
totalTokenCount: 4438,
|
830
|
+
promptTokensDetails: [{ modality: 'TEXT', tokenCount: 4438 }],
|
831
|
+
},
|
832
|
+
modelVersion: 'gemini-2.5-pro',
|
833
|
+
responseId: 'THOUaKaNOeiGz7IPjL_VgQc',
|
834
|
+
};
|
835
|
+
|
836
|
+
const mockGoogleStream = new ReadableStream({
|
837
|
+
start(controller) {
|
838
|
+
controller.enqueue(data);
|
839
|
+
controller.close();
|
840
|
+
},
|
841
|
+
});
|
842
|
+
|
843
|
+
const protocolStream = GoogleGenerativeAIStream(mockGoogleStream);
|
844
|
+
|
845
|
+
const decoder = new TextDecoder();
|
846
|
+
const chunks = [];
|
847
|
+
|
848
|
+
// @ts-ignore
|
849
|
+
for await (const chunk of protocolStream) {
|
850
|
+
chunks.push(decoder.decode(chunk, { stream: true }));
|
851
|
+
}
|
852
|
+
|
853
|
+
expect(chunks).toEqual([
|
854
|
+
'id: chat_1\n',
|
855
|
+
'event: error\n',
|
856
|
+
`data: {"body":{"context":{"promptFeedback":{"blockReason":"PROHIBITED_CONTENT"}},"message":"您的请求可能包含违禁内容。请调整您的请求,确保内容符合使用规范。","provider":"google"},"type":"ProviderBizError"}\n\n`,
|
857
|
+
]);
|
858
|
+
});
|
819
859
|
});
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import { GenerateContentResponse } from '@google/genai';
|
2
2
|
|
3
|
+
import errorLocale from '@/locales/default/error';
|
3
4
|
import { ModelTokensUsage } from '@/types/message';
|
4
5
|
import { GroundingSearch } from '@/types/search';
|
5
6
|
import { nanoid } from '@/utils/uuid';
|
@@ -15,10 +16,40 @@ import {
|
|
15
16
|
generateToolCallId,
|
16
17
|
} from './protocol';
|
17
18
|
|
19
|
+
const getBlockReasonMessage = (blockReason: string): string => {
|
20
|
+
const blockReasonMessages = errorLocale.response.GoogleAIBlockReason;
|
21
|
+
|
22
|
+
return (
|
23
|
+
blockReasonMessages[blockReason as keyof typeof blockReasonMessages] ||
|
24
|
+
blockReasonMessages.default.replace('{{blockReason}}', blockReason)
|
25
|
+
);
|
26
|
+
};
|
27
|
+
|
18
28
|
const transformGoogleGenerativeAIStream = (
|
19
29
|
chunk: GenerateContentResponse,
|
20
30
|
context: StreamContext,
|
21
31
|
): StreamProtocolChunk | StreamProtocolChunk[] => {
|
32
|
+
// Handle promptFeedback with blockReason (e.g., PROHIBITED_CONTENT)
|
33
|
+
if ('promptFeedback' in chunk && (chunk as any).promptFeedback?.blockReason) {
|
34
|
+
const blockReason = (chunk as any).promptFeedback.blockReason;
|
35
|
+
const humanFriendlyMessage = getBlockReasonMessage(blockReason);
|
36
|
+
|
37
|
+
return {
|
38
|
+
data: {
|
39
|
+
body: {
|
40
|
+
context: {
|
41
|
+
promptFeedback: (chunk as any).promptFeedback,
|
42
|
+
},
|
43
|
+
message: humanFriendlyMessage,
|
44
|
+
provider: 'google',
|
45
|
+
},
|
46
|
+
type: 'ProviderBizError',
|
47
|
+
},
|
48
|
+
id: context?.id || 'error',
|
49
|
+
type: 'error',
|
50
|
+
};
|
51
|
+
}
|
52
|
+
|
22
53
|
// maybe need another structure to add support for multiple choices
|
23
54
|
const candidate = chunk.candidates?.[0];
|
24
55
|
const usage = chunk.usageMetadata;
|
@@ -26,6 +26,11 @@ export interface LobeAgentChatConfig {
|
|
26
26
|
enableReasoningEffort?: boolean;
|
27
27
|
reasoningBudgetToken?: number;
|
28
28
|
reasoningEffort?: 'low' | 'medium' | 'high';
|
29
|
+
gpt5ReasoningEffort?: 'minimal' | 'low' | 'medium' | 'high';
|
30
|
+
/**
|
31
|
+
* 输出文本详细程度控制
|
32
|
+
*/
|
33
|
+
textVerbosity?: 'low' | 'medium' | 'high';
|
29
34
|
thinking?: 'disabled' | 'auto' | 'enabled';
|
30
35
|
thinkingBudget?: number;
|
31
36
|
/**
|
@@ -71,4 +76,5 @@ export const AgentChatConfigSchema = z.object({
|
|
71
76
|
})
|
72
77
|
.optional(),
|
73
78
|
searchMode: z.enum(['off', 'on', 'auto']).optional(),
|
79
|
+
textVerbosity: z.enum(['low', 'medium', 'high']).optional(),
|
74
80
|
});
|
@@ -20,12 +20,12 @@ const aihubmixModels: AIChatModelCard[] = [
|
|
20
20
|
units: [
|
21
21
|
{ name: 'textInput', rate: 1.25, strategy: 'fixed', unit: 'millionTokens' },
|
22
22
|
{ name: 'textOutput', rate: 10, strategy: 'fixed', unit: 'millionTokens' },
|
23
|
-
{ name: 'textInput_cacheRead', rate: 0.
|
23
|
+
{ name: 'textInput_cacheRead', rate: 0.125, strategy: 'fixed', unit: 'millionTokens' },
|
24
24
|
],
|
25
25
|
},
|
26
26
|
releasedAt: '2025-08-07',
|
27
27
|
settings: {
|
28
|
-
extendParams: ['
|
28
|
+
extendParams: ['gpt5ReasoningEffort', 'textVerbosity'],
|
29
29
|
searchImpl: 'params',
|
30
30
|
},
|
31
31
|
type: 'chat',
|
@@ -48,12 +48,12 @@ const aihubmixModels: AIChatModelCard[] = [
|
|
48
48
|
units: [
|
49
49
|
{ name: 'textInput', rate: 0.25, strategy: 'fixed', unit: 'millionTokens' },
|
50
50
|
{ name: 'textOutput', rate: 2, strategy: 'fixed', unit: 'millionTokens' },
|
51
|
-
{ name: 'textInput_cacheRead', rate: 0.
|
51
|
+
{ name: 'textInput_cacheRead', rate: 0.025, strategy: 'fixed', unit: 'millionTokens' },
|
52
52
|
],
|
53
53
|
},
|
54
54
|
releasedAt: '2025-08-07',
|
55
55
|
settings: {
|
56
|
-
extendParams: ['
|
56
|
+
extendParams: ['gpt5ReasoningEffort', 'textVerbosity'],
|
57
57
|
searchImpl: 'params',
|
58
58
|
},
|
59
59
|
type: 'chat',
|
@@ -61,13 +61,13 @@ const aihubmixModels: AIChatModelCard[] = [
|
|
61
61
|
{
|
62
62
|
abilities: {
|
63
63
|
functionCall: true,
|
64
|
+
imageOutput: true,
|
64
65
|
reasoning: true,
|
65
66
|
vision: true,
|
66
67
|
},
|
67
68
|
contextWindowTokens: 400_000,
|
68
69
|
description: '最快、最经济高效的 GPT-5 版本。非常适合需要快速响应且成本敏感的应用场景。',
|
69
70
|
displayName: 'GPT-5 nano',
|
70
|
-
enabled: true,
|
71
71
|
id: 'gpt-5-nano',
|
72
72
|
maxOutput: 128_000,
|
73
73
|
pricing: {
|
@@ -78,10 +78,14 @@ const aihubmixModels: AIChatModelCard[] = [
|
|
78
78
|
],
|
79
79
|
},
|
80
80
|
releasedAt: '2025-08-07',
|
81
|
+
settings: {
|
82
|
+
extendParams: ['gpt5ReasoningEffort', 'textVerbosity'],
|
83
|
+
},
|
81
84
|
type: 'chat',
|
82
85
|
},
|
83
86
|
{
|
84
87
|
abilities: {
|
88
|
+
reasoning: true,
|
85
89
|
vision: true,
|
86
90
|
},
|
87
91
|
contextWindowTokens: 400_000,
|
@@ -95,7 +99,7 @@ const aihubmixModels: AIChatModelCard[] = [
|
|
95
99
|
units: [
|
96
100
|
{ name: 'textInput', rate: 1.25, strategy: 'fixed', unit: 'millionTokens' },
|
97
101
|
{ name: 'textOutput', rate: 10, strategy: 'fixed', unit: 'millionTokens' },
|
98
|
-
{ name: 'textInput_cacheRead', rate: 0.
|
102
|
+
{ name: 'textInput_cacheRead', rate: 0.125, strategy: 'fixed', unit: 'millionTokens' },
|
99
103
|
],
|
100
104
|
},
|
101
105
|
releasedAt: '2025-08-07',
|
@@ -112,7 +116,6 @@ const aihubmixModels: AIChatModelCard[] = [
|
|
112
116
|
description:
|
113
117
|
'o4-mini 是我们最新的小型 o 系列模型。 它专为快速有效的推理而优化,在编码和视觉任务中表现出极高的效率和性能。',
|
114
118
|
displayName: 'o4-mini',
|
115
|
-
enabled: true,
|
116
119
|
id: 'o4-mini',
|
117
120
|
maxOutput: 100_000,
|
118
121
|
pricing: {
|
@@ -193,7 +196,6 @@ const aihubmixModels: AIChatModelCard[] = [
|
|
193
196
|
description:
|
194
197
|
'o3 是一款全能强大的模型,在多个领域表现出色。它为数学、科学、编程和视觉推理任务树立了新标杆。它也擅长技术写作和指令遵循。用户可利用它分析文本、代码和图像,解决多步骤的复杂问题。',
|
195
198
|
displayName: 'o3',
|
196
|
-
enabled: true,
|
197
199
|
id: 'o3',
|
198
200
|
maxOutput: 100_000,
|
199
201
|
pricing: {
|
@@ -699,7 +701,6 @@ const aihubmixModels: AIChatModelCard[] = [
|
|
699
701
|
description:
|
700
702
|
'基于Qwen3的思考模式开源模型,相较上一版本(通义千问3-235B-A22B)逻辑能力、通用能力、知识增强及创作能力均有大幅提升,适用于高难度强推理场景。',
|
701
703
|
displayName: 'Qwen3 235B A22B Thinking 2507',
|
702
|
-
enabled: true,
|
703
704
|
id: 'qwen3-235b-a22b-thinking-2507',
|
704
705
|
maxOutput: 32_768,
|
705
706
|
organization: 'Qwen',
|
@@ -721,7 +722,6 @@ const aihubmixModels: AIChatModelCard[] = [
|
|
721
722
|
description:
|
722
723
|
'基于Qwen3的非思考模式开源模型,相较上一版本(通义千问3-235B-A22B)主观创作能力与模型安全性均有小幅度提升。',
|
723
724
|
displayName: 'Qwen3 235B A22B Instruct 2507',
|
724
|
-
enabled: true,
|
725
725
|
id: 'qwen3-235b-a22b-instruct-2507',
|
726
726
|
maxOutput: 32_768,
|
727
727
|
organization: 'Qwen',
|
@@ -744,7 +744,6 @@ const aihubmixModels: AIChatModelCard[] = [
|
|
744
744
|
description:
|
745
745
|
'基于Qwen3的思考模式开源模型,相较上一版本(通义千问3-30B-A3B)逻辑能力、通用能力、知识增强及创作能力均有大幅提升,适用于高难度强推理场景。',
|
746
746
|
displayName: 'Qwen3 30B A3B Thinking 2507',
|
747
|
-
enabled: true,
|
748
747
|
id: 'qwen3-30b-a3b-thinking-2507',
|
749
748
|
maxOutput: 32_768,
|
750
749
|
organization: 'Qwen',
|
@@ -766,7 +765,6 @@ const aihubmixModels: AIChatModelCard[] = [
|
|
766
765
|
description:
|
767
766
|
'相较上一版本(Qwen3-30B-A3B)中英文和多语言整体通用能力有大幅提升。主观开放类任务专项优化,显著更加符合用户偏好,能够提供更有帮助性的回复。',
|
768
767
|
displayName: 'Qwen3 30B A3B Instruct 2507',
|
769
|
-
enabled: true,
|
770
768
|
id: 'qwen3-30b-a3b-instruct-2507',
|
771
769
|
maxOutput: 32_768,
|
772
770
|
organization: 'Qwen',
|
@@ -42,7 +42,7 @@ export const openaiChatModels: AIChatModelCard[] = [
|
|
42
42
|
},
|
43
43
|
releasedAt: '2025-08-07',
|
44
44
|
settings: {
|
45
|
-
extendParams: ['
|
45
|
+
extendParams: ['gpt5ReasoningEffort', 'textVerbosity'],
|
46
46
|
searchImpl: 'params',
|
47
47
|
},
|
48
48
|
type: 'chat',
|
@@ -70,7 +70,7 @@ export const openaiChatModels: AIChatModelCard[] = [
|
|
70
70
|
},
|
71
71
|
releasedAt: '2025-08-07',
|
72
72
|
settings: {
|
73
|
-
extendParams: ['
|
73
|
+
extendParams: ['gpt5ReasoningEffort', 'textVerbosity'],
|
74
74
|
searchImpl: 'params',
|
75
75
|
},
|
76
76
|
type: 'chat',
|
@@ -78,6 +78,7 @@ export const openaiChatModels: AIChatModelCard[] = [
|
|
78
78
|
{
|
79
79
|
abilities: {
|
80
80
|
functionCall: true,
|
81
|
+
imageOutput: true,
|
81
82
|
reasoning: true,
|
82
83
|
vision: true,
|
83
84
|
},
|
@@ -94,10 +95,14 @@ export const openaiChatModels: AIChatModelCard[] = [
|
|
94
95
|
],
|
95
96
|
},
|
96
97
|
releasedAt: '2025-08-07',
|
98
|
+
settings: {
|
99
|
+
extendParams: ['gpt5ReasoningEffort', 'textVerbosity'],
|
100
|
+
},
|
97
101
|
type: 'chat',
|
98
102
|
},
|
99
103
|
{
|
100
104
|
abilities: {
|
105
|
+
reasoning: true,
|
101
106
|
vision: true,
|
102
107
|
},
|
103
108
|
contextWindowTokens: 400_000,
|
@@ -128,7 +133,6 @@ export const openaiChatModels: AIChatModelCard[] = [
|
|
128
133
|
description:
|
129
134
|
'o4-mini 是我们最新的小型 o 系列模型。 它专为快速有效的推理而优化,在编码和视觉任务中表现出极高的效率和性能。',
|
130
135
|
displayName: 'o4-mini',
|
131
|
-
enabled: true,
|
132
136
|
id: 'o4-mini',
|
133
137
|
maxOutput: 100_000,
|
134
138
|
pricing: {
|
@@ -209,7 +213,6 @@ export const openaiChatModels: AIChatModelCard[] = [
|
|
209
213
|
description:
|
210
214
|
'o3 是一款全能强大的模型,在多个领域表现出色。它为数学、科学、编程和视觉推理任务树立了新标杆。它也擅长技术写作和指令遵循。用户可利用它分析文本、代码和图像,解决多步骤的复杂问题。',
|
211
215
|
displayName: 'o3',
|
212
|
-
enabled: true,
|
213
216
|
id: 'o3',
|
214
217
|
maxOutput: 100_000,
|
215
218
|
pricing: {
|
@@ -11,8 +11,10 @@ import { agentChatConfigSelectors, agentSelectors } from '@/store/agent/selector
|
|
11
11
|
import { aiModelSelectors, useAiInfraStore } from '@/store/aiInfra';
|
12
12
|
|
13
13
|
import ContextCachingSwitch from './ContextCachingSwitch';
|
14
|
+
import GPT5ReasoningEffortSlider from './GPT5ReasoningEffortSlider';
|
14
15
|
import ReasoningEffortSlider from './ReasoningEffortSlider';
|
15
16
|
import ReasoningTokenSlider from './ReasoningTokenSlider';
|
17
|
+
import TextVerbositySlider from './TextVerbositySlider';
|
16
18
|
import ThinkingBudgetSlider from './ThinkingBudgetSlider';
|
17
19
|
import ThinkingSlider from './ThinkingSlider';
|
18
20
|
|
@@ -95,6 +97,28 @@ const ControlsForm = memo(() => {
|
|
95
97
|
paddingBottom: 0,
|
96
98
|
},
|
97
99
|
},
|
100
|
+
{
|
101
|
+
children: <GPT5ReasoningEffortSlider />,
|
102
|
+
desc: 'reasoning_effort',
|
103
|
+
label: t('extendParams.reasoningEffort.title'),
|
104
|
+
layout: 'horizontal',
|
105
|
+
minWidth: undefined,
|
106
|
+
name: 'gpt5ReasoningEffort',
|
107
|
+
style: {
|
108
|
+
paddingBottom: 0,
|
109
|
+
},
|
110
|
+
},
|
111
|
+
{
|
112
|
+
children: <TextVerbositySlider />,
|
113
|
+
desc: 'text_verbosity',
|
114
|
+
label: t('extendParams.textVerbosity.title'),
|
115
|
+
layout: 'horizontal',
|
116
|
+
minWidth: undefined,
|
117
|
+
name: 'textVerbosity',
|
118
|
+
style: {
|
119
|
+
paddingBottom: 0,
|
120
|
+
},
|
121
|
+
},
|
98
122
|
{
|
99
123
|
children: <ThinkingBudgetSlider />,
|
100
124
|
label: t('extendParams.reasoningBudgetToken.title'),
|
@@ -0,0 +1,58 @@
|
|
1
|
+
import { Slider } from 'antd';
|
2
|
+
import { memo, useCallback } from 'react';
|
3
|
+
import { Flexbox } from 'react-layout-kit';
|
4
|
+
|
5
|
+
import { useAgentStore } from '@/store/agent';
|
6
|
+
import { agentChatConfigSelectors } from '@/store/agent/selectors';
|
7
|
+
|
8
|
+
const GPT5ReasoningEffortSlider = memo(() => {
|
9
|
+
const [config, updateAgentChatConfig] = useAgentStore((s) => [
|
10
|
+
agentChatConfigSelectors.currentChatConfig(s),
|
11
|
+
s.updateAgentChatConfig,
|
12
|
+
]);
|
13
|
+
|
14
|
+
const gpt5ReasoningEffort = config.gpt5ReasoningEffort || 'medium'; // Default to 'medium' if not set
|
15
|
+
|
16
|
+
const marks = {
|
17
|
+
0: 'minimal',
|
18
|
+
1: 'low',
|
19
|
+
2: 'medium',
|
20
|
+
3: 'high',
|
21
|
+
};
|
22
|
+
|
23
|
+
const effortValues = ['minimal', 'low', 'medium', 'high'];
|
24
|
+
const indexValue = effortValues.indexOf(gpt5ReasoningEffort);
|
25
|
+
const currentValue = indexValue === -1 ? 2 : indexValue;
|
26
|
+
|
27
|
+
const updateGPT5ReasoningEffort = useCallback(
|
28
|
+
(value: number) => {
|
29
|
+
const effort = effortValues[value] as 'minimal' | 'low' | 'medium' | 'high';
|
30
|
+
updateAgentChatConfig({ gpt5ReasoningEffort: effort });
|
31
|
+
},
|
32
|
+
[updateAgentChatConfig],
|
33
|
+
);
|
34
|
+
|
35
|
+
return (
|
36
|
+
<Flexbox
|
37
|
+
align={'center'}
|
38
|
+
gap={12}
|
39
|
+
horizontal
|
40
|
+
paddingInline={'0 20px'}
|
41
|
+
style={{ minWidth: 200, width: '100%' }}
|
42
|
+
>
|
43
|
+
<Flexbox flex={1}>
|
44
|
+
<Slider
|
45
|
+
marks={marks}
|
46
|
+
max={3}
|
47
|
+
min={0}
|
48
|
+
onChange={updateGPT5ReasoningEffort}
|
49
|
+
step={1}
|
50
|
+
tooltip={{ open: false }}
|
51
|
+
value={currentValue}
|
52
|
+
/>
|
53
|
+
</Flexbox>
|
54
|
+
</Flexbox>
|
55
|
+
);
|
56
|
+
});
|
57
|
+
|
58
|
+
export default GPT5ReasoningEffortSlider;
|
@@ -0,0 +1,57 @@
|
|
1
|
+
import { Slider } from 'antd';
|
2
|
+
import { memo, useCallback } from 'react';
|
3
|
+
import { Flexbox } from 'react-layout-kit';
|
4
|
+
|
5
|
+
import { useAgentStore } from '@/store/agent';
|
6
|
+
import { agentChatConfigSelectors } from '@/store/agent/selectors';
|
7
|
+
|
8
|
+
const TextVerbositySlider = memo(() => {
|
9
|
+
const [config, updateAgentChatConfig] = useAgentStore((s) => [
|
10
|
+
agentChatConfigSelectors.currentChatConfig(s),
|
11
|
+
s.updateAgentChatConfig,
|
12
|
+
]);
|
13
|
+
|
14
|
+
const textVerbosity = config.textVerbosity || 'medium'; // Default to 'medium' if not set
|
15
|
+
|
16
|
+
const marks = {
|
17
|
+
0: 'low',
|
18
|
+
1: 'medium',
|
19
|
+
2: 'high',
|
20
|
+
};
|
21
|
+
|
22
|
+
const verbosityValues = ['low', 'medium', 'high'];
|
23
|
+
const indexValue = verbosityValues.indexOf(textVerbosity);
|
24
|
+
const currentValue = indexValue === -1 ? 1 : indexValue;
|
25
|
+
|
26
|
+
const updateTextVerbosity = useCallback(
|
27
|
+
(value: number) => {
|
28
|
+
const verbosity = verbosityValues[value] as 'low' | 'medium' | 'high';
|
29
|
+
updateAgentChatConfig({ textVerbosity: verbosity });
|
30
|
+
},
|
31
|
+
[updateAgentChatConfig],
|
32
|
+
);
|
33
|
+
|
34
|
+
return (
|
35
|
+
<Flexbox
|
36
|
+
align={'center'}
|
37
|
+
gap={12}
|
38
|
+
horizontal
|
39
|
+
paddingInline={'0 20px'}
|
40
|
+
style={{ minWidth: 200, width: '100%' }}
|
41
|
+
>
|
42
|
+
<Flexbox flex={1}>
|
43
|
+
<Slider
|
44
|
+
marks={marks}
|
45
|
+
max={2}
|
46
|
+
min={0}
|
47
|
+
onChange={updateTextVerbosity}
|
48
|
+
step={1}
|
49
|
+
tooltip={{ open: false }}
|
50
|
+
value={currentValue}
|
51
|
+
/>
|
52
|
+
</Flexbox>
|
53
|
+
</Flexbox>
|
54
|
+
);
|
55
|
+
});
|
56
|
+
|
57
|
+
export default TextVerbositySlider;
|
@@ -120,6 +120,18 @@ export default {
|
|
120
120
|
PermissionDenied: '很抱歉,你没有权限访问该服务,请检查你的密钥是否有访问权限',
|
121
121
|
InvalidProviderAPIKey: '{{provider}} API Key 不正确或为空,请检查 {{provider}} API Key 后重试',
|
122
122
|
ProviderBizError: '请求 {{provider}} 服务出错,请根据以下信息排查或重试',
|
123
|
+
|
124
|
+
GoogleAIBlockReason: {
|
125
|
+
BLOCKLIST: '您的内容包含被禁止的词汇。请检查并修改您的输入内容后重试。',
|
126
|
+
IMAGE_SAFETY: '生成的图像内容因安全原因被阻止。请尝试修改您的图像生成请求。',
|
127
|
+
LANGUAGE: '您使用的语言暂不被支持。请尝试使用英语或其他支持的语言重新提问。',
|
128
|
+
OTHER: '内容因未知原因被阻止。请尝试重新表述您的请求。',
|
129
|
+
PROHIBITED_CONTENT: '您的请求可能包含违禁内容。请调整您的请求,确保内容符合使用规范。',
|
130
|
+
RECITATION: '您的内容因可能涉及版权问题而被阻止。请尝试使用原创内容或重新表述您的请求。',
|
131
|
+
SAFETY: '您的内容因安全策略而被阻止。请尝试调整您的请求内容,避免包含可能的有害或不当内容。',
|
132
|
+
SPII: '您的内容可能包含敏感个人身份信息。为保护隐私,请移除相关敏感信息后重试。',
|
133
|
+
default: '内容被阻止:{{blockReason}}。请调整您的请求内容后重试。',
|
134
|
+
},
|
123
135
|
/**
|
124
136
|
* @deprecated
|
125
137
|
*/
|
package/src/services/chat.ts
CHANGED
@@ -280,6 +280,14 @@ class ChatService {
|
|
280
280
|
extendParams.reasoning_effort = chatConfig.reasoningEffort;
|
281
281
|
}
|
282
282
|
|
283
|
+
if (modelExtendParams!.includes('gpt5ReasoningEffort') && chatConfig.gpt5ReasoningEffort) {
|
284
|
+
extendParams.reasoning_effort = chatConfig.gpt5ReasoningEffort;
|
285
|
+
}
|
286
|
+
|
287
|
+
if (modelExtendParams!.includes('textVerbosity') && chatConfig.textVerbosity) {
|
288
|
+
extendParams.verbosity = chatConfig.textVerbosity;
|
289
|
+
}
|
290
|
+
|
283
291
|
if (modelExtendParams!.includes('thinking') && chatConfig.thinking) {
|
284
292
|
extendParams.thinking = { type: chatConfig.thinking };
|
285
293
|
}
|