mirror of
https://github.com/foss42/apidash.git
synced 2025-12-07 05:31:44 +08:00
33 lines
789 B
Dart
33 lines
789 B
Dart
import 'package:apidash/templates/templates.dart';
|
|
import 'package:apidash_core/apidash_core.dart';
|
|
|
|
class APIToolFunctionGenerator extends AIAgent {
|
|
@override
|
|
String get agentName => 'APITOOL_FUNCGEN';
|
|
|
|
@override
|
|
String getSystemPrompt() {
|
|
return kPromptAPIToolFuncGen;
|
|
}
|
|
|
|
@override
|
|
Future<bool> validator(String aiResponse) async {
|
|
//Add any specific validations here as needed
|
|
return true;
|
|
}
|
|
|
|
@override
|
|
Future outputFormatter(String validatedResponse) async {
|
|
validatedResponse = validatedResponse
|
|
.replaceAll('```python', '')
|
|
.replaceAll('```python\n', '')
|
|
.replaceAll('```javascript', '')
|
|
.replaceAll('```javascript\n', '')
|
|
.replaceAll('```', '');
|
|
|
|
return {
|
|
'FUNC': validatedResponse,
|
|
};
|
|
}
|
|
}
|