2026-01-29 15:54:22 +00:00
|
|
|
import 'package:ponshu_room_lite/secrets.dart';
|
2026-01-15 15:53:44 +00:00
|
|
|
import 'dart:io';
|
|
|
|
|
|
|
|
|
|
void main() async {
|
|
|
|
|
final apiKey = Secrets.geminiApiKey;
|
|
|
|
|
// Using a model that definitely exists to get the client initialized,
|
|
|
|
|
// though listModels doesn't technically require a specific model instance usually in REST,
|
|
|
|
|
// the SDK might just use the apiKey.
|
|
|
|
|
// Actually the SDK doesn't expose listModels directly on GenerativeModel?
|
|
|
|
|
// Let's check if we can simply use the REST API via Dart's http or just try to init a model and query.
|
|
|
|
|
// Wait, the google_generative_ai package usually doesn't have a static listModels method exposed easily in top level?
|
|
|
|
|
// Let's check source code if possible, or just use curl.
|
|
|
|
|
// Using curl via Process.run is easier/safer if I don't want to depend on package imports that might fail.
|
|
|
|
|
|
|
|
|
|
print("Checking models via curl...");
|
|
|
|
|
|
|
|
|
|
final result = await Process.run('curl', [
|
|
|
|
|
'-s',
|
|
|
|
|
'https://generativelanguage.googleapis.com/v1beta/models?key=$apiKey'
|
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
print(result.stdout);
|
|
|
|
|
print(result.stderr);
|
|
|
|
|
}
|