diff --git a/config/default.yaml b/config/default.yaml index b37a7e3..30c36ed 100644 --- a/config/default.yaml +++ b/config/default.yaml @@ -7,8 +7,7 @@ telegram: bot_token: ${FLYNN_TELEGRAM_TOKEN} - allowed_chat_ids: [-1003673132186] - require_mention: false + allowed_chat_ids: [] # Add your Telegram chat ID server: tailscale_only: true @@ -168,9 +167,10 @@ hooks: # --host 0.0.0.0 --port 8080 --convert --language en \ # --inference-path /v1/audio/transcriptions # -audio: - enabled: true - provider: - type: custom - endpoint: "http://whisper-server:8080/v1/audio/transcriptions" - model: "whisper-1" +# audio: +# enabled: true +# provider: +# type: custom # openai, groq, ollama, llamacpp, custom +# endpoint: "http://localhost:18801/v1/audio/transcriptions" +# api_key: "${WHISPER_API_KEY}" # Optional Bearer token +# model: "whisper-1" # Model name (default: whisper-1) diff --git a/docker-compose.yml b/docker-compose.yml index 019152f..bafd2bd 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,5 +1,3 @@ -version: '3.9' - services: flynn: build: . @@ -31,39 +29,28 @@ services: timeout: 5s start_period: 15s retries: 3 - depends_on: - whisper-server: - condition: service_healthy - networks: - - flynn-net # Optional: Whisper server for audio transcription - whisper-server: - image: ghcr.io/ggml-org/whisper.cpp:main - container_name: whisper-server - restart: unless-stopped - ports: - - "18801:8080" - command: > - whisper-server - --model /app/models/ggml-base.en.bin - --host 0.0.0.0 - --port 8080 - --convert - --language en - --inference-path /v1/audio/transcriptions - volumes: - - ./whisper-models:/app/models:ro - healthcheck: - test: ["CMD-SHELL", "curl", "-f", "http://localhost:8080/"] - interval: 30s - timeout: 5s - start_period: 15s - retries: 3 - networks: - - flynn-net + # Uncomment and adjust as needed for voice message support + # whisper-server: + # image: ghcr.io/ggml-org/whisper.cpp:main + # container_name: whisper-server + # restart: unless-stopped + # ports: + # - "18801:8080" + # command: whisper-server + # --model /app/models/ggml-base.en.bin + # --host 0.0.0.0 + # --port 8080 + # --convert + # --language en + # --inference-path /v1/audio/transcriptions + # healthcheck: + # test: ["CMD-SHELL", "curl", "-f", "http://localhost:8080/"] + # interval: 30s + # timeout: 5s + # start_period: 15s + # retries: 3 volumes: flynn-data: -networks: - flynn-net: diff --git a/src/session/store.ts b/src/session/store.ts index 55f2b2d..05fa65f 100644 --- a/src/session/store.ts +++ b/src/session/store.ts @@ -56,10 +56,7 @@ export class SessionStore { const stmt = this.db.prepare( 'INSERT INTO messages (session_id, role, content, metadata) VALUES (?, ?, ?, ?)', ); - const contentString = typeof message.content === 'string' - ? message.content - : JSON.stringify(message.content); - stmt.run(sessionId, message.role, contentString, metadata ? JSON.stringify(metadata) : null); + stmt.run(sessionId, message.role, message.content, metadata ? JSON.stringify(metadata) : null); } getMessages(sessionId: string): Message[] { @@ -87,10 +84,7 @@ export class SessionStore { 'INSERT INTO messages (session_id, role, content, metadata) VALUES (?, ?, ?, ?)', ); for (const msg of messages) { - const contentString = typeof msg.content === 'string' - ? msg.content - : JSON.stringify(msg.content); - insert.run(sessionId, msg.role, contentString, null); + insert.run(sessionId, msg.role, msg.content, null); } }); transaction();