Azzeccagarbugli / openai_client

An unofficial, platform independent, client for accessing different AI models developed by OpenAI
https://pub.dev/packages/openai_client
BSD 3-Clause "New" or "Revised" License
38 stars 15 forks source link

Usage.fromMap fails on `completions` property #5

Open tomtaila opened 1 year ago

tomtaila commented 1 year ago

I get the following when requesting some completions:

error: type 'Null' is not a subtype of type 'int' in type cast, stacktrace: #0 new Usage.fromMap (package:openai_client/src/model/shared_models/usage.dart:17:53)

I imagine it happens when no results are generated by openAI

Azzeccagarbugli commented 1 year ago

Hello @tomtaila, would you be able to reproduce the error and share the code snippet? Thanks a lot in advance!