AOSSIE-Org / AOSSIE-Org/DocPilot

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

未關閉
#42 1 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
stale
主要語言
Dart
星號
18
分支
24
PR 合併指標
30 天內沒有已合併 PR

描述

## 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.

貢獻指南

這個儲存庫沒有索引到貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。