to call the Google AI Gemini API directly from your app is recommended for prototyping only. → 商用では非推奨なので使えない…。API Keyを管理するためのバックエンドを構築がめんどくさい…。 import 'package:google_generative_ai/google_generative_ai.dart'; const apiKey = ...; void main() async { final model = GenerativeModel( model: 'gemini-1.5-flash-latest', apiKey: apiKey, ); final prompt = 'Write a story about a magic backpack.'; final content = [Content.text(prompt)]; final response = await model.generateContent(content); }; KDDI Agile Development Center Corporation KDDIアジャイル開発センター株式会社 4
as a Service) Bedrock: 生成AIサービス amplify/ data/ calorieCalculation.ts Lambda関数の定義 resource.ts スキーマの定義 backend.ts バックエンドの定義 KDDI Agile Development Center Corporation KDDIアジャイル開発センター株式会社 12
analysis expert capable of estimating the calories of any dish shown in an image." { type: "image", source: {type: "base64", media_type: "image/jpeg", data: base64String} } { type: "text", text: `Estimate calories of the food in this image. Use JSON format with "food" (dish name in Japanese) and "calorie" (in kcal) as keys. Do not output anything other than JSON. <example> { "food": "寿司", "calorie": 300 } </example>` } KDDI Agile Development Center Corporation KDDIアジャイル開発センター株式会社 14