Compare commits

..

1 Commits

Author SHA1 Message Date
Jonathan Smoley
0ddd59aea1 Upgrade ollama package to 0.5.15 (#174)
Snyk has created this PR to upgrade ollama from 0.5.14 to 0.5.15.

See this package in npm:
ollama

See this project in Snyk:
https://app.snyk.io/org/jt2m0l3y/project/d8b070a3-e4a3-457a-977b-7eb6a4a48346?utm_source=github&utm_medium=referral&page=upgrade-pr

Co-authored-by: snyk-bot <snyk-bot@snyk.io>
2025-05-09 09:22:14 -07:00
5 changed files with 15 additions and 18 deletions

View File

@@ -36,7 +36,7 @@ jobs:
- name: Collect Code Coverage
run: |
LINE_PCT=$(npm run coverage | tail -2 | head -1 | awk '{print $3}')
LINE_PCT=$(npm run test:coverage | tail -2 | head -1 | awk '{print $3}')
echo "COVERAGE=$LINE_PCT" >> $GITHUB_ENV
- name: Upload Code Coverage

View File

@@ -47,4 +47,4 @@ jobs:
- name: Test Application
run: |
npm run tests
npm run test:run

8
package-lock.json generated
View File

@@ -11,7 +11,7 @@
"dependencies": {
"discord.js": "^14.18.0",
"dotenv": "^16.4.7",
"ollama": "^0.5.14",
"ollama": "^0.5.15",
"redis": "^4.7.0"
},
"devDependencies": {
@@ -2003,9 +2003,9 @@
}
},
"node_modules/ollama": {
"version": "0.5.14",
"resolved": "https://registry.npmjs.org/ollama/-/ollama-0.5.14.tgz",
"integrity": "sha512-pvOuEYa2WkkAumxzJP0RdEYHkbZ64AYyyUszXVX7ruLvk5L+EiO2G71da2GqEQ4IAk4j6eLoUbGk5arzFT1wJA==",
"version": "0.5.15",
"resolved": "https://registry.npmjs.org/ollama/-/ollama-0.5.15.tgz",
"integrity": "sha512-TSaZSJyP7MQJFjSmmNsoJiriwa3U+/UJRw6+M8aucs5dTsaWNZsBIGpDb5rXnW6nXxJBB/z79gZY8IaiIQgelQ==",
"license": "MIT",
"dependencies": {
"whatwg-fetch": "^3.6.20"

View File

@@ -5,8 +5,8 @@
"main": "build/index.js",
"exports": "./build/index.js",
"scripts": {
"tests": "vitest run",
"coverage": "vitest run --coverage",
"test:run": "vitest run",
"test:coverage": "vitest run --coverage",
"watch": "tsx watch src",
"build": "tsc",
"prod": "node .",
@@ -29,7 +29,7 @@
"dependencies": {
"discord.js": "^14.18.0",
"dotenv": "^16.4.7",
"ollama": "^0.5.14",
"ollama": "^0.5.15",
"redis": "^4.7.0"
},
"devDependencies": {

View File

@@ -33,15 +33,12 @@ const messageHistory: Queue<UserMessage> = new Queue<UserMessage>
registerEvents(client, Events, messageHistory, ollama, Keys.defaultModel)
// Try to connect to redis
try {
await redis.connect()
console.log('[Redis] Successfully Connected')
} catch(error) {
console.error('[Redis] Connection Error. See error below:\n', error)
console.warn('[Redis] Failed to connect to Redis Database, using local system')
// TODO: create boolean flag that will probably be used in messageCreate.ts if redis database is down
// When implementing this boolean flag, move connection to database BEFORE the registerEvents method
}
await redis.connect()
.then(() => console.log('[Redis] Connected'))
.catch((error) => {
console.error('[Redis] Connection Error', error)
process.exit(1)
})
// Try to log in the client
await client.login(Keys.clientToken)