mirror of
https://github.com/foss42/apidash.git
synced 2025-07-01 13:37:54 +08:00
Merge branch 'main' of https://github.com/siddu015/apidash
This commit is contained in:
@ -55,9 +55,6 @@ class ResponseDetails extends ConsumerWidget {
|
||||
final responseModel = ref.watch(selectedRequestModelProvider
|
||||
.select((value) => value?.httpResponseModel));
|
||||
|
||||
final requestModel = ref.watch(selectedRequestModelProvider);
|
||||
final ollamaService = ref.watch(ollamaServiceProvider);
|
||||
|
||||
return Column(
|
||||
children: [
|
||||
ResponsePaneHeader(
|
||||
@ -71,42 +68,6 @@ class ResponseDetails extends ConsumerWidget {
|
||||
const Expanded(
|
||||
child: ResponseTabs(),
|
||||
),
|
||||
if (requestModel != null && responseModel != null)
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: ElevatedButton(
|
||||
onPressed: () async {
|
||||
try {
|
||||
final explanation = await ollamaService.explainLatestApi(
|
||||
requestModel: requestModel,
|
||||
responseModel: responseModel,
|
||||
);
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (context) => AlertDialog(
|
||||
title: const Text('Explanation'),
|
||||
content: SingleChildScrollView(
|
||||
child: Text(explanation),
|
||||
),
|
||||
actions: [
|
||||
TextButton(
|
||||
onPressed: () => Navigator.pop(context),
|
||||
child: const Text('Close'),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
} catch (error) {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
const SnackBar(
|
||||
content: Text("Error explaining response."),
|
||||
),
|
||||
);
|
||||
}
|
||||
},
|
||||
child: const Text('Explain API'),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
Reference in New Issue
Block a user