You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
try {
final bytes = await _selectedImage!.readAsBytes();
Gemini.instance.textAndImage(
text: 'Analyze this image and describe its content.',
images: [bytes],
).then((response) {
final parts = response?.content?.parts;
final lastText = parts ?? 'No text content found';
setState(() {
_response = lastText.toString();
});
}).catchError((error) {
setState(() {
_response = 'Error: $error';
});
});
} catch (e) {
setState(() {
_response = 'Error: $e';
});
}
}
i tried using that final lastText = parts ?? 'No text content found';.......parts.text but also there is error saying in text ........now only i am getting response as instance of textPart.....how to solve this problem
The text was updated successfully, but these errors were encountered:
i am not getting response from for image only getting instance of image part
Future _processImage() async {
if (_selectedImage == null) {
setState(() {
_response = 'No image selected';
});
return;
}
}
i tried using that final lastText = parts ?? 'No text content found';.......parts.text but also there is error saying in text ........now only i am getting response as instance of textPart.....how to solve this problem
The text was updated successfully, but these errors were encountered: