From 2f785a55bf48ae38b12aed22c7aac18bb66f9328 Mon Sep 17 00:00:00 2001 From: David Miguel Date: Tue, 14 May 2024 14:12:10 +0200 Subject: [PATCH 1/2] Fix Schema.number and Schema.integer factories ignoring format field --- pkgs/google_generative_ai/lib/src/function_calling.dart | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/google_generative_ai/lib/src/function_calling.dart b/pkgs/google_generative_ai/lib/src/function_calling.dart index c643cd3..a82cebf 100644 --- a/pkgs/google_generative_ai/lib/src/function_calling.dart +++ b/pkgs/google_generative_ai/lib/src/function_calling.dart @@ -211,6 +211,7 @@ final class Schema { SchemaType.number, description: description, nullable: nullable, + format: format, ); /// Construct a schema for an integer number. @@ -224,6 +225,7 @@ final class Schema { SchemaType.integer, description: description, nullable: nullable, + format: format, ); /// Construct a schema for bool value. From bf897cec4f09b9b3541461fdd19b90bb47736847 Mon Sep 17 00:00:00 2001 From: Nate Bosch Date: Tue, 14 May 2024 17:54:12 +0000 Subject: [PATCH 2/2] Add changelog --- pkgs/google_generative_ai/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/google_generative_ai/CHANGELOG.md b/pkgs/google_generative_ai/CHANGELOG.md index 9c6fcbb..5990962 100644 --- a/pkgs/google_generative_ai/CHANGELOG.md +++ b/pkgs/google_generative_ai/CHANGELOG.md @@ -2,6 +2,7 @@ - Concatenate multiple `TextPart` into the `text` String in case the model replies with more than one part. +- Fix handling of `format` argument to `Schema.number` and `Schema.integer`. ## 0.4.0