Skip to content

Commit ebda961

Browse files
author
zhuxinliang
committed
feat: support var in suggested questions
1 parent 24b1a62 commit ebda961

File tree

20 files changed

+414
-397
lines changed

20 files changed

+414
-397
lines changed

web/app/components/base/chat/chat/hooks.ts

+2-3
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,11 @@ export const useChat = (
8282
const ret = [...threadMessages]
8383
if (config?.opening_statement) {
8484
const index = threadMessages.findIndex(item => item.isOpeningStatement)
85-
8685
if (index > -1) {
8786
ret[index] = {
8887
...ret[index],
8988
content: getIntroduction(config.opening_statement),
90-
suggestedQuestions: config.suggested_questions,
89+
suggestedQuestions: config.suggested_questions?.map(item => getIntroduction(item)),
9190
}
9291
}
9392
else {
@@ -96,7 +95,7 @@ export const useChat = (
9695
content: getIntroduction(config.opening_statement),
9796
isAnswer: true,
9897
isOpeningStatement: true,
99-
suggestedQuestions: config.suggested_questions,
98+
suggestedQuestions: config.suggested_questions?.map(item => getIntroduction(item)),
10099
})
101100
}
102101
}

web/app/components/base/features/new-feature-panel/conversation-opener/modal.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ const OpeningSettingModal = ({
129129
<input
130130
type="input"
131131
value={question || ''}
132+
placeholder={t('appDebug.openingStatement.openingQuestionPlaceholder') as string}
132133
onChange={(e) => {
133134
const value = e.target.value
134135
setTempSuggestedQuestions(tempSuggestedQuestions.map((item, i) => {

web/app/components/workflow/panel/debug-and-preview/hooks.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ export const useChat = (
8484
ret[index] = {
8585
...ret[index],
8686
content: getIntroduction(config.opening_statement),
87-
suggestedQuestions: config.suggested_questions,
87+
suggestedQuestions: config.suggested_questions?.map((item: string) => getIntroduction(item)),
8888
}
8989
}
9090
else {
@@ -93,7 +93,7 @@ export const useChat = (
9393
content: getIntroduction(config.opening_statement),
9494
isAnswer: true,
9595
isOpeningStatement: true,
96-
suggestedQuestions: config.suggested_questions,
96+
suggestedQuestions: config.suggested_questions?.map((item: string) => getIntroduction(item)),
9797
})
9898
}
9999
}

web/i18n/de-DE/app-debug.ts

+393-392
Large diffs are not rendered by default.

web/i18n/en-US/app-debug.ts

+1
Original file line numberDiff line numberDiff line change
@@ -441,6 +441,7 @@ const translation = {
441441
writeOpener: 'Edit opener',
442442
placeholder: 'Write your opener message here, you can use variables, try type {{variable}}.',
443443
openingQuestion: 'Opening Questions',
444+
openingQuestionPlaceholder: 'You can use variables, try typing {{variable}}.',
444445
noDataPlaceHolder:
445446
'Starting the conversation with the user can help AI establish a closer connection with them in conversational applications.',
446447
varTip: 'You can use variables, try type {{variable}}',

web/i18n/es-ES/app-debug.ts

+1
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,7 @@ const translation = {
328328
writeOpener: 'Escribir apertura',
329329
placeholder: 'Escribe tu mensaje de apertura aquí, puedes usar variables, intenta escribir {{variable}}.',
330330
openingQuestion: 'Preguntas de Apertura',
331+
openingQuestionPlaceholder: 'Puede usar variables, intente escribir {{variable}}.',
331332
noDataPlaceHolder: 'Iniciar la conversación con el usuario puede ayudar a la IA a establecer una conexión más cercana con ellos en aplicaciones de conversación.',
332333
varTip: 'Puedes usar variables, intenta escribir {{variable}}',
333334
tooShort: 'Se requieren al menos 20 palabras en la indicación inicial para generar una apertura de conversación.',

web/i18n/fa-IR/app-debug.ts

+1
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,7 @@ const translation = {
363363
writeOpener: 'نوشتن آغازگر',
364364
placeholder: 'پیام آغازگر خود را اینجا بنویسید، می‌توانید از متغیرها استفاده کنید، سعی کنید {{variable}} را تایپ کنید.',
365365
openingQuestion: 'سوالات آغازین',
366+
openingQuestionPlaceholder: 'می‌توانید از متغیرها استفاده کنید، سعی کنید {{variable}} را تایپ کنید.',
366367
noDataPlaceHolder: 'شروع مکالمه با کاربر می‌تواند به AI کمک کند تا ارتباط نزدیک‌تری با آنها برقرار کند.',
367368
varTip: 'می‌توانید از متغیرها استفاده کنید، سعی کنید {{variable}} را تایپ کنید',
368369
tooShort: 'حداقل 20 کلمه از پرسش اولیه برای تولید نظرات آغازین مکالمه مورد نیاز است.',

web/i18n/fr-FR/app-debug.ts

+1
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,7 @@ const translation = {
316316
writeOpener: 'Écrire l\'introduction',
317317
placeholder: 'Rédigez votre message d\'ouverture ici, vous pouvez utiliser des variables, essayez de taper {{variable}}.',
318318
openingQuestion: 'Questions d\'ouverture',
319+
openingQuestionPlaceholder: 'Vous pouvez utiliser des variables, essayez de taper {{variable}}.',
319320
noDataPlaceHolder:
320321
'Commencer la conversation avec l\'utilisateur peut aider l\'IA à établir une connexion plus proche avec eux dans les applications conversationnelles.',
321322
varTip: 'Vous pouvez utiliser des variables, essayez de taper {{variable}}',

web/i18n/hi-IN/app-debug.ts

+1
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,7 @@ const translation = {
361361
placeholder:
362362
'यहां अपना प्रारंभक संदेश लिखें, आप वेरिएबल्स का उपयोग कर सकते हैं, {{variable}} टाइप करने का प्रयास करें।',
363363
openingQuestion: 'प्रारंभिक प्रश्न',
364+
openingQuestionPlaceholder: 'आप वेरिएबल्स का उपयोग कर सकते हैं, {{variable}} टाइप करके देखें।',
364365
noDataPlaceHolder:
365366
'उपयोगकर्ता के साथ संवाद प्रारंभ करने से एआई को संवादात्मक अनुप्रयोगों में उनके साथ निकट संबंध स्थापित करने में मदद मिल सकती है।',
366367
varTip:

web/i18n/it-IT/app-debug.ts

+1
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,7 @@ const translation = {
364364
placeholder:
365365
'Scrivi qui il tuo messaggio introduttivo, puoi usare variabili, prova a scrivere {{variable}}.',
366366
openingQuestion: 'Domande iniziali',
367+
openingQuestionPlaceholder: 'Puoi usare variabili, prova a digitare {{variable}}.',
367368
noDataPlaceHolder:
368369
'Iniziare la conversazione con l\'utente può aiutare l\'IA a stabilire un legame più stretto con loro nelle applicazioni conversazionali.',
369370
varTip: 'Puoi usare variabili, prova a scrivere {{variable}}',

web/i18n/ja-JP/app-debug.ts

+1
Original file line numberDiff line numberDiff line change
@@ -432,6 +432,7 @@ const translation = {
432432
writeOpener: 'オープナーを書く',
433433
placeholder: 'ここにオープナーメッセージを書いてください。変数を使用できます。{{variable}} を入力してみてください。',
434434
openingQuestion: '開始質問',
435+
openingQuestionPlaceholder: '変数を使用できます。{{variable}} と入力してみてください。',
435436
noDataPlaceHolder:
436437
'ユーザーとの会話を開始すると、会話アプリケーションで彼らとのより密接な関係を築くのに役立ちます。',
437438
varTip: '変数を使用できます。{{variable}} を入力してみてください',

web/i18n/ko-KR/app-debug.ts

+1
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,7 @@ const translation = {
327327
writeOpener: '오프너 작성',
328328
placeholder: '여기에 오프너 메시지를 작성하세요. 변수를 사용할 수 있습니다. {{variable}}를 입력해보세요.',
329329
openingQuestion: '시작 질문',
330+
openingQuestionPlaceholder: '변수를 사용할 수 있습니다. {{variable}}을(를) 입력해 보세요.',
330331
noDataPlaceHolder: '사용자와의 대화를 시작하면 대화 애플리케이션에서 그들과 더 밀접한 관계를 구축하는 데 도움이 됩니다.',
331332
varTip: '변수를 사용할 수 있습니다. {{variable}}를 입력해보세요.',
332333
tooShort: '대화 시작에는 최소 20 단어의 초기 프롬프트가 필요합니다.',

web/i18n/pl-PL/app-debug.ts

+1
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,7 @@ const translation = {
359359
placeholder:
360360
'Tutaj napisz swoją wiadomość wprowadzającą, możesz użyć zmiennych, spróbuj wpisać {{variable}}.',
361361
openingQuestion: 'Pytania otwierające',
362+
openingQuestionPlaceholder: 'Możesz używać zmiennych, spróbuj wpisać {{variable}}.',
362363
noDataPlaceHolder:
363364
'Rozpoczynanie rozmowy z użytkownikiem może pomóc AI nawiązać bliższe połączenie z nim w aplikacjach konwersacyjnych.',
364365
varTip: 'Możesz używać zmiennych, spróbuj wpisać {{variable}}',

web/i18n/pt-BR/app-debug.ts

+1
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,7 @@ const translation = {
333333
writeOpener: 'Escrever abertura',
334334
placeholder: 'Escreva sua mensagem de abertura aqui, você pode usar variáveis, tente digitar {{variável}}.',
335335
openingQuestion: 'Perguntas de Abertura',
336+
openingQuestionPlaceholder: 'Você pode usar variáveis, tente digitar {{variable}}.',
336337
noDataPlaceHolder:
337338
'Iniciar a conversa com o usuário pode ajudar a IA a estabelecer uma conexão mais próxima com eles em aplicativos de conversação.',
338339
varTip: 'Você pode usar variáveis, tente digitar {{variável}}',

web/i18n/ru-RU/app-debug.ts

+1
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,7 @@ const translation = {
369369
writeOpener: 'Написать начальное сообщение',
370370
placeholder: 'Напишите здесь свое начальное сообщение, вы можете использовать переменные, попробуйте ввести {{variable}}.',
371371
openingQuestion: 'Начальные вопросы',
372+
openingQuestionPlaceholder: 'Вы можете использовать переменные, попробуйте ввести {{variable}}.',
372373
noDataPlaceHolder:
373374
'Начало разговора с пользователем может помочь ИИ установить более тесную связь с ним в диалоговых приложениях.',
374375
varTip: 'Вы можете использовать переменные, попробуйте ввести {{variable}}',

web/i18n/tr-TR/app-debug.ts

+1
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,7 @@ const translation = {
368368
writeOpener: 'Başlangıç mesajı yaz',
369369
placeholder: 'Başlangıç mesajınızı buraya yazın, değişkenler kullanabilirsiniz, örneğin {{variable}} yazmayı deneyin.',
370370
openingQuestion: 'Açılış Soruları',
371+
openingQuestionPlaceholder: 'Değişkenler kullanabilirsiniz, {{variable}} yazmayı deneyin.',
371372
noDataPlaceHolder:
372373
'Kullanıcı ile konuşmayı başlatmak, AI\'ın konuşma uygulamalarında onlarla daha yakın bir bağlantı kurmasına yardımcı olabilir.',
373374
varTip: 'Değişkenler kullanabilirsiniz, örneğin {{variable}} yazmayı deneyin',

web/i18n/uk-UA/app-debug.ts

+1
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,7 @@ const translation = {
327327
writeOpener: 'Напишіть вступне повідомлення', // Write opener
328328
placeholder: 'Напишіть тут своє вступне повідомлення, ви можете використовувати змінні, спробуйте ввести {{variable}}.', // Write your opener message here...
329329
openingQuestion: 'Відкриваючі питання', // Opening Questions
330+
openingQuestionPlaceholder: 'Ви можете використовувати змінні, спробуйте ввести {{variable}}.',
330331
noDataPlaceHolder: 'Початок розмови з користувачем може допомогти ШІ встановити більш тісний зв’язок з ним у розмовних застосунках.', // ... conversational applications.
331332
varTip: 'Ви можете використовувати змінні, спробуйте ввести {{variable}}', // You can use variables, try type {{variable}}
332333
tooShort: 'Для створення вступних зауважень для розмови потрібно принаймні 20 слів вступного запиту.', // ... are required to generate an opening remarks for the conversation.

web/i18n/vi-VN/app-debug.ts

+1
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,7 @@ const translation = {
327327
writeOpener: 'Viết câu mở đầu',
328328
placeholder: 'Viết thông điệp mở đầu của bạn ở đây, bạn có thể sử dụng biến, hãy thử nhập {{biến}}.',
329329
openingQuestion: 'Câu hỏi mở đầu',
330+
openingQuestionPlaceholder: 'Bạn có thể sử dụng biến, hãy thử nhập {{variable}}.',
330331
noDataPlaceHolder: 'Bắt đầu cuộc trò chuyện với người dùng có thể giúp AI thiết lập mối quan hệ gần gũi hơn với họ trong các ứng dụng trò chuyện.',
331332
varTip: 'Bạn có thể sử dụng biến, hãy thử nhập {{biến}}',
332333
tooShort: 'Cần ít nhất 20 từ trong lời nhắc ban đầu để tạo ra các câu mở đầu cho cuộc trò chuyện.',

web/i18n/zh-Hans/app-debug.ts

+1
Original file line numberDiff line numberDiff line change
@@ -435,6 +435,7 @@ const translation = {
435435
writeOpener: '编写开场白',
436436
placeholder: '在这里写下你的开场白,你可以使用变量,尝试输入 {{variable}}。',
437437
openingQuestion: '开场问题',
438+
openingQuestionPlaceholder: '可以使用变量,尝试输入 {{variable}}。',
438439
noDataPlaceHolder:
439440
'在对话型应用中,让 AI 主动说第一段话可以拉近与用户间的距离。',
440441
varTip: '你可以使用变量, 试试输入 {{variable}}',

web/i18n/zh-Hant/app-debug.ts

+1
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,7 @@ const translation = {
312312
writeOpener: '編寫開場白',
313313
placeholder: '在這裡寫下你的開場白,你可以使用變數,嘗試輸入 {{variable}}。',
314314
openingQuestion: '開場問題',
315+
openingQuestionPlaceholder: '可以使用變量,嘗試輸入 {{variable}}。',
315316
noDataPlaceHolder:
316317
'在對話型應用中,讓 AI 主動說第一段話可以拉近與使用者間的距離。',
317318
varTip: '你可以使用變數, 試試輸入 {{variable}}',

0 commit comments

Comments
 (0)