Skip to content

Commit

Permalink
undo changes
Browse files Browse the repository at this point in the history
  • Loading branch information
lluisd committed Oct 16, 2024
1 parent 9b3bf24 commit db8e8bb
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 18 deletions.
1 change: 0 additions & 1 deletion .github/workflows/main_twitch-bn-bot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ jobs:
envkey_AZURE_OPENAI_ENDPOINT_BASE: ${{ secrets.AZURE_OPENAI_ENDPOINT_BASE }}
envkey_AZURE_OPENAI_API_VERSION: ${{ secrets.AZURE_OPENAI_API_VERSION }}
envkey_AZURE_OPENAI_VECTOR_STORE_ID: ${{ secrets.AZURE_OPENAI_VECTOR_STORE_ID }}
envkey_OPENAI_LOGGING_ENABLED: false
- name: Set up Node.js version
uses: actions/setup-node@v4
with:
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/main_twitch-mz-bot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ jobs:
envkey_OPENAI_MONGODB_URI: ${{ secrets.OPENAI_MONGODB_URI }}
envkey_TWITCH_EVENTSUB_SECRET: ${{ secrets.TWITCH_EVENTSUB_SECRET }}
envkey_TWITCH_HOSTNAME: ${{ secrets.TWITCH_HOSTNAME }}
envkey_OPENAI_LOGGING_ENABLED: true
- name: Set up Node.js version
uses: actions/setup-node@v4
with:
Expand Down
1 change: 0 additions & 1 deletion config/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ module.exports = {
key: process.env.AZURE_OPENAI_KEY,
apiVersion: process.env.AZURE_OPENAI_API_VERSION,
database: process.env.OPENAI_MONGODB_URI,
logging: process.env.OPENAI_LOGGING_ENABLED,
vectorStoreId: process.env.AZURE_OPENAI_VECTOR_STORE_ID
}
}
12 changes: 4 additions & 8 deletions helpers/dbmanager.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,8 @@ const Channel = require('../models/channel')
const Birthday = require('../models/birthday')
const Screenshot = require('../models/screenshot')
const tempsDeFlors = require('../models/tempsDeFlors')
const config = require('../config')
let ChatLog, TitleLog
if (config.openAI.logging) {
ChatLog = require('../models/chatLog')
TitleLog = require('../models/titleLog')
}
const ChatLog = require('../models/chatLog')
const TitleLog = require('../models/titleLog')


function getToken (userId) {
Expand Down Expand Up @@ -85,11 +81,11 @@ async function getTFSpots(roomId){
}

async function addChatLogLine (roomId, nick, text, date) {
return ChatLog && ChatLog.insertMany({roomId: roomId, nick: nick, text: text, date: date})
return ChatLog.insertMany({roomId: roomId, nick: nick, text: text, date: date})
}

async function addTitleLogLine (roomId, title, date) {
return TitleLog && TitleLog.insertMany({roomId: roomId, title: title, date: date})
return TitleLog.insertMany({roomId: roomId, title: title, date: date})
}


Expand Down
9 changes: 2 additions & 7 deletions services/logger.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,15 @@
const dbManager = require('../helpers/dbmanager')
const moment = require('moment')
const config = require('../config')

async function logChatMessage(roomId, username, text) {
let result = null
if (config.openAI.logging) {
result = await dbManager.addChatLogLine(roomId, username, text, moment())
}
result = await dbManager.addChatLogLine(roomId, username, text, moment())
return result
}

async function logStreamTitle(roomId, title) {
let result = null
if (config.openAI.logging) {
result = await dbManager.addTitleLogLine(roomId, title, moment())
}
result = await dbManager.addTitleLogLine(roomId, title, moment())
return result
}

Expand Down

0 comments on commit db8e8bb

Please sign in to comment.