diff --git a/agent-mobile/artimobile/VoiceHandler.js b/agent-mobile/artimobile/VoiceHandler.js index d70522a..82fe92d 100644 --- a/agent-mobile/artimobile/VoiceHandler.js +++ b/agent-mobile/artimobile/VoiceHandler.js @@ -8,10 +8,10 @@ import Voice from '@react-native-voice/voice'; // process.env.TTS_BACKEND_URL = "http://192.168.0.10:9008/asr" process.env.TTS_BACKEND_URL = "https://tts.d-popov.com/asr" -const LLM_ENDPOINT = "https://ws.ai.d-popov.com/api/chat"; +process.env.LLM_ENDPOINT = "https://ws.ai.d-popov.com/api/chat"; // const LLM_ENDPOINT = "http://192.168.0.11:11434/api/chat"; -const LOG_ENDPOINT = "ws://192.168.0.11:3005/log"; +process.env.LOG_ENDPOINT = "http://192.168.0.11:3005/log"; class VoiceHandler extends Component { constructor(props) { @@ -62,14 +62,13 @@ class VoiceHandler extends Component { async logRemote(message){ try{ - fetch(LOG_ENDPOINT, { + fetch(process.env.LOG_ENDPOINT, { method: 'POST', headers: { 'Content-Type': 'application/json', }, body: JSON.stringify({"message":message}), }); - } catch(e){ console.log("error logging:" + e); @@ -124,8 +123,8 @@ class VoiceHandler extends Component { }) try { - this.logRemote('sending text to LLM at ', LLM_ENDPOINT, ": '", transcribedText, "'"); - const response = await fetch(LLM_ENDPOINT, { + this.logRemote('sending text to LLM at ' + process.env.LLM_ENDPOINT + ": '" + transcribedText + "'"); + const response = await fetch(process.env.LLM_ENDPOINT, { method: 'POST', headers: { 'Content-Type': 'application/json',