@@ -39,8 +39,8 @@ public class AIHoloController {
39
39
private static final ScheduledExecutorService scheduler = Executors .newScheduledThreadPool (1 );
40
40
private static final String API_URL = "http://129.x.x.x/v1/chat/completions?client=server" ;
41
41
private static final String AUTH_TOKEN = "Bearer asdf" ;
42
- private static final String DEFAULT_LANGUAGE_CODE = "Bearer asdf " ;
43
- private static final String DEFAULT_VOICE_NAME = "Bearer asdf " ;
42
+ private static final String DEFAULT_LANGUAGE_CODE = "pt-BR " ;
43
+ private static final String DEFAULT_VOICE_NAME = "pt-BR-Wavenet-D " ;
44
44
45
45
@ Autowired
46
46
private DataSource dataSource ;
@@ -67,37 +67,10 @@ private void startInactivityMonitor() {
67
67
}
68
68
69
69
70
- @ GetMapping ("/set" )
71
- public String setValue (@ RequestParam ("value" ) String value ) {
72
- theValue = value ;
73
- System .out .println ("EchoController set: " + theValue );
74
- String filePath = "C:/Users/opc/aiholo_output.txt" ;
75
- try (FileWriter writer = new FileWriter (filePath )) {
76
- JSONObject json = new JSONObject ();
77
- json .put ("data" , value ); // Store the response inside JSON
78
- writer .write (json .toString ());
79
- writer .flush ();
80
- } catch (IOException e ) {
81
- return "Error writing to file: " + e .getMessage ();
82
- }
83
-
84
- if (value .equals ("mirrorme" ) || value .equals ("question" ))
85
- return "「ミラーミー」モードが正常に有効化されました" ;
86
- else
87
- return "set successfully: " + theValue ;
88
-
89
- }
90
-
91
- @ GetMapping ("/get" )
92
- public String getValue () {
93
- System .out .println ("EchoController get: " + theValue );
94
- return theValue ;
95
- }
96
-
97
70
static String sql = """
98
71
SELECT DBMS_CLOUD_AI.GENERATE(
99
72
prompt => ?,
100
- profile_name => 'VIDEO_GAMES ',
73
+ profile_name => 'VIDEOGAMES_PROFILE ',
101
74
action => ?
102
75
) FROM dual
103
76
""" ;
@@ -210,9 +183,6 @@ public String executeSandbox(String cummulativeResult) {
210
183
return " I'm sorry, I couldn't find an answer" ;
211
184
}
212
185
}
213
- // `https://141.148.204.74:8444/aiholo/tts?textToConvert=${encodeURIComponent(textToConvert)}&languageCode=${encodeURIComponent(languageCode)}&ssmlGender=${encodeURIComponent(ssmlGender)}&voiceName=${encodeURIComponent(voiceName)}`;
214
-
215
-
216
186
217
187
// `https://host:port/aiholo/tts?textToConvert=${encodeURIComponent(textToConvert)}&languageCode=${encodeURIComponent(languageCode)}&ssmlGender=${encodeURIComponent(ssmlGender)}&voiceName=${encodeURIComponent(voiceName)}`;
218
188
@ GetMapping ("/tts" )
@@ -266,5 +236,34 @@ public static String getFirst10Chars(String textToConvert) {
266
236
return "" ;
267
237
}
268
238
return textToConvert .length () > 10 ? textToConvert .substring (0 , 10 ) : textToConvert ;
269
- }
239
+ }
240
+
241
+
242
+ @ GetMapping ("/set" )
243
+ public String setValue (@ RequestParam ("value" ) String value ) {
244
+ theValue = value ;
245
+ System .out .println ("EchoController set: " + theValue );
246
+ String filePath = "C:/Users/opc/aiholo_output.txt" ;
247
+ try (FileWriter writer = new FileWriter (filePath )) {
248
+ JSONObject json = new JSONObject ();
249
+ json .put ("data" , value ); // Store the response inside JSON
250
+ writer .write (json .toString ());
251
+ writer .flush ();
252
+ } catch (IOException e ) {
253
+ return "Error writing to file: " + e .getMessage ();
254
+ }
255
+
256
+ if (value .equals ("mirrorme" ) || value .equals ("question" ))
257
+ return "「ミラーミー」モードが正常に有効化されました" ;
258
+ else
259
+ return "set successfully: " + theValue ;
260
+
261
+ }
262
+
263
+ @ GetMapping ("/get" )
264
+ public String getValue () {
265
+ System .out .println ("EchoController get: " + theValue );
266
+ return theValue ;
267
+ }
268
+
270
269
}
0 commit comments