davidmigloz / langchain_dart

Build LLM-powered Dart/Flutter applications.
https://langchaindart.dev
MIT License
423 stars 74 forks source link

Could not create `ResponseStatusDetails`. #595

Open andreiavornic opened 6 days ago

andreiavornic commented 6 days ago

System Info

ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: CheckedFromJsonException Could not create ResponseStatusDetails. There is a problem with "type". Invalid union type "cancelled"!

0 _$ResponseStatusDetailsFromJson (package:openai_realtime_dart/src/schema/generated/schema/schema.freezed.dart:11526:7)

1 new ResponseStatusDetails.fromJson (package:openai_realtime_dart/src/schema/generated/schema/response_status_details.dart:52:7)

2 _$$ResponseImplFromJson (package:openai_realtime_dart/src/schema/generated/schema/schema.g.dart:139:35)

3 new _$ResponseImpl.fromJson (package:openai_realtime_dart/src/schema/generated/schema/schema.freezed.dart:1370:7)

4 _$ResponseFromJson (package:openai_realtime_dart/src/schema/generated/schema/schema.freezed.dart:1150:20)

5 new Response.fromJson (package:openai_realtime_dart/src/schema/generated/schema/response.dart:41:7)

6 _$$RealtimeEventResponseDoneImplFromJson (package:openai_realtime_dart/src/schema/generated/schema/schema.g.dart:1803:26)

7 new _$RealtimeEventResponseDoneImpl.fromJson (package:openai_realtime_dart/src/schema/generated/schema/schema.freezed.dart:45795:7)

Related Components

Reproduction

after RealtimeEventType.conversationInterrupted

Expected behavior

No errors

davidmigloz commented 6 days ago

Hey @andreiavornic ,

Are you using the latest version (v0.0.3)?

As far as I can see the current code handles cancelled already:

https://github.com/davidmigloz/langchain_dart/blob/d2723976c3f0c36c95115b4b756492e223ffe812/packages/openai_realtime_dart/lib/src/schema/generated/schema/response_status_details.dart#L22-L36