AOSSIE-Org / AOSSIE-Org/DocPilot

fix: GeminiService has unnecessary hardcoded 3-second delay in generatePrescription()

Đang mở
#42 1 bình luận 0 reaction 0 người được giao Xem trên GitHub
stale
Ngôn ngữ chính
Dart
Star
18
Fork
24
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

## Description

In `lib/features/transcription/data/gemini_service.dart`, the `generatePrescription()` method has an arbitrary `Future.delayed(const Duration(seconds: 3))` before making the API call:

```dart
Future generatePrescription(String transcription) async {
await Future.delayed(const Duration(seconds: 3)); // <-- WHY?
return await _chatbotService.getGeminiResponse(
"Generate a prescription based on the conversation in this transcription: $transcription",
);
}
```

This adds 3 seconds of unnecessary wait time for every prescription generation. The summary generation method does NOT have this delay, so it appears unintentional.

## Impact

- Users wait 3 extra seconds for every prescription
- On slow networks, combined with API latency, this makes the experience noticeably sluggish

## Expected Fix

Remove the `Future.delayed` call. If rate limiting was the intent, it should be handled properly with retry logic or documented.

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.