joone / loz

Loz is a command-line tool that enables your preferred LLM to execute system commands and utilize Unix pipes, integrating AI capabilities with other Unix tools.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Json deprecated error

philogone opened this issue · comments

Hi,

I have an error when I try tu use loz.

I have credited my openai account and add my secret key on OPEN_API_KEY variable in ~/.bashrc

Do you know it ? And How can I resolve it ?

Thank you guys,

Have a nice day

[rocky@vps-2e132936 ~]$ loz
Loz: a simple ChatGTP CLI tool
  mode: default
> Hi how are you ?
Could not JSON parse stream message {"warning":"This model version is deprecated. Migrate before January 4, 2024 to avoid disruption of service. Learn more https://platform.openai.com/docs/deprecations","id":"cmpl-8DSaopsZo1qXhxCwbggi2GiRhFdaC","ob SyntaxError: Unterminated string in JSON at position 212
    at JSON.parse (<anonymous>)
    at IncomingMessage.<anonymous> (/home/rocky/loz/dist/index.js:250:49)
    at IncomingMessage.emit (node:events:514:28)at Readable.read (node:internal/streams/readable:590:10)
    at flow (node:internal/streams/readable:1072:34)
    at resume_ (node:internal/streams/readable:1053:3)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)

[rocky@vps ~]$ node -v
v20.9.0
[rocky@vps ~]$ npm version
{
npm: '10.1.0',
node: '20.9.0',
acorn: '8.10.0',
ada: '2.6.0',
ares: '1.19.1',
base64: '0.5.0',
brotli: '1.0.9',
cjs_module_lexer: '1.2.2',
cldr: '43.1',
icu: '73.2',
llhttp: '8.1.1',
modules: '115',
napi: '9',
nghttp2: '1.57.0',
nghttp3: '0.7.0',
ngtcp2: '0.8.1',
openssl: '3.0.10+quic',
simdutf: '3.2.17',
tz: '2023c',
undici: '5.26.3',
unicode: '15.0',
uv: '1.46.0',
uvwasi: '0.0.18',
v8: '11.3.244.8-node.16',
zlib: '1.2.13.1-motley'
}
[rocky@vps ~]$ npx -v
10.1.0

The OpenAI API has been updated, so I need to stay updated with the changes.

Can you try this with the recent version?

This issue should have been resolved in the current version. Please try again.