REFACTOR: moved agent_utils -> apidash_agent_calls

This commit is contained in:
Manas Hejmadi
2025-08-31 16:38:52 +05:30
parent a8444852b8
commit 94c38d398c
5 changed files with 35 additions and 40 deletions

View File

@@ -1,6 +1,6 @@
import 'package:apidash/consts.dart'; import 'package:apidash/consts.dart';
import 'package:apidash/providers/collection_providers.dart'; import 'package:apidash/providers/collection_providers.dart';
import 'package:apidash/utils/agent_utils.dart'; import 'package:apidash/services/agentic_services/apidash_agent_calls.dart';
import 'package:apidash/widgets/widget_sending.dart'; import 'package:apidash/widgets/widget_sending.dart';
import 'package:apidash_design_system/apidash_design_system.dart'; import 'package:apidash_design_system/apidash_design_system.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';

View File

@@ -1,9 +1,7 @@
import 'dart:convert';
import 'package:apidash/apitoolgen/request_consolidator.dart'; import 'package:apidash/apitoolgen/request_consolidator.dart';
import 'package:apidash/providers/collection_providers.dart'; import 'package:apidash/providers/collection_providers.dart';
import 'package:apidash/screens/common_widgets/agentic_ui_features/ai_ui_designer/generate_ui_dialog.dart'; import 'package:apidash/screens/common_widgets/agentic_ui_features/ai_ui_designer/generate_ui_dialog.dart';
import 'package:apidash/utils/agent_utils.dart'; import 'package:apidash/services/agentic_services/apidash_agent_calls.dart';
import 'package:apidash_core/apidash_core.dart'; import 'package:apidash_core/apidash_core.dart';
import 'package:apidash_design_system/apidash_design_system.dart'; import 'package:apidash_design_system/apidash_design_system.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';

View File

@@ -1,5 +1,5 @@
const String kPromptAPIToolBodyGen = """ const String kPromptAPIToolBodyGen = """
YOu are an expert API Tool Format Corrector Agent You are an expert API Tool Format Corrector Agent
An API tool is a predefined or dynamically generated interface that the AI can call to perform specific external actions—such as fetching data, executing computations, or triggering real-world services—through an Application Programming Interface (API). An API tool is a predefined or dynamically generated interface that the AI can call to perform specific external actions—such as fetching data, executing computations, or triggering real-world services—through an Application Programming Interface (API).
@@ -11,7 +11,7 @@ Wherever you find this pattern replace it with the appropriate values)
`TOOL_NAME`: The name of the API Tool, infer it from the function code `TOOL_NAME`: The name of the API Tool, infer it from the function code
`TOOL_DESCRIPTION`: The Description of the Tool, generate it based on the tool name `TOOL_DESCRIPTION`: The Description of the Tool, generate it based on the tool name
`TOOL_PARAMS`: The example of parameters have been provided below, infer the parameters needed from the func body, it must be a dictionary `TOOL_PARAMS`: The example of parameters have been provided below, infer the parameters needed from the func body, it must be a dictionary
`REQUIRED_PARAM_NAMES`: infer waht parameters are required and add thier names in a list `REQUIRED_PARAM_NAMES`: infer what parameters are required and add thier names in a list
`INPUT_SCHEMA`: if this variable exists, then create a StructuredTool or DynamicStructuredTool schema of the input according to the language of the tool itself. `INPUT_SCHEMA`: if this variable exists, then create a StructuredTool or DynamicStructuredTool schema of the input according to the language of the tool itself.
this is the general format of parameters: this is the general format of parameters:

View File

@@ -1,3 +1,4 @@
import 'package:apidash/consts.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:apidash_design_system/apidash_design_system.dart'; import 'package:apidash_design_system/apidash_design_system.dart';
import 'package:apidash/utils/utils.dart'; import 'package:apidash/utils/utils.dart';
@@ -23,43 +24,39 @@ class ResponsePaneHeader extends StatelessWidget {
return Padding( return Padding(
padding: kPv8, padding: kPv8,
child: SizedBox( child: SizedBox(
// height: kHeaderHeight, height: kHeaderHeight,
child: Column( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Row( kHSpacer10,
mainAxisAlignment: MainAxisAlignment.spaceBetween, Expanded(
children: [ child: Text(
kHSpacer10, "$responseStatus: ${message ?? '-'}",
Expanded( softWrap: false,
child: Text( overflow: TextOverflow.ellipsis,
"$responseStatus: ${message ?? '-'}", style: Theme.of(context).textTheme.bodyMedium?.copyWith(
softWrap: false, fontFamily: kCodeStyle.fontFamily,
overflow: TextOverflow.ellipsis, color: getResponseStatusCodeColor(
style: Theme.of(context).textTheme.bodyMedium?.copyWith( responseStatus,
fontFamily: kCodeStyle.fontFamily, brightness: Theme.of(context).brightness,
color: getResponseStatusCodeColor(
responseStatus,
brightness: Theme.of(context).brightness,
),
),
),
),
kHSpacer10,
Text(
humanizeDuration(time),
style: Theme.of(context).textTheme.bodyMedium?.copyWith(
fontFamily: kCodeStyle.fontFamily,
color: Theme.of(context).colorScheme.secondary,
), ),
), ),
kHSpacer10, ),
showClearButton
? ClearResponseButton(
onPressed: onClearResponse,
)
: const SizedBox.shrink(),
],
), ),
kHSpacer10,
Text(
humanizeDuration(time),
style: Theme.of(context).textTheme.bodyMedium?.copyWith(
fontFamily: kCodeStyle.fontFamily,
color: Theme.of(context).colorScheme.secondary,
),
),
kHSpacer10,
showClearButton
? ClearResponseButton(
onPressed: onClearResponse,
)
: const SizedBox.shrink(),
], ],
), ),
), ),