Skip to content

Commit

Permalink
refactor: Update AgentManager with improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
zAlweNy26 committed May 31, 2024
1 parent 472d4de commit 523ce0b
Show file tree
Hide file tree
Showing 15 changed files with 847 additions and 374 deletions.
1 change: 1 addition & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export default antfu({
'regexp/no-super-linear-backtracking': 'warn',
'node/prefer-global/process': 'off',
'curly': ['warn', 'multi-or-nest'],
'antfu/curly': 'off',
'antfu/if-newline': 'off',
'brace-style': 'off',
'no-console': 'off',
Expand Down
8 changes: 4 additions & 4 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ nodemon.once('start', () => {
log.info('Restarting the Cat...')
}).on('quit', () => {
log.info('Stopping the Cat...')
deleteTempFiles('./src', f => f.startsWith('tmp_') && f.endsWith('.ts'))
deleteTempFiles('./src')
process.exit()
}).on('error', (err) => {
log.error(err)
Expand All @@ -35,11 +35,11 @@ process.on('SIGINT', () => {
nodemon.emit('quit')
})

function deleteTempFiles(path: string, check: (str: string) => boolean) {
function deleteTempFiles(path: string) {
readdirSync(path).forEach((file) => {
const filePath = join(path, file)
const isDirectory = statSync(filePath).isDirectory()
if (isDirectory) deleteTempFiles(filePath, check)
else if (check(file)) unlinkSync(filePath)
if (isDirectory) deleteTempFiles(filePath)
else if (file.startsWith('tmp_') && file.endsWith('.ts')) unlinkSync(filePath)
})
}
18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@
"@langchain/anthropic": "^0.1.21",
"@langchain/azure-openai": "^0.0.9",
"@langchain/cohere": "^0.0.10",
"@langchain/community": "^0.2.2",
"@langchain/core": "^0.2.0",
"@langchain/community": "^0.2.4",
"@langchain/core": "^0.2.5",
"@langchain/google-genai": "^0.0.16",
"@langchain/mistralai": "^0.0.22",
"@langchain/openai": "^0.0.33",
"@langchain/mistralai": "^0.0.23",
"@langchain/openai": "^0.1.0",
"@mgcrea/fastify-request-logger": "^1.6.0",
"@mgcrea/pino-pretty-compact": "^1.3.0",
"@qdrant/js-client-rest": "^1.9.0",
Expand All @@ -86,7 +86,7 @@
"html-to-text": "^9.0.5",
"is-docker": "^3.0.0",
"js-tiktoken": "^1.0.12",
"langchain": "^0.2.2",
"langchain": "^0.2.4",
"lodash": "^4.17.21",
"lowdb": "^7.0.1",
"mammoth": "^1.7.2",
Expand All @@ -99,14 +99,14 @@
"turbowatch": "^2.29.4",
"uncrypto": "^0.1.3",
"zod": "^3.23.8",
"zod-openapi": "^2.17.0",
"zod-openapi": "^2.18.0",
"zod-to-json-schema": "^3.23.0"
},
"devDependencies": {
"@antfu/eslint-config": "^2.18.1",
"@antfu/eslint-config": "^2.19.1",
"@total-typescript/ts-reset": "^0.5.1",
"@types/lodash": "^4.17.4",
"@types/node": "^20.12.12",
"@types/node": "^20.12.13",
"@types/nodemon": "^1.19.6",
"@types/qs": "^6.9.15",
"@types/ws": "^8.5.10",
Expand All @@ -120,7 +120,7 @@
"tsup": "^8.0.2",
"tsx": "^4.11.0",
"typescript": "^5.4.5",
"typescript-eslint": "^7.10.0",
"typescript-eslint": "^7.11.0",
"vite-tsconfig-paths": "^4.3.2",
"vitest": "^1.6.0"
}
Expand Down
Loading

0 comments on commit 523ce0b

Please sign in to comment.