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 摘要。