Skip to content

Commit b165642

Browse files
authored
Upgrade primitives. (#681)
1 parent 86826e8 commit b165642

File tree

6 files changed

+18
-53
lines changed

6 files changed

+18
-53
lines changed

packages/genui/lib/src/model/parts.dart

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,13 @@
55
import 'package:genai_primitives/genai_primitives.dart';
66

77
import 'parts/image.dart';
8-
import 'parts/thinking.dart';
98
import 'parts/ui.dart';
109
export 'parts/image.dart';
11-
export 'parts/thinking.dart';
1210
export 'parts/ui.dart';
1311

1412
final _genuiPartConverterRegistry = <String, JsonToPartConverter>{
1513
ImagePart.type: const PartConverter(ImagePart.fromJson),
16-
ThinkingPart.type: const PartConverter(ThinkingPart.fromJson),
14+
UiInteractionPart.type: const PartConverter(UiInteractionPart.fromJson),
1715
UiPart.type: const PartConverter(UiPart.fromJson),
1816
...defaultPartConverterRegistry,
1917
};

packages/genui/lib/src/model/parts/image.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ final class _Json {
1717
/// An image part of a message.
1818
///
1919
/// Use the factory constructors to create an instance from different sources.
20-
final class ImagePart extends Part {
20+
final class ImagePart extends BasePart {
2121
static const String type = 'Image';
2222

2323
/// The raw image bytes. May be null if created from a URL or Base64.
@@ -81,7 +81,7 @@ final class ImagePart extends Part {
8181

8282
@override
8383
Map<String, Object?> toJson() => {
84-
Part.typeKey: type,
84+
BasePart.typeKey: type,
8585
_Json.mimeType: mimeType,
8686
if (bytes != null) _Json.bytes: bytes,
8787
if (base64 != null) _Json.base64: base64,

packages/genui/lib/src/model/parts/thinking.dart

Lines changed: 0 additions & 33 deletions
This file was deleted.

packages/genui/lib/src/model/parts/ui.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ final class _Json {
1515

1616
/// A part representing a UI definition to be rendered.
1717
@immutable
18-
final class UiPart extends Part {
18+
final class UiPart extends BasePart {
1919
static const type = 'Ui';
2020

2121
/// Creates a UI part.
@@ -44,7 +44,7 @@ final class UiPart extends Part {
4444

4545
@override
4646
Map<String, Object?> toJson() => {
47-
Part.typeKey: type,
47+
BasePart.typeKey: type,
4848
_Json.definition: definition.toJson(),
4949
_Json.surfaceId: surfaceId,
5050
};
@@ -64,7 +64,7 @@ final class UiPart extends Part {
6464

6565
/// A part representing a user's interaction with the UI.
6666
@immutable
67-
final class UiInteractionPart extends Part {
67+
final class UiInteractionPart extends BasePart {
6868
static const type = 'UiInteraction';
6969

7070
/// Creates a UI interaction part.
@@ -80,7 +80,7 @@ final class UiInteractionPart extends Part {
8080

8181
@override
8282
Map<String, Object?> toJson() => {
83-
Part.typeKey: type,
83+
BasePart.typeKey: type,
8484
_Json.interaction: interaction,
8585
};
8686

packages/genui/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ dependencies:
2020
flutter:
2121
sdk: flutter
2222
flutter_markdown_plus: ^1.0.5
23-
genai_primitives: ^0.0.1
23+
genai_primitives: ^0.1.0
2424
json_schema_builder: ^0.1.3
2525
logging: ^1.3.0
2626
uuid: ^4.4.0

pubspec.lock

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -510,10 +510,10 @@ packages:
510510
dependency: transitive
511511
description:
512512
name: genai_primitives
513-
sha256: "7da60e57e19ae01dc19db59d6606f441d4cc583182ba9b545040c12917b44a8e"
513+
sha256: ba124b46438fc068d0f1a545898ded0edf0f10cac4357edf5a136320881388a7
514514
url: "https://pub.dev"
515515
source: hosted
516-
version: "0.0.1"
516+
version: "0.1.0"
517517
glob:
518518
dependency: transitive
519519
description:
@@ -819,10 +819,10 @@ packages:
819819
dependency: transitive
820820
description:
821821
name: meta
822-
sha256: "1741988757a65eb6b36abe716829688cf01910bbf91c34354ff7ec1c3de2b349"
822+
sha256: "23f08335362185a5ea2ad3a4e597f1375e78bce8a040df5c600c8d3552ef2394"
823823
url: "https://pub.dev"
824824
source: hosted
825-
version: "1.18.0"
825+
version: "1.17.0"
826826
mime:
827827
dependency: transitive
828828
description:
@@ -1208,26 +1208,26 @@ packages:
12081208
dependency: transitive
12091209
description:
12101210
name: test
1211-
sha256: "54c516bbb7cee2754d327ad4fca637f78abfc3cbcc5ace83b3eda117e42cd71a"
1211+
sha256: "77cc98ea27006c84e71a7356cf3daf9ddbde2d91d84f77dbfe64cf0e4d9611ae"
12121212
url: "https://pub.dev"
12131213
source: hosted
1214-
version: "1.29.0"
1214+
version: "1.28.0"
12151215
test_api:
12161216
dependency: transitive
12171217
description:
12181218
name: test_api
1219-
sha256: "93167629bfc610f71560ab9312acdda4959de4df6fac7492c89ff0d3886f6636"
1219+
sha256: "19a78f63e83d3a61f00826d09bc2f60e191bf3504183c001262be6ac75589fb8"
12201220
url: "https://pub.dev"
12211221
source: hosted
1222-
version: "0.7.9"
1222+
version: "0.7.8"
12231223
test_core:
12241224
dependency: transitive
12251225
description:
12261226
name: test_core
1227-
sha256: "394f07d21f0f2255ec9e3989f21e54d3c7dc0e6e9dbce160e5a9c1a6be0e2943"
1227+
sha256: f1072617a6657e5fc09662e721307f7fb009b4ed89b19f47175d11d5254a62d4
12281228
url: "https://pub.dev"
12291229
source: hosted
1230-
version: "0.6.15"
1230+
version: "0.6.14"
12311231
tuple:
12321232
dependency: transitive
12331233
description:

0 commit comments

Comments
 (0)