mirror of
https://github.com/foss42/apidash.git
synced 2025-12-03 19:39:25 +08:00
fixes
This commit is contained in:
@@ -1,20 +1,26 @@
|
||||
import 'dart:async';
|
||||
import 'dart:convert';
|
||||
|
||||
import 'dart:io' show Platform;
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:genai/models/ai_request_model.dart';
|
||||
import 'package:genai/interface/consts.dart';
|
||||
import 'package:genai/utils/ai_request_utils.dart';
|
||||
import 'package:better_networking/better_networking.dart';
|
||||
|
||||
const kTestingAPIKey = "XXXXXXXXXXXX";
|
||||
const kGeminiApiKey = 'GEMINI_API_KEY';
|
||||
|
||||
void main() {
|
||||
group('ai_request_utils', () {
|
||||
test(
|
||||
'executeGenAIRequest should return formatted output on success',
|
||||
() async {
|
||||
const model = AIRequestModel(
|
||||
Map<String, String> envVars = Platform.environment;
|
||||
String? kTestingAPIKey;
|
||||
if (envVars.containsKey(kGeminiApiKey)) {
|
||||
kTestingAPIKey = envVars[kGeminiApiKey];
|
||||
} else {
|
||||
throw ArgumentError(
|
||||
'$kGeminiApiKey should be available as an environment variable.',
|
||||
);
|
||||
}
|
||||
var model = AIRequestModel(
|
||||
modelApiProvider: ModelAPIProvider.gemini,
|
||||
model: 'gemini-2.0-flash',
|
||||
url: kGeminiUrl,
|
||||
|
||||
Reference in New Issue
Block a user