Skip to content

Commit 36a6ff9

Browse files
committed
multi-language support
1 parent 3092a13 commit 36a6ff9

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

java-ai/src/main/java/oracleai/aiholo/AIHoloController.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,8 @@ public String play(@RequestParam("question") String question,
8282
@RequestParam("languagecode") String languagecode,
8383
@RequestParam("voicename") String voicename) throws Exception {
8484
System.out.println(
85-
"play question: " + question + " selectedMode: " + selectedMode + " languagecode:"+ languagecode);
85+
"play question: " + question + " selectedMode: " + selectedMode +
86+
" languagecode:"+ languagecode+ " voicename:"+ voicename);
8687
theValue = "question";
8788
String filePath = "C:/Users/opc/aiholo_output.txt";
8889
try (FileWriter writer = new FileWriter(filePath)) {

java-ai/src/main/resources/static/aiholo/AIHolo-Brazil.html

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -149,33 +149,26 @@ <h1>Oracle Database hologramas de IA interativos</h1>
149149
alert("⚠️ Nenhum texto capturado. Tente enviar novamente.");
150150
return;
151151
}
152-
153152
const selectedMode = document.querySelector('input[name="mode"]:checked').value;
154153
const modifiedText = `${transcriptionText} . responda em 20 palavras ou menos`;
155-
156-
"responda em 20 palavras ou menos"
157154
const apiUrl = `http://141.148.204.74:8444/aiholo/play?question=${encodeURIComponent(modifiedText)}&selectedMode=${encodeURIComponent(selectedMode)}&languagecode=${encodeURIComponent("pt-BR")}&voicename=${encodeURIComponent("pt-BR-Wavenet-B")}`;
158-
159155
try {
160156
const response = await fetch(apiUrl, {
161157
method: "GET",
162158
headers: {
163159
"Content-Type": "application/json"
164160
}
165161
});
166-
167162
if (!response.ok) {
168163
throw new Error("❌ Failed to get response from server.");
169164
}
170-
171165
const result = await response.text();
172166
document.getElementById("responseMessage").innerText = `✅ Response: ${result}`;
173167
} catch (error) {
174168
document.getElementById("responseMessage").innerText = "❌ Error retrieving response.";
175169
}
176170
});
177171

178-
// Clear transcription
179172
document.getElementById("clearBtn").addEventListener("click", () => {
180173
transcriptBuffer = "";
181174
document.getElementById("transcription").innerText = "";

0 commit comments

Comments
 (0)