File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
scratch-vm/src/extensions/scratch3_chatgpt2scratch Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -50,6 +50,8 @@ const I18n = {
5050 'Set timeout [NUMBER]' ,
5151 setApiKeyBlockDefaultValue :
5252 'API key' ,
53+ setApiKeyFuncAzurePromptText :
54+ 'No API key required' ,
5355 setApiKeyFuncPromptText :
5456 'Enter the API key.' ,
5557 setSystemPromptBlockText :
@@ -76,6 +78,8 @@ const I18n = {
7678 'APIキーをセット' ,
7779 setApiKeyBlockDefaultValue :
7880 'API キー' ,
81+ setApiKeyFuncAzurePromptText :
82+ 'APIキーは不要です' ,
7983 setApiKeyFuncPromptText :
8084 'APIキーを入力してください' ,
8185 setSystemPromptBlockText :
@@ -103,6 +107,8 @@ const I18n = {
103107 'エーピーアイキーをセット' ,
104108 setApiKeyBlockDefaultValue :
105109 'エーピーアイキー' ,
110+ setApiKeyFuncAzurePromptText :
111+ 'APIキーはふようです' ,
106112 setApiKeyFuncPromptText :
107113 'エーピーアイキーをにゅうりょくしてください' ,
108114 setSystemPromptBlockText :
@@ -303,8 +309,12 @@ class Scratch3ChatGPTBlocks {
303309 }
304310
305311 setApiKey ( ) {
306- this . apiKey = window . prompt ( this . i18n . setApiKeyFuncPromptText ) ;
307- window . sessionStorage . setItem ( this . SESSION_STORAGE_KEY_CHATGPT_API_KEY , this . apiKey ) ;
312+ if ( comesFromCoderDojoJapan ) {
313+ alert ( this . i18n . setApiKeyFuncAzurePromptText ) ;
314+ } else {
315+ this . apiKey = window . prompt ( this . i18n . setApiKeyFuncPromptText ) ;
316+ window . sessionStorage . setItem ( this . SESSION_STORAGE_KEY_CHATGPT_API_KEY , this . apiKey ) ;
317+ }
308318 }
309319
310320 hasApiKey ( ) {
You can’t perform that action at this time.
0 commit comments