Every gate in this repo compares a client to the document, and every build proves the client is well-formed. Neither answers the question a user actually has: does it work against a server. Seven languages now answer it -- go, python, typescript, dart, php, ruby, rust -- against the local cloud by default and against anything HANZO_BASE_URL names. Each probe asserts a 200 whose body decodes AND a 403 that arrives as an error, because a client that swallows a refusal and returns a zero value looks exactly like one that works. It earned its place on the first run: GET /v1/models is AiAPI.GetModels in Go and ai_api::get_models in Rust but ModelsApi.getModels in TypeScript. One document, three groupings, and nothing but a call finds it.
25 lines
752 B
Dart
25 lines
752 B
Dart
import 'dart:io';
|
|
import 'package:hanzoai/hanzoai.dart';
|
|
|
|
Future<void> main() async {
|
|
final base = Platform.environment['HANZO_BASE_URL']!;
|
|
final client = ApiClient(basePath: base);
|
|
var fail = 0;
|
|
try {
|
|
final r = await AiApi(client).getModelsWithHttpInfo();
|
|
print(' ok GET /v1/models ${r.statusCode}');
|
|
} catch (e) {
|
|
print(' FAIL models: $e'); fail++;
|
|
}
|
|
try {
|
|
await EngineApi(client).engineStatus();
|
|
print(' FAIL engine: unauthenticated call reported success'); fail++;
|
|
} on ApiException catch (e) {
|
|
print(' ok GET /v1/engine/status refused: ${e.code}');
|
|
} catch (e) {
|
|
print(' ok refused: ${e.runtimeType}');
|
|
}
|
|
print(fail == 0 ? 'PASS dart' : 'FAIL dart ($fail)');
|
|
exit(fail == 0 ? 0 : 1);
|
|
}
|