mirror of
https://github.com/foss42/apidash.git
synced 2025-12-02 02:39:19 +08:00
19 lines
469 B
Dart
19 lines
469 B
Dart
abstract class AIAgent {
|
|
String get agentName;
|
|
String getSystemPrompt();
|
|
Future<bool> validator(String aiResponse);
|
|
Future<dynamic> outputFormatter(String validatedResponse);
|
|
}
|
|
|
|
extension SystemPromptTemplating on String {
|
|
String substitutePromptVariable(String variable, String value) {
|
|
return this.replaceAll(":$variable:", value);
|
|
}
|
|
}
|
|
|
|
class AgentInputs {
|
|
final String? query;
|
|
final Map? variables;
|
|
AgentInputs({this.query, this.variables});
|
|
}
|