From 60e98f98896a6f62c48dd3e92567e4da722b67da Mon Sep 17 00:00:00 2001 From: Dobromir Popov Date: Sat, 6 Jul 2024 15:56:49 +0300 Subject: [PATCH] misc old changes --- docker-compose.yml | 44 +++++++++++++++++--------------------------- web/chat-client.html | 2 +- web/chat-server.js | 1 + web/client.html | 2 +- 4 files changed, 20 insertions(+), 29 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 43d10ab..009026c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,32 +1,22 @@ -version: '3.4' - services: - kevinai: - image: kevinai - container_name: kevinai-dev - build: - context: . - dockerfile: ./Dockerfile - environment: - NODE_ENV: production - # TTS_BACKEND_URL: http://192.168.0.10:9009/asr - WS_URL: ws://192.168.0.10:28081 - SERVER_PORT_WS: 8081 - SERVER_PORT_HTTP: 8080 - ports: - - 28081:8081 - - 28080:8080 - mlchat: - image: kevinai - container_name: kevinai-chat - build: - context: . - dockerfile: ./Dockerfile + chat-server: + image: node:20-alpine + container_name: ml-voice-chat-server + working_dir: /usr/src/app + volumes: + - /mnt/apps/DEV/REPOS/git.d-popov.com/ai-kevin:/usr/src/app + command: > + sh -c "npm install && node web/chat-server.js" environment: NODE_ENV: demo - # TTS_BACKEND_URL: http://192.168.0.10:9009/asr - WS_URL: wss://tts.d-popov.com - SERVER_PORT_WS: 8080 + #TTS_BACKEND_URL: https://api.tts.d-popov.com/asr + TTS_API_URL: http://192.168.0.11:9009/asr + WS_URL: wss://ws.tts.d-popov.com SERVER_PORT_HTTP: 8080 + SERVER_PORT_WS: 8082 ports: - - 28080:8080 \ No newline at end of file + - 28080:8080 + - 28081:8082 + dns: + - 8.8.8.8 + - 8.8.4.4 \ No newline at end of file diff --git a/web/chat-client.html b/web/chat-client.html index d51d6a4..d629a00 100644 --- a/web/chat-client.html +++ b/web/chat-client.html @@ -290,7 +290,7 @@ showClearSessionOption(); connect().then(() => { - // audio.initializeVolumeChecker(); + initializeVolumeChecker(); }); }; diff --git a/web/chat-server.js b/web/chat-server.js index 6585318..b50c3d7 100644 --- a/web/chat-server.js +++ b/web/chat-server.js @@ -13,6 +13,7 @@ const Groq = require('groq-sdk'); // Load environment variables dotenv.config({ path: `.env${process.env.NODE_ENV === 'development' ? '.development' :'.'+ process.env.NODE_ENV }` }); +console.log(`loaded env file: ${process.env.NODE_ENV}`) // Initialize services const openai = new OpenAI({ apiKey: process.env.OPENAI_API_KEY }); diff --git a/web/client.html b/web/client.html index 10eb79c..1ce243c 100644 --- a/web/client.html +++ b/web/client.html @@ -173,7 +173,7 @@ // count speaking and silence if (averageVolume > threshold) { if (autosend.checked && speakingCount == 0 && audioRecorder) { - console.log("startint new recording"); + console.log("starting new recording"); soundDetected = false; audioRecorder.stop(); audioRecorder.start();