kopia lustrzana https://github.com/transitive-bullshit/chatgpt-api
feat: implement debug-based custom logger #29
commit
b61caf629e
|
@ -62,8 +62,6 @@
|
|||
"p-retry": "^5.1.2",
|
||||
"p-throttle": "^5.1.0",
|
||||
"p-timeout": "^6.1.2",
|
||||
"pino": "^8.14.1",
|
||||
"pino-pretty": "^10.0.0",
|
||||
"quick-lru": "^6.1.1",
|
||||
"replicate": "^0.12.3",
|
||||
"ts-dedent": "^2.2.0",
|
||||
|
|
232
pnpm-lock.yaml
232
pnpm-lock.yaml
|
@ -74,12 +74,6 @@ dependencies:
|
|||
p-timeout:
|
||||
specifier: ^6.1.2
|
||||
version: 6.1.2
|
||||
pino:
|
||||
specifier: ^8.14.1
|
||||
version: 8.14.1
|
||||
pino-pretty:
|
||||
specifier: ^10.0.0
|
||||
version: 10.0.0
|
||||
quick-lru:
|
||||
specifier: ^6.1.1
|
||||
version: 6.1.1
|
||||
|
@ -1198,13 +1192,6 @@ packages:
|
|||
eslint-visitor-keys: 3.4.1
|
||||
dev: true
|
||||
|
||||
/abort-controller@3.0.0:
|
||||
resolution: {integrity: sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==}
|
||||
engines: {node: '>=6.5'}
|
||||
dependencies:
|
||||
event-target-shim: 5.0.1
|
||||
dev: false
|
||||
|
||||
/acorn-jsx@5.3.2(acorn@8.9.0):
|
||||
resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==}
|
||||
peerDependencies:
|
||||
|
@ -1345,11 +1332,6 @@ packages:
|
|||
engines: {node: '>=8'}
|
||||
dev: true
|
||||
|
||||
/atomic-sleep@1.0.0:
|
||||
resolution: {integrity: sha512-kNOjDqAh7px0XWNI+4QbzoiR/nTkHAWNud2uvnJquD1/x5a7EQZMJT0AczqK0Qn67oY/TTQ1LbUKajZpp3I9tQ==}
|
||||
engines: {node: '>=8.0.0'}
|
||||
dev: false
|
||||
|
||||
/ava@5.3.1:
|
||||
resolution: {integrity: sha512-Scv9a4gMOXB6+ni4toLuhAm9KYWEjsgBglJl+kMGI5+IVDt120CCDZyB5HNU9DjmLI2t4I0GbnxGLmmRfGTJGg==}
|
||||
engines: {node: '>=14.19 <15 || >=16.15 <17 || >=18'}
|
||||
|
@ -1414,6 +1396,7 @@ packages:
|
|||
|
||||
/balanced-match@1.0.2:
|
||||
resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==}
|
||||
dev: true
|
||||
|
||||
/base64-js@1.5.1:
|
||||
resolution: {integrity: sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==}
|
||||
|
@ -1439,6 +1422,7 @@ packages:
|
|||
resolution: {integrity: sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==}
|
||||
dependencies:
|
||||
balanced-match: 1.0.2
|
||||
dev: true
|
||||
|
||||
/braces@3.0.2:
|
||||
resolution: {integrity: sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==}
|
||||
|
@ -1451,13 +1435,6 @@ packages:
|
|||
resolution: {integrity: sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==}
|
||||
dev: true
|
||||
|
||||
/buffer@6.0.3:
|
||||
resolution: {integrity: sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==}
|
||||
dependencies:
|
||||
base64-js: 1.5.1
|
||||
ieee754: 1.2.1
|
||||
dev: false
|
||||
|
||||
/bundle-require@4.0.1(esbuild@0.18.4):
|
||||
resolution: {integrity: sha512-9NQkRHlNdNpDBGmLpngF3EFDcwodhMUuLz9PaWYciVcQF9SE4LFjM2DB/xV1Li5JiuDMv7ZUWuC3rGbqR0MAXQ==}
|
||||
engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0}
|
||||
|
@ -1768,10 +1745,6 @@ packages:
|
|||
time-zone: 1.0.0
|
||||
dev: true
|
||||
|
||||
/dateformat@4.6.3:
|
||||
resolution: {integrity: sha512-2P0p0pFGzHS5EMnhdxQi7aJN+iMheud0UhG4dlE1DLAlvL8JHjJJTX/CSm4JXwV0Ka5nGk3zC5mcb5bUQUxxMA==}
|
||||
dev: false
|
||||
|
||||
/dayjs@1.11.8:
|
||||
resolution: {integrity: sha512-LcgxzFoWMEPO7ggRv1Y2N31hUf2R0Vj7fuy/m+Bg1K8rr+KAs1AEy4y9jd5DXe8pbHgX+srkHNS7TH6Q6ZhYeQ==}
|
||||
dev: false
|
||||
|
@ -1885,12 +1858,6 @@ packages:
|
|||
resolution: {integrity: sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==}
|
||||
dev: true
|
||||
|
||||
/end-of-stream@1.4.4:
|
||||
resolution: {integrity: sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==}
|
||||
dependencies:
|
||||
once: 1.4.0
|
||||
dev: false
|
||||
|
||||
/error-ex@1.3.2:
|
||||
resolution: {integrity: sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==}
|
||||
dependencies:
|
||||
|
@ -2159,16 +2126,6 @@ packages:
|
|||
engines: {node: '>=0.10.0'}
|
||||
dev: true
|
||||
|
||||
/event-target-shim@5.0.1:
|
||||
resolution: {integrity: sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==}
|
||||
engines: {node: '>=6'}
|
||||
dev: false
|
||||
|
||||
/events@3.3.0:
|
||||
resolution: {integrity: sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==}
|
||||
engines: {node: '>=0.8.x'}
|
||||
dev: false
|
||||
|
||||
/execa@5.1.1:
|
||||
resolution: {integrity: sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==}
|
||||
engines: {node: '>=10'}
|
||||
|
@ -2217,10 +2174,6 @@ packages:
|
|||
tmp: 0.0.33
|
||||
dev: false
|
||||
|
||||
/fast-copy@3.0.1:
|
||||
resolution: {integrity: sha512-Knr7NOtK3HWRYGtHoJrjkaWepqT8thIVGAwt0p0aUs1zqkAzXZV4vo9fFNwyb5fcqK1GKYFYxldQdIDVKhUAfA==}
|
||||
dev: false
|
||||
|
||||
/fast-deep-equal@3.1.3:
|
||||
resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==}
|
||||
dev: true
|
||||
|
@ -2248,15 +2201,6 @@ packages:
|
|||
resolution: {integrity: sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==}
|
||||
dev: true
|
||||
|
||||
/fast-redact@3.2.0:
|
||||
resolution: {integrity: sha512-zaTadChr+NekyzallAMXATXLOR8MNx3zqpZ0MUF2aGf4EathnG0f32VLODNlY8IuGY3HoRO2L6/6fSzNsLaHIw==}
|
||||
engines: {node: '>=6'}
|
||||
dev: false
|
||||
|
||||
/fast-safe-stringify@2.1.1:
|
||||
resolution: {integrity: sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA==}
|
||||
dev: false
|
||||
|
||||
/fastq@1.15.0:
|
||||
resolution: {integrity: sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==}
|
||||
dependencies:
|
||||
|
@ -2336,6 +2280,7 @@ packages:
|
|||
|
||||
/fs.realpath@1.0.0:
|
||||
resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==}
|
||||
dev: true
|
||||
|
||||
/fsevents@2.3.2:
|
||||
resolution: {integrity: sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==}
|
||||
|
@ -2432,17 +2377,6 @@ packages:
|
|||
path-is-absolute: 1.0.1
|
||||
dev: true
|
||||
|
||||
/glob@8.1.0:
|
||||
resolution: {integrity: sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==}
|
||||
engines: {node: '>=12'}
|
||||
dependencies:
|
||||
fs.realpath: 1.0.0
|
||||
inflight: 1.0.6
|
||||
inherits: 2.0.4
|
||||
minimatch: 5.1.6
|
||||
once: 1.4.0
|
||||
dev: false
|
||||
|
||||
/globals@11.12.0:
|
||||
resolution: {integrity: sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==}
|
||||
engines: {node: '>=4'}
|
||||
|
@ -2573,13 +2507,6 @@ packages:
|
|||
type-fest: 1.4.0
|
||||
dev: true
|
||||
|
||||
/help-me@4.2.0:
|
||||
resolution: {integrity: sha512-TAOnTB8Tz5Dw8penUuzHVrKNKlCIbwwbHnXraNJxPwf8LRtE2HlM84RYuezMFcwOJmoYOCWVDyJ8TQGxn9PgxA==}
|
||||
dependencies:
|
||||
glob: 8.1.0
|
||||
readable-stream: 3.6.2
|
||||
dev: false
|
||||
|
||||
/hosted-git-info@2.8.9:
|
||||
resolution: {integrity: sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==}
|
||||
dev: true
|
||||
|
@ -2618,10 +2545,6 @@ packages:
|
|||
safer-buffer: 2.1.2
|
||||
dev: false
|
||||
|
||||
/ieee754@1.2.1:
|
||||
resolution: {integrity: sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==}
|
||||
dev: false
|
||||
|
||||
/ignore-by-default@2.1.0:
|
||||
resolution: {integrity: sha512-yiWd4GVmJp0Q6ghmM2B/V3oZGRmjrKLXvHR3TE1nfoXsmoggllfZUQe74EN0fJdPFZu2NIvNdrMMLm3OsV7Ohw==}
|
||||
engines: {node: '>=10 <11 || >=12 <13 || >=14'}
|
||||
|
@ -2660,9 +2583,11 @@ packages:
|
|||
dependencies:
|
||||
once: 1.4.0
|
||||
wrappy: 1.0.2
|
||||
dev: true
|
||||
|
||||
/inherits@2.0.4:
|
||||
resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==}
|
||||
dev: true
|
||||
|
||||
/internal-slot@1.0.5:
|
||||
resolution: {integrity: sha512-Y+R5hJrzs52QCG2laLn4udYVnxsfny9CpOhNhUvk/SSSVyF6T27FzRbF0sroPidSu3X8oEAkOn2K804mjpt6UQ==}
|
||||
|
@ -2939,6 +2864,7 @@ packages:
|
|||
/joycon@3.1.1:
|
||||
resolution: {integrity: sha512-34wB/Y7MW7bzjKRjUKTa46I2Z7eV62Rkhva+KkopW7Qvv/OSWBqvkSY7vusOPrNuZcUG3tApvdVgNB8POj3SPw==}
|
||||
engines: {node: '>=10'}
|
||||
dev: true
|
||||
|
||||
/js-string-escape@1.0.1:
|
||||
resolution: {integrity: sha512-Smw4xcfIQ5LVjAOuJCvN/zIodzA/BBSsluuoSykP+lUvScIi4U6RJLfwHet5cxFnCswUjISV8oAXaqaJDY3chg==}
|
||||
|
@ -3283,13 +3209,6 @@ packages:
|
|||
brace-expansion: 1.1.11
|
||||
dev: true
|
||||
|
||||
/minimatch@5.1.6:
|
||||
resolution: {integrity: sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==}
|
||||
engines: {node: '>=10'}
|
||||
dependencies:
|
||||
brace-expansion: 2.0.1
|
||||
dev: false
|
||||
|
||||
/minimatch@9.0.2:
|
||||
resolution: {integrity: sha512-PZOT9g5v2ojiTL7r1xF6plNHLtOeTpSlDI007As2NlA2aYBMfVom17yqa6QzhmDP8QOhn7LjHTg7DFCVSSa6yg==}
|
||||
engines: {node: '>=16 || 14 >=14.17'}
|
||||
|
@ -3462,14 +3381,11 @@ packages:
|
|||
object-keys: 1.1.1
|
||||
dev: true
|
||||
|
||||
/on-exit-leak-free@2.1.0:
|
||||
resolution: {integrity: sha512-VuCaZZAjReZ3vUwgOB8LxAosIurDiAW0s13rI1YwmaP++jvcxP77AWoQvenZebpCA2m8WC1/EosPYPMjnRAp/w==}
|
||||
dev: false
|
||||
|
||||
/once@1.4.0:
|
||||
resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==}
|
||||
dependencies:
|
||||
wrappy: 1.0.2
|
||||
dev: true
|
||||
|
||||
/onetime@5.1.2:
|
||||
resolution: {integrity: sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==}
|
||||
|
@ -3703,54 +3619,6 @@ packages:
|
|||
engines: {node: '>=4'}
|
||||
dev: true
|
||||
|
||||
/pino-abstract-transport@1.0.0:
|
||||
resolution: {integrity: sha512-c7vo5OpW4wIS42hUVcT5REsL8ZljsUfBjqV/e2sFxmFEFZiq1XLUp5EYLtuDH6PEHq9W1egWqRbnLUP5FuZmOA==}
|
||||
dependencies:
|
||||
readable-stream: 4.4.0
|
||||
split2: 4.2.0
|
||||
dev: false
|
||||
|
||||
/pino-pretty@10.0.0:
|
||||
resolution: {integrity: sha512-zKFjYXBzLaLTEAN1ayKpHXtL5UeRQC7R3lvhKe7fWs7hIVEjKGG/qIXwQt9HmeUp71ogUd/YcW+LmMwRp4KT6Q==}
|
||||
hasBin: true
|
||||
dependencies:
|
||||
colorette: 2.0.20
|
||||
dateformat: 4.6.3
|
||||
fast-copy: 3.0.1
|
||||
fast-safe-stringify: 2.1.1
|
||||
help-me: 4.2.0
|
||||
joycon: 3.1.1
|
||||
minimist: 1.2.8
|
||||
on-exit-leak-free: 2.1.0
|
||||
pino-abstract-transport: 1.0.0
|
||||
pump: 3.0.0
|
||||
readable-stream: 4.4.0
|
||||
secure-json-parse: 2.7.0
|
||||
sonic-boom: 3.3.0
|
||||
strip-json-comments: 3.1.1
|
||||
dev: false
|
||||
|
||||
/pino-std-serializers@6.2.1:
|
||||
resolution: {integrity: sha512-wHuWB+CvSVb2XqXM0W/WOYUkVSPbiJb9S5fNB7TBhd8s892Xq910bRxwHtC4l71hgztObTjXL6ZheZXFjhDrDQ==}
|
||||
dev: false
|
||||
|
||||
/pino@8.14.1:
|
||||
resolution: {integrity: sha512-8LYNv7BKWXSfS+k6oEc6occy5La+q2sPwU3q2ljTX5AZk7v+5kND2o5W794FyRaqha6DJajmkNRsWtPpFyMUdw==}
|
||||
hasBin: true
|
||||
dependencies:
|
||||
atomic-sleep: 1.0.0
|
||||
fast-redact: 3.2.0
|
||||
on-exit-leak-free: 2.1.0
|
||||
pino-abstract-transport: 1.0.0
|
||||
pino-std-serializers: 6.2.1
|
||||
process-warning: 2.2.0
|
||||
quick-format-unescaped: 4.0.4
|
||||
real-require: 0.2.0
|
||||
safe-stable-stringify: 2.4.3
|
||||
sonic-boom: 3.3.0
|
||||
thread-stream: 2.3.0
|
||||
dev: false
|
||||
|
||||
/pirates@4.0.5:
|
||||
resolution: {integrity: sha512-8V9+HQPupnaXMA23c5hvl69zXvTwTzyAYasnkb0Tts4XvO4CliqONMOnvlq26rkhLC3nWDFBJf73LU1e1VZLaQ==}
|
||||
engines: {node: '>= 6'}
|
||||
|
@ -3805,22 +3673,6 @@ packages:
|
|||
parse-ms: 3.0.0
|
||||
dev: true
|
||||
|
||||
/process-warning@2.2.0:
|
||||
resolution: {integrity: sha512-/1WZ8+VQjR6avWOgHeEPd7SDQmFQ1B5mC1eRXsCm5TarlNmx/wCsa5GEaxGm05BORRtyG/Ex/3xq3TuRvq57qg==}
|
||||
dev: false
|
||||
|
||||
/process@0.11.10:
|
||||
resolution: {integrity: sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A==}
|
||||
engines: {node: '>= 0.6.0'}
|
||||
dev: false
|
||||
|
||||
/pump@3.0.0:
|
||||
resolution: {integrity: sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==}
|
||||
dependencies:
|
||||
end-of-stream: 1.4.4
|
||||
once: 1.4.0
|
||||
dev: false
|
||||
|
||||
/punycode@2.3.0:
|
||||
resolution: {integrity: sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==}
|
||||
engines: {node: '>=6'}
|
||||
|
@ -3830,10 +3682,6 @@ packages:
|
|||
resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==}
|
||||
dev: true
|
||||
|
||||
/quick-format-unescaped@4.0.4:
|
||||
resolution: {integrity: sha512-tYC1Q1hgyRuHgloV/YXs2w15unPVh8qfu/qCTfhTYamaw7fyhumKa2yGpdSo87vY32rIclj+4fWYQXUMs9EHvg==}
|
||||
dev: false
|
||||
|
||||
/quick-lru@5.1.1:
|
||||
resolution: {integrity: sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA==}
|
||||
engines: {node: '>=10'}
|
||||
|
@ -3879,25 +3727,6 @@ packages:
|
|||
type-fest: 1.4.0
|
||||
dev: true
|
||||
|
||||
/readable-stream@3.6.2:
|
||||
resolution: {integrity: sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==}
|
||||
engines: {node: '>= 6'}
|
||||
dependencies:
|
||||
inherits: 2.0.4
|
||||
string_decoder: 1.3.0
|
||||
util-deprecate: 1.0.2
|
||||
dev: false
|
||||
|
||||
/readable-stream@4.4.0:
|
||||
resolution: {integrity: sha512-kDMOq0qLtxV9f/SQv522h8cxZBqNZXuXNyjyezmfAAuribMyVXziljpQ/uQhfE1XLg2/TLTW2DsnoE4VAi/krg==}
|
||||
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
|
||||
dependencies:
|
||||
abort-controller: 3.0.0
|
||||
buffer: 6.0.3
|
||||
events: 3.3.0
|
||||
process: 0.11.10
|
||||
dev: false
|
||||
|
||||
/readdirp@3.6.0:
|
||||
resolution: {integrity: sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==}
|
||||
engines: {node: '>=8.10.0'}
|
||||
|
@ -3905,11 +3734,6 @@ packages:
|
|||
picomatch: 2.3.1
|
||||
dev: true
|
||||
|
||||
/real-require@0.2.0:
|
||||
resolution: {integrity: sha512-57frrGM/OCTLqLOAh0mhVA9VBMHd+9U7Zb2THMGdBUoZVOtGbJzjxsYGDJ3A9AYYCP4hn6y1TVbaOfzWtm5GFg==}
|
||||
engines: {node: '>= 12.13.0'}
|
||||
dev: false
|
||||
|
||||
/redent@4.0.0:
|
||||
resolution: {integrity: sha512-tYkDkVVtYkSVhuQ4zBgfvciymHaeuel+zFKXShfDnFP5SyVEP7qo70Rf1jTOTCx3vGNAbnEi/xFkcfQVMIBWag==}
|
||||
engines: {node: '>=12'}
|
||||
|
@ -4040,10 +3864,6 @@ packages:
|
|||
tslib: 2.5.3
|
||||
dev: true
|
||||
|
||||
/safe-buffer@5.2.1:
|
||||
resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==}
|
||||
dev: false
|
||||
|
||||
/safe-regex-test@1.0.0:
|
||||
resolution: {integrity: sha512-JBUUzyOgEwXQY1NuPtvcj/qcBDbDmEvWufhlnXZIm75DEHp+afM1r1ujJpJsV/gSM4t59tpDyPi1sd6ZaPFfsA==}
|
||||
dependencies:
|
||||
|
@ -4052,19 +3872,10 @@ packages:
|
|||
is-regex: 1.1.4
|
||||
dev: true
|
||||
|
||||
/safe-stable-stringify@2.4.3:
|
||||
resolution: {integrity: sha512-e2bDA2WJT0wxseVd4lsDP4+3ONX6HpMXQa1ZhFQ7SU+GjvORCmShbCMltrtIDfkYhVHrOcPtj+KhmDBdPdZD1g==}
|
||||
engines: {node: '>=10'}
|
||||
dev: false
|
||||
|
||||
/safer-buffer@2.1.2:
|
||||
resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==}
|
||||
dev: false
|
||||
|
||||
/secure-json-parse@2.7.0:
|
||||
resolution: {integrity: sha512-6aU+Rwsezw7VR8/nyvKTx8QpWH9FrcYiXXlqC4z5d5XQBDRqtbfsRjnwGyqbi3gddNtWHuEk9OANUotL26qKUw==}
|
||||
dev: false
|
||||
|
||||
/semver@5.7.1:
|
||||
resolution: {integrity: sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==}
|
||||
hasBin: true
|
||||
|
@ -4191,12 +4002,6 @@ packages:
|
|||
is-fullwidth-code-point: 4.0.0
|
||||
dev: true
|
||||
|
||||
/sonic-boom@3.3.0:
|
||||
resolution: {integrity: sha512-LYxp34KlZ1a2Jb8ZQgFCK3niIHzibdwtwNUWKg0qQRzsDoJ3Gfgkf8KdBTFU3SkejDEIlWwnSnpVdOZIhFMl/g==}
|
||||
dependencies:
|
||||
atomic-sleep: 1.0.0
|
||||
dev: false
|
||||
|
||||
/sort-keys@5.0.0:
|
||||
resolution: {integrity: sha512-Pdz01AvCAottHTPQGzndktFNdbRA75BgOfeT1hH+AMnJFv8lynkPi42rfeEhpx1saTEI3YNMWxfqu0sFD1G8pw==}
|
||||
engines: {node: '>=12'}
|
||||
|
@ -4249,11 +4054,6 @@ packages:
|
|||
resolution: {integrity: sha512-XkD+zwiqXHikFZm4AX/7JSCXA98U5Db4AFd5XUg/+9UNtnH75+Z9KxtpYiJZx36mUDVOwH83pl7yvCer6ewM3w==}
|
||||
dev: true
|
||||
|
||||
/split2@4.2.0:
|
||||
resolution: {integrity: sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg==}
|
||||
engines: {node: '>= 10.x'}
|
||||
dev: false
|
||||
|
||||
/sprintf-js@1.0.3:
|
||||
resolution: {integrity: sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==}
|
||||
dev: true
|
||||
|
@ -4325,12 +4125,6 @@ packages:
|
|||
es-abstract: 1.21.2
|
||||
dev: true
|
||||
|
||||
/string_decoder@1.3.0:
|
||||
resolution: {integrity: sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==}
|
||||
dependencies:
|
||||
safe-buffer: 5.2.1
|
||||
dev: false
|
||||
|
||||
/strip-ansi@6.0.1:
|
||||
resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==}
|
||||
engines: {node: '>=8'}
|
||||
|
@ -4369,6 +4163,7 @@ packages:
|
|||
/strip-json-comments@3.1.1:
|
||||
resolution: {integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==}
|
||||
engines: {node: '>=8'}
|
||||
dev: true
|
||||
|
||||
/sucrase@3.32.0:
|
||||
resolution: {integrity: sha512-ydQOU34rpSyj2TGyz4D2p8rbktIOZ8QY9s+DGLvFU1i5pWJE8vkpruCjGCMHsdXwnD7JDcS+noSwM/a7zyNFDQ==}
|
||||
|
@ -4443,12 +4238,6 @@ packages:
|
|||
any-promise: 1.3.0
|
||||
dev: true
|
||||
|
||||
/thread-stream@2.3.0:
|
||||
resolution: {integrity: sha512-kaDqm1DET9pp3NXwR8382WHbnpXnRkN9xGN9dQt3B2+dmXiW8X1SOwmFOxAErEQ47ObhZ96J6yhZNXuyCOL7KA==}
|
||||
dependencies:
|
||||
real-require: 0.2.0
|
||||
dev: false
|
||||
|
||||
/through@2.3.8:
|
||||
resolution: {integrity: sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==}
|
||||
dev: true
|
||||
|
@ -4668,10 +4457,6 @@ packages:
|
|||
punycode: 2.3.0
|
||||
dev: true
|
||||
|
||||
/util-deprecate@1.0.2:
|
||||
resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==}
|
||||
dev: false
|
||||
|
||||
/uuid@9.0.0:
|
||||
resolution: {integrity: sha512-MXcSTerfPa4uqyzStbRoTgt5XIe3x5+42+q1sDuy3R5MDk66URdLMOZe5aPX/SQd+kuYAh0FdP/pO28IkQyTeg==}
|
||||
hasBin: true
|
||||
|
@ -4794,6 +4579,7 @@ packages:
|
|||
|
||||
/wrappy@1.0.2:
|
||||
resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==}
|
||||
dev: true
|
||||
|
||||
/write-file-atomic@5.0.1:
|
||||
resolution: {integrity: sha512-+QU2zd6OTD8XWIJCbffaiQeH9U73qIqafo1x6V1snCWYGJf6cVE0cDR4D8xRzcEnfI21IFrUPzPGtcPf8AC+Rw==}
|
||||
|
|
|
@ -234,8 +234,8 @@ export abstract class BaseChatCompletion<
|
|||
}
|
||||
|
||||
this._logger.info(
|
||||
debugInfo,
|
||||
`>>> Task createChatCompletion "${this.nameForHuman}"`
|
||||
`>>> Task createChatCompletion "${this.nameForHuman}"`,
|
||||
debugInfo
|
||||
)
|
||||
|
||||
// console.log('<<< completion', { messages, functions })
|
||||
|
@ -245,8 +245,8 @@ export abstract class BaseChatCompletion<
|
|||
// console.log('>>> completion', completion.message)
|
||||
|
||||
this._logger.info(
|
||||
message,
|
||||
`<<< Task createChatCompletion "${this.nameForHuman}"`
|
||||
`<<< Task createChatCompletion "${this.nameForHuman}"`,
|
||||
message
|
||||
)
|
||||
ctx.metadata.completion = completion
|
||||
|
||||
|
@ -308,13 +308,10 @@ export abstract class BaseChatCompletion<
|
|||
// task: functionName,
|
||||
// input: functionArguments
|
||||
// })
|
||||
this._logger.info(
|
||||
{
|
||||
task: functionName,
|
||||
input: functionArguments
|
||||
},
|
||||
`>>> Sub-Task "${tool.nameForHuman}"`
|
||||
)
|
||||
this._logger.info(`>>> Sub-Task "${tool.nameForHuman}"`, {
|
||||
task: functionName,
|
||||
input: functionArguments
|
||||
})
|
||||
|
||||
// TODO: handle sub-task errors gracefully
|
||||
const toolCallResponse = await tool.callWithMetadata(
|
||||
|
@ -322,14 +319,11 @@ export abstract class BaseChatCompletion<
|
|||
ctx
|
||||
)
|
||||
|
||||
this._logger.info(
|
||||
{
|
||||
task: functionName,
|
||||
input: functionArguments,
|
||||
output: toolCallResponse.result
|
||||
},
|
||||
`<<< Sub-Task "${tool.nameForHuman}"`
|
||||
)
|
||||
this._logger.info(`<<< Sub-Task "${tool.nameForHuman}"`, {
|
||||
task: functionName,
|
||||
input: functionArguments,
|
||||
output: toolCallResponse.result
|
||||
})
|
||||
// console.log('<<< sub-task', {
|
||||
// task: functionName,
|
||||
// input: functionArguments,
|
||||
|
|
201
src/logger.ts
201
src/logger.ts
|
@ -1,114 +1,103 @@
|
|||
import { pino } from 'pino'
|
||||
import pinoPretty from 'pino-pretty'
|
||||
import { cyan, green, magenta, red, yellow } from 'colorette'
|
||||
import logger from 'debug'
|
||||
|
||||
import { identity } from '@/utils'
|
||||
|
||||
import { getEnv } from './env'
|
||||
|
||||
export type Level = 'fatal' | 'error' | 'warn' | 'info' | 'debug' | 'trace'
|
||||
export type LevelWithSilent = Level | 'silent'
|
||||
|
||||
interface LogFn {
|
||||
<T extends object>(obj: T, msg?: string, ...args: any[]): void
|
||||
(obj: unknown, msg?: string, ...args: any[]): void
|
||||
(msg: string, ...args: any[]): void
|
||||
/**
|
||||
* Severity levels of an event.
|
||||
*/
|
||||
export enum Severity {
|
||||
DEBUG = 0,
|
||||
INFO = 1,
|
||||
WARNING = 2,
|
||||
ERROR = 3,
|
||||
CRITICAL = 4
|
||||
}
|
||||
|
||||
// these types are taken from `pino`
|
||||
export interface Logger {
|
||||
/**
|
||||
* Set this property to the desired logging level. In order of priority, available levels are:
|
||||
*
|
||||
* - 'fatal'
|
||||
* - 'error'
|
||||
* - 'warn'
|
||||
* - 'info'
|
||||
* - 'debug'
|
||||
* - 'trace'
|
||||
*
|
||||
* The logging level is a __minimum__ level. For instance if `logger.level` is `'info'` then all `'fatal'`, `'error'`, `'warn'`,
|
||||
* and `'info'` logs will be enabled.
|
||||
*
|
||||
* You can pass `'silent'` to disable logging.
|
||||
*/
|
||||
level: LevelWithSilent | string
|
||||
|
||||
/**
|
||||
* Log at `'fatal'` level the given msg. If the first argument is an object, all its properties will be included in the JSON line.
|
||||
* If more args follows `msg`, these will be used to format `msg` using `util.format`.
|
||||
*
|
||||
* @typeParam T - the interface of the object being serialized. Default is object.
|
||||
* @param obj - object to be serialized
|
||||
* @param msg - the log message to write
|
||||
* @param args - format string values when `msg` is a format string
|
||||
*/
|
||||
fatal: LogFn
|
||||
|
||||
/**
|
||||
* Log at `'error'` level the given msg. If the first argument is an object, all its properties will be included in the JSON line.
|
||||
* If more args follows `msg`, these will be used to format `msg` using `util.format`.
|
||||
*
|
||||
* @typeParam T - the interface of the object being serialized. Default is object.
|
||||
* @param obj - object to be serialized
|
||||
* @param msg - the log message to write
|
||||
* @param args - format string values when `msg` is a format string
|
||||
*/
|
||||
error: LogFn
|
||||
|
||||
/**
|
||||
* Log at `'warn'` level the given msg. If the first argument is an object, all its properties will be included in the JSON line.
|
||||
* If more args follows `msg`, these will be used to format `msg` using `util.format`.
|
||||
*
|
||||
* @typeParam T - the interface of the object being serialized. Default is object.
|
||||
* @param obj - object to be serialized
|
||||
* @param msg - the log message to write
|
||||
* @param args - format string values when `msg` is a format string
|
||||
*/
|
||||
warn: LogFn
|
||||
|
||||
/**
|
||||
* Log at `'info'` level the given msg. If the first argument is an object, all its properties will be included in the JSON line.
|
||||
* If more args follows `msg`, these will be used to format `msg` using `util.format`.
|
||||
*
|
||||
* @typeParam T - the interface of the object being serialized. Default is object.
|
||||
* @param obj - object to be serialized
|
||||
* @param msg - the log message to write
|
||||
* @param args - format string values when `msg` is a format string
|
||||
*/
|
||||
info: LogFn
|
||||
|
||||
/**
|
||||
* Log at `'debug'` level the given msg. If the first argument is an object, all its properties will be included in the JSON line.
|
||||
* If more args follows `msg`, these will be used to format `msg` using `util.format`.
|
||||
*
|
||||
* @typeParam T - the interface of the object being serialized. Default is object.
|
||||
* @param obj - object to be serialized
|
||||
* @param msg - the log message to write
|
||||
* @param args - format string values when `msg` is a format string
|
||||
*/
|
||||
debug: LogFn
|
||||
|
||||
/**
|
||||
* Log at `'trace'` level the given msg. If the first argument is an object, all its properties will be included in the JSON line.
|
||||
* If more args follows `msg`, these will be used to format `msg` using `util.format`.
|
||||
*
|
||||
* @typeParam T - the interface of the object being serialized. Default is object.
|
||||
* @param obj - object to be serialized
|
||||
* @param msg - the log message to write
|
||||
* @param args - format string values when `msg` is a format string
|
||||
*/
|
||||
trace: LogFn
|
||||
|
||||
/**
|
||||
* Noop function.
|
||||
*/
|
||||
silent: LogFn
|
||||
/**
|
||||
* Strings to represent severity levels.
|
||||
*/
|
||||
const SEVERITY_STRINGS: Record<Severity, string> = {
|
||||
[Severity.DEBUG]: 'DEBUG',
|
||||
[Severity.INFO]: 'INFO',
|
||||
[Severity.WARNING]: 'WARN',
|
||||
[Severity.ERROR]: 'ERROR',
|
||||
[Severity.CRITICAL]: 'CRITICAL'
|
||||
}
|
||||
|
||||
export const defaultLogger: Logger = pino(
|
||||
{
|
||||
level: getEnv('LOG_LEVEL', 'info')
|
||||
/**
|
||||
* Functions to colorize text based on severity level.
|
||||
*/
|
||||
const SEVERITY_COLORS: Record<Severity, (text: string) => string> = {
|
||||
[Severity.DEBUG]: cyan,
|
||||
[Severity.INFO]: green,
|
||||
[Severity.WARNING]: yellow,
|
||||
[Severity.ERROR]: red,
|
||||
[Severity.CRITICAL]: magenta
|
||||
}
|
||||
|
||||
/*
|
||||
* Define minimum LOG_LEVEL, defaulting to Severity.INFO if not provided or if an invalid value is provided. Any events below that level won't be logged to the console.
|
||||
*/
|
||||
const logLevelEnv = getEnv(
|
||||
'LOG_LEVEL',
|
||||
'info'
|
||||
)?.toUpperCase() as keyof typeof Severity
|
||||
let LOG_LEVEL = Severity[logLevelEnv]
|
||||
const showDateTime = getEnv('LOG_SHOW_DATE') === 'true'
|
||||
|
||||
if (LOG_LEVEL === undefined) {
|
||||
console.error(
|
||||
`Invalid value for LOG_LEVEL: ${logLevelEnv}. Falling back to default level: INFO`
|
||||
)
|
||||
LOG_LEVEL = Severity.INFO
|
||||
}
|
||||
|
||||
const debug = logger('agentic')
|
||||
|
||||
const SPACE = ' '
|
||||
const INDENT = SPACE.repeat(23)
|
||||
|
||||
// Override the default logger to add a timestamp and severity level to the logged arguments:
|
||||
logger.formatArgs = function formatArgs(args) {
|
||||
const severity = args[args.length - 1]
|
||||
const name = this.namespace
|
||||
const dateTime = showDateTime ? new Date().toISOString() + SPACE : ''
|
||||
const colorFn = SEVERITY_COLORS[severity] || identity
|
||||
const prefix = colorFn(SPACE + SEVERITY_STRINGS[severity] + SPACE)
|
||||
args[0] =
|
||||
dateTime + name + prefix + args[0].split('\n').join('\n' + INDENT + prefix)
|
||||
|
||||
// Remove the severity level from the logged arguments:
|
||||
args.pop()
|
||||
}
|
||||
|
||||
/**
|
||||
* Default `debug` logger with methods that log to the console with the respective severity level.
|
||||
*/
|
||||
export const defaultLogger = {
|
||||
debug: (formatter: any, ...args: any[]) => {
|
||||
if (LOG_LEVEL > Severity.DEBUG) return
|
||||
debug(formatter, ...args, Severity.DEBUG)
|
||||
},
|
||||
pinoPretty({
|
||||
sync: true,
|
||||
colorize: true
|
||||
})
|
||||
)
|
||||
info: (formatter: any, ...args: any[]) => {
|
||||
if (LOG_LEVEL > Severity.INFO) return
|
||||
debug(formatter, ...args, Severity.INFO)
|
||||
},
|
||||
warn: (formatter: any, ...args: any[]) => {
|
||||
if (LOG_LEVEL > Severity.WARNING) return
|
||||
debug(formatter, ...args, Severity.WARNING)
|
||||
},
|
||||
error: (formatter: any, ...args: any[]) => {
|
||||
if (LOG_LEVEL > Severity.ERROR) return
|
||||
debug(formatter, ...args, Severity.ERROR)
|
||||
},
|
||||
critical: (formatter: any, ...args: any[]) => {
|
||||
if (LOG_LEVEL > Severity.CRITICAL) return
|
||||
debug(formatter, ...args, Severity.CRITICAL)
|
||||
}
|
||||
}
|
||||
|
||||
export type Logger = typeof defaultLogger
|
||||
|
|
|
@ -203,7 +203,7 @@ export abstract class BaseTask<
|
|||
// maxLength: 120
|
||||
// })})`
|
||||
|
||||
this._logger.info({ input }, `Task call "${this.nameForHuman}"`)
|
||||
this._logger.info(`Task call "${this.nameForHuman}"`, { input })
|
||||
|
||||
if (this.inputSchema) {
|
||||
const safeInput = this.inputSchema.safeParse(input)
|
||||
|
@ -265,10 +265,10 @@ export abstract class BaseTask<
|
|||
...this._retryConfig,
|
||||
onFailedAttempt: async (err: FailedAttemptError) => {
|
||||
this._logger.warn(
|
||||
err,
|
||||
`Task error "${this.nameForHuman}" failed attempt ${
|
||||
err.attemptNumber
|
||||
}${input ? ': ' + JSON.stringify(input) : ''}`
|
||||
}${input ? ': ' + JSON.stringify(input) : ''}`,
|
||||
err
|
||||
)
|
||||
|
||||
if (this._retryConfig.onFailedAttempt) {
|
||||
|
|
|
@ -104,7 +104,7 @@ export class DiffbotTool extends BaseTask<DiffbotInput, DiffbotOutput> {
|
|||
url: ctx.input!.url
|
||||
})
|
||||
|
||||
// this._logger.info(res, `Diffbot response for url "${ctx.input!.url}"`)
|
||||
// this._logger.info(`Diffbot response for url "${ctx.input!.url}"`,res)
|
||||
|
||||
const output = this.outputSchema.parse({
|
||||
type: res.type,
|
||||
|
@ -131,7 +131,7 @@ export class DiffbotTool extends BaseTask<DiffbotInput, DiffbotOutput> {
|
|||
)
|
||||
})
|
||||
|
||||
this._logger.info(output, `Diffbot response for url "${ctx.input!.url}"`)
|
||||
this._logger.info(`Diffbot response for url "${ctx.input!.url}"`, output)
|
||||
return output
|
||||
}
|
||||
}
|
||||
|
|
|
@ -100,7 +100,7 @@ export class MidjourneyImagineTool extends BaseTask<
|
|||
components: message.components
|
||||
}
|
||||
} catch (err) {
|
||||
this._logger.error(err, 'Midjourney API error')
|
||||
this._logger.error('Midjourney API error', err)
|
||||
return null
|
||||
}
|
||||
},
|
||||
|
|
|
@ -97,7 +97,7 @@ export class ReplicateStableDiffusionTool extends BaseTask<
|
|||
console.log('<<< replicate', image, output)
|
||||
return output
|
||||
} catch (err) {
|
||||
this._logger.error(err, 'Replicate API error')
|
||||
this._logger.error('Replicate API error', err)
|
||||
return []
|
||||
}
|
||||
},
|
||||
|
|
|
@ -171,7 +171,7 @@ export class SearchAndCrawlTool extends BaseTask<
|
|||
scrape_results: scrapeResults
|
||||
})
|
||||
|
||||
this._logger.info(output, `SearchAndCrawl response for query "${query}"`)
|
||||
this._logger.info(`SearchAndCrawl response for query "${query}"`, output)
|
||||
return output
|
||||
}
|
||||
}
|
||||
|
|
|
@ -122,7 +122,7 @@ export class SerpAPITool extends BaseTask<SerpAPIInput, SerpAPIOutput> {
|
|||
twitter_results: twitterResults
|
||||
})
|
||||
|
||||
this._logger.info(output, `SerpAPI response for query "${query}"`)
|
||||
this._logger.info(`SerpAPI response for query "${query}"`, output)
|
||||
return output
|
||||
}
|
||||
}
|
||||
|
|
|
@ -250,3 +250,7 @@ export function isString(value: any): value is string {
|
|||
export function isArray(value: any): value is any[] {
|
||||
return Array.isArray(value)
|
||||
}
|
||||
|
||||
export function identity<T>(x: T): T {
|
||||
return x
|
||||
}
|
||||
|
|
Ładowanie…
Reference in New Issue