Skip to content

Commit

Permalink
Merge branch 'main' into vertexai/bidi
Browse files Browse the repository at this point in the history
cynthiajoan committed Jan 27, 2025
2 parents c5bb860 + 6b76260 commit 9575c5e
Showing 6 changed files with 19 additions and 21 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# https://firebase.google.com/support/release-notes/ios
def firebase_sdk_version!()
'11.6.0'
'11.7.0'
end
Original file line number Diff line number Diff line change
@@ -123,13 +123,16 @@ class _ImagePromptPageState extends State<ImagePromptPage> {
];
_generatedContent.add(
MessageData(
image: Image.asset('assets/images/cat.jpg'),
text: message,
fromUser: true),
image: Image.asset('assets/images/cat.jpg'),
text: message,
fromUser: true,
),
);
_generatedContent.add(
MessageData(
image: Image.asset('assets/images/scones.jpg'), fromUser: true),
image: Image.asset('assets/images/scones.jpg'),
fromUser: true,
),
);

var response = await widget.model.generateContent(content);
Original file line number Diff line number Diff line change
@@ -17,8 +17,11 @@ import 'package:firebase_vertexai/firebase_vertexai.dart';
import '../widgets/message_widget.dart';

class StorageUriPromptPage extends StatefulWidget {
const StorageUriPromptPage(
{super.key, required this.title, required this.model});
const StorageUriPromptPage({
super.key,
required this.title,
required this.model,
});

final String title;
final GenerativeModel model;
Original file line number Diff line number Diff line change
@@ -85,13 +85,13 @@ class _TokenCountPageState extends State<TokenCountPage> {
});

const prompt = 'tell a short story';
var content = Content.text(prompt);
var tokenResponse = await widget.model.countTokens([content]);
final content = Content.text(prompt);
final tokenResponse = await widget.model.countTokens([content]);
final tokenResult = 'Count token: ${tokenResponse.totalTokens}, billable '
'characters: ${tokenResponse.totalBillableCharacters}';
_messages.add(MessageData(text: tokenResult, fromUser: false));

var contentResponse = await widget.model.generateContent([content]);
final contentResponse = await widget.model.generateContent([content]);
final contentMetaData = 'result metadata, promptTokenCount:'
'${contentResponse.usageMetadata!.promptTokenCount}, '
'candidatesTokenCount:'
Original file line number Diff line number Diff line change
@@ -904,13 +904,8 @@ void main() {

Exception e = await getError();
expect(e, isA<FirebaseAuthException>());
// Exception code is returning internal-error but the underlying error is "identitytoolkit.getRecaptchaConfig is not implemented in the Auth Emulator."
// This issue on firebase-ios-sdk: https://github.com/firebase/firebase-ios-sdk/issues/14242. Once this is resolved, we ought to reinstate the below.
// It works fine on live project but returns internal-error on emulator.
if (defaultTargetPlatform != TargetPlatform.iOS) {
FirebaseAuthException exception = e as FirebaseAuthException;
expect(exception.code, equals('invalid-phone-number'));
}
FirebaseAuthException exception = e as FirebaseAuthException;
expect(exception.code, equals('invalid-phone-number'));
});

test(
Original file line number Diff line number Diff line change
@@ -251,10 +251,7 @@ void main() {
},
skip: kIsWeb ||
defaultTargetPlatform == TargetPlatform.macOS ||
defaultTargetPlatform == TargetPlatform.windows
// on iOS, returning an exception but underlying exception is: "identitytoolkit.getRecaptchaConfig is not implemented in the Auth Emulator."
// which might be a result of this issue: https://github.com/firebase/firebase-ios-sdk/issues/14242. Once resolved, try to reinstate.
|| defaultTargetPlatform == TargetPlatform.iOS,
defaultTargetPlatform == TargetPlatform.windows,
); // verifyPhoneNumber not supported on web.

test(

0 comments on commit 9575c5e

Please sign in to comment.