cequence-io / openai-scala-client

Scala client for OpenAI API
MIT License
191 stars 20 forks source link

JSON response error due to changes in the OpenAI API #48

Closed Jazzpirate closed 10 months ago

Jazzpirate commented 11 months ago

On trying to retrieve the gpt-3.5-turbo model, I get an error message:

Exception in thread "main" io.cequence.openaiscala.OpenAIScalaClientException: Error thrown while processing a JSON '{"id":"gpt-3.5-turbo","object":"model","created":1677610602,"owned_by":"openai"}'. Cause: Unexpected JSON

Indeed, it looks like they changed the API to respond with fewer fields, see e.g. https://community.openai.com/t/missing-permission-inside-model-response/470014

Is there some way to circumvent the JSON validation until a new version of the library is pushed to maven?

peterbanda commented 10 months ago

Hay @Jazzpirate , this has been changed/fixed some time ago. Check out an example here: https://github.com/cequence-io/openai-scala-client/blob/master/openai-examples/src/main/scala/io/cequence/openaiscala/examples/RetrieveModel.scala

I will make a release this week.

peterbanda commented 10 months ago

Just released the version 1.0.0.RC.1. Enjoy!

Jazzpirate commented 10 months ago

Thanks a lot :)