copilot 0.1.12
copilot: ^0.1.12 copied to clipboard
101GenAI copilots
example/copilot_example.dart
import 'dart:io';
import 'package:copilot/copilot.dart';
import 'package:mime/mime.dart';
void main() {
// Create 101GenAI Api Client
var apiClient = OOOGenAIAPIService();
// Use the locally stored file for testing
String filename = 'example_wound.png';
var file = File('./example/assets/$filename');
String? mimetype = lookupMimeType(file.path);
apiClient
.postImage(
'https://woundcare-demo.101gen.ai/api',
200.0, 100.0, 300,
filename,
(mimetype != null) ? mimetype : 'image/png',
file.readAsBytesSync(),
"A pain that's not going away")
.then((value) => {
print('images: ${value.images.length}, \n'
'annotations: ${value.annotations.length}, \n'
'categories: ${value.categories.length}')
});
}