diff --git a/pkgs/google_generative_ai/test/generative_model_test.dart b/pkgs/google_generative_ai/test/generative_model_test.dart index 1e69053..3a58b3b 100644 --- a/pkgs/google_generative_ai/test/generative_model_test.dart +++ b/pkgs/google_generative_ai/test/generative_model_test.dart @@ -99,6 +99,7 @@ void main() { ), ); expect(request, { + 'model': 'models/$defaultModelName', 'contents': [ { 'role': 'user', @@ -311,6 +312,7 @@ void main() { ), ); expect(request, { + 'model': 'models/$defaultModelName', 'contents': [ { 'role': 'user', @@ -415,14 +417,17 @@ void main() { ), ); expect(request, { - 'contents': [ - { - 'role': 'user', - 'parts': [ - {'text': prompt}, - ], - }, - ], + 'generateContentRequest': { + 'model': 'models/$defaultModelName', + 'contents': [ + { + 'role': 'user', + 'parts': [ + {'text': prompt}, + ], + }, + ], + } }); }, response: {'totalTokens': 2}, @@ -460,7 +465,9 @@ void main() { ), ), ), - verifyRequest: (_, request) { + verifyRequest: (_, countTokensRequest) { + final request = countTokensRequest['generateContentRequest'] + as Map; expect(request['safetySettings'], [ { 'category': 'HARM_CATEGORY_DANGEROUS_CONTENT',