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 parsing issue - Ubuntu

eflow-eas3 opened this issue · comments

It seems that you are using a deprecated feature ( https://platform.openai.com/docs/deprecations)
Each time I write an input, I have this kind of error :

`

Hi
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-81FNe1Z62tcPM1c3sYJnKekt3HCJT","object":"text_complet SyntaxError: Unexpected end of JSON input
at JSON.parse ()
at IncomingMessage. (/usr/local/lib/node_modules/loz/dist/index.js:250:49)
at IncomingMessage.emit (events.js:314:20)
at IncomingMessage.Readable.read (_stream_readable.js:507:10)
at flow (stream_readable.js:1007:34)
at resume
(_stream_readable.js:988:3)
at processTicksAndRejections (internal/process/task_queues.js:84:21)
Could not JSON parse stream message ion","created":1695308142,"choices":[{"text":"\n","index":0,"logprobs":null,"finish_reason":null}],"model":"text-davinci-003"} SyntaxError: Unexpected token i in JSON at position 0
at JSON.parse ()
at IncomingMessage. (/usr/local/lib/node_modules/loz/dist/index.js:250:49)
at IncomingMessage.emit (events.js:314:20)
at addChunk (_stream_readable.js:297:12)
at readableAddChunk (_stream_readable.js:272:9)
at IncomingMessage.Readable.push (_stream_readable.js:213:10)
at HTTPParser.parserOnBody (_http_common.js:135:24)
at TLSSocket.socketOnData (_http_client.js:474:22)
at TLSSocket.emit (events.js:314:20)
at addChunk (_stream_readable.js:297:12)
`

BTW, it should be nice to be able to select the model we want.

I updated Loz to accommodate the latest OpenAPI updates.