mirror of
https://github.com/foss42/apidash.git
synced 2025-12-01 10:17:47 +08:00
Agentic Calls corrected to comply with new Architecture
This commit is contained in:
@@ -7,7 +7,7 @@ import 'package:genai/genai.dart';
|
||||
class APIDashAgentCaller {
|
||||
static APIDashAgentCaller instance = APIDashAgentCaller();
|
||||
|
||||
Future<(String? output, String error)> call(
|
||||
Future<dynamic> call(
|
||||
APIDashAIAgent agent, {
|
||||
required WidgetRef ref,
|
||||
required AgentInputs input,
|
||||
@@ -15,7 +15,7 @@ class APIDashAgentCaller {
|
||||
final defaultAIModel =
|
||||
ref.read(settingsProvider.select((e) => e.defaultAIModel));
|
||||
if (defaultAIModel == null) {
|
||||
return (null, 'NO_DEFAULT_LLM');
|
||||
throw Exception('NO_DEFAULT_LLM');
|
||||
}
|
||||
final baseAIRequestObject = AIRequestModel.fromJson(defaultAIModel);
|
||||
final ans = await GenAIAgenticService.callAgent(
|
||||
|
||||
5
lib/services/agentic_services/agents/agents.dart
Normal file
5
lib/services/agentic_services/agents/agents.dart
Normal file
@@ -0,0 +1,5 @@
|
||||
export 'intermediate_rep_gen.dart';
|
||||
export 'semantic_analyser.dart';
|
||||
export 'stac2flutter.dart';
|
||||
export 'stacgen.dart';
|
||||
export 'stacmodifier.dart';
|
||||
@@ -1,6 +1,6 @@
|
||||
import 'package:genai/agentic_engine/blueprint.dart';
|
||||
|
||||
const String kIntermediateRepGenSystemPrompt = """
|
||||
const String _sysprompt = """
|
||||
You are an expert at converting API Responses into a YAML schema tree.
|
||||
When you get a given JSON API Response, I want you to break it down and recombine it in the form of a YAMK UI schema.
|
||||
|
||||
@@ -45,7 +45,7 @@ class IntermediateRepresentationGen extends APIDashAIAgent {
|
||||
|
||||
@override
|
||||
String getSystemPrompt() {
|
||||
return kIntermediateRepGenSystemPrompt;
|
||||
return _sysprompt;
|
||||
}
|
||||
|
||||
@override
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import 'package:genai/agentic_engine/blueprint.dart';
|
||||
|
||||
const String kSemanticAnalyserSystemPrompt = """
|
||||
const String _sysprompt = """
|
||||
You are an expert at understanding API response structures.
|
||||
When i provide a sample JSON response, Please give me a semantic analysis about it.
|
||||
|
||||
@@ -20,7 +20,7 @@ class ResponseSemanticAnalyser extends APIDashAIAgent {
|
||||
|
||||
@override
|
||||
String getSystemPrompt() {
|
||||
return kSemanticAnalyserSystemPrompt;
|
||||
return _sysprompt;
|
||||
}
|
||||
|
||||
@override
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import 'package:genai/agentic_engine/blueprint.dart';
|
||||
|
||||
const String kIntermediateRepGenSystemPrompt = """
|
||||
const String _sysprompt = """
|
||||
You are an expert agent whose sole JOB is to accept FLutter-SDUI (json-like) representation
|
||||
and convert it into actual working FLutter component.
|
||||
|
||||
@@ -22,7 +22,7 @@ class StacToFlutterBot extends APIDashAIAgent {
|
||||
|
||||
@override
|
||||
String getSystemPrompt() {
|
||||
return kIntermediateRepGenSystemPrompt;
|
||||
return _sysprompt;
|
||||
}
|
||||
|
||||
@override
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import 'package:genai/agentic_engine/blueprint.dart';
|
||||
|
||||
const String kIntermediateRepGenSystemPrompt = """
|
||||
const String _sysprompt = """
|
||||
You are an expert agent whose sole JOB is to generate FLutter-SDUI (json-like) representation from a Text based description
|
||||
and a provided Schema
|
||||
|
||||
@@ -232,7 +232,7 @@ class StacGenBot extends APIDashAIAgent {
|
||||
|
||||
@override
|
||||
String getSystemPrompt() {
|
||||
return kIntermediateRepGenSystemPrompt;
|
||||
return _sysprompt;
|
||||
}
|
||||
|
||||
@override
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import 'package:genai/agentic_engine/blueprint.dart';
|
||||
|
||||
const String kIntermediateRepGenSystemPrompt = """
|
||||
const String _sysprompt = """
|
||||
You are an expert agent whose sole JOB is to accept FLutter-SDUI (json-like) representation
|
||||
and modify it to match the requests of the client.
|
||||
|
||||
@@ -21,7 +21,7 @@ class SlacModifierBot extends APIDashAIAgent {
|
||||
|
||||
@override
|
||||
String getSystemPrompt() {
|
||||
return kIntermediateRepGenSystemPrompt;
|
||||
return _sysprompt;
|
||||
}
|
||||
|
||||
@override
|
||||
|
||||
Reference in New Issue
Block a user