mirror of
https://github.com/foss42/apidash.git
synced 2025-12-01 10:17:47 +08:00
lint fixes
This commit is contained in:
@@ -1,3 +1,5 @@
|
|||||||
|
// ignore_for_file: use_key_in_widget_constructors, use_full_hex_values_for_flutter_colors
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
// ignore_for_file: use_key_in_widget_constructors
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
import 'package:apidash/templates/templates.dart';
|
import 'package:apidash/templates/templates.dart';
|
||||||
import 'package:apidash_core/apidash_core.dart';
|
import 'package:apidash_core/apidash_core.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
class StacGenBot extends AIAgent {
|
class StacGenBot extends AIAgent {
|
||||||
@override
|
@override
|
||||||
@@ -18,7 +19,7 @@ class StacGenBot extends AIAgent {
|
|||||||
try {
|
try {
|
||||||
jsonDecode(aiResponse);
|
jsonDecode(aiResponse);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print("JSON PARSE ERROR: ${e}");
|
debugPrint("JSON PARSE ERROR: $e");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
import 'package:apidash/templates/templates.dart';
|
import 'package:apidash/templates/templates.dart';
|
||||||
import 'package:apidash_core/apidash_core.dart';
|
import 'package:apidash_core/apidash_core.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
class StacModifierBot extends AIAgent {
|
class StacModifierBot extends AIAgent {
|
||||||
@override
|
@override
|
||||||
@@ -18,7 +19,7 @@ class StacModifierBot extends AIAgent {
|
|||||||
try {
|
try {
|
||||||
jsonDecode(aiResponse);
|
jsonDecode(aiResponse);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print("JSON PARSE ERROR: ${e}");
|
debugPrint("JSON PARSE ERROR: $e");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import 'package:apidash/services/agentic_services/agent_caller.dart';
|
|||||||
import 'package:apidash/services/agentic_services/agents/agents.dart';
|
import 'package:apidash/services/agentic_services/agents/agents.dart';
|
||||||
import 'package:apidash/templates/tool_templates.dart';
|
import 'package:apidash/templates/tool_templates.dart';
|
||||||
import 'package:apidash_core/apidash_core.dart';
|
import 'package:apidash_core/apidash_core.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||||
|
|
||||||
Future<String?> generateSDUICodeFromResponse({
|
Future<String?> generateSDUICodeFromResponse({
|
||||||
@@ -22,23 +23,23 @@ Future<String?> generateSDUICodeFromResponse({
|
|||||||
}),
|
}),
|
||||||
),
|
),
|
||||||
]);
|
]);
|
||||||
final SA = step1Res[0]?['SEMANTIC_ANALYSIS'];
|
final sa = step1Res[0]?['SEMANTIC_ANALYSIS'];
|
||||||
final IR = step1Res[1]?['INTERMEDIATE_REPRESENTATION'];
|
final ir = step1Res[1]?['INTERMEDIATE_REPRESENTATION'];
|
||||||
|
|
||||||
if (SA == null || IR == null) {
|
if (sa == null || ir == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
print("Semantic Analysis: $SA");
|
debugPrint("Semantic Analysis: $sa");
|
||||||
print("Intermediate Representation: $IR");
|
debugPrint("Intermediate Representation: $ir");
|
||||||
|
|
||||||
final sduiCode = await APIDashAgentCaller.instance.call(
|
final sduiCode = await APIDashAgentCaller.instance.call(
|
||||||
StacGenBot(),
|
StacGenBot(),
|
||||||
ref: ref,
|
ref: ref,
|
||||||
input: AgentInputs(variables: {
|
input: AgentInputs(variables: {
|
||||||
'VAR_RAW_API_RESPONSE': apiResponse,
|
'VAR_RAW_API_RESPONSE': apiResponse,
|
||||||
'VAR_INTERMEDIATE_REPR': IR,
|
'VAR_INTERMEDIATE_REPR': ir,
|
||||||
'VAR_SEMANTIC_ANALYSIS': SA,
|
'VAR_SEMANTIC_ANALYSIS': sa,
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
final stacCode = sduiCode?['STAC']?.toString();
|
final stacCode = sduiCode?['STAC']?.toString();
|
||||||
@@ -62,8 +63,8 @@ Future<String?> modifySDUICodeUsingPrompt({
|
|||||||
'VAR_CLIENT_REQUEST': modificationRequest,
|
'VAR_CLIENT_REQUEST': modificationRequest,
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
final SDUI = res?['STAC'];
|
final sdui = res?['STAC'];
|
||||||
return SDUI;
|
return sdui;
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<String?> generateAPIToolUsingRequestData({
|
Future<String?> generateAPIToolUsingRequestData({
|
||||||
|
|||||||
Reference in New Issue
Block a user