Files
English/kouyu_english
shenleiandClaude Opus 5 f1a5bb8999 refactor: 合并 AiService 各文本接口重复的请求流程
8 个文本接口原本各自重复一套:取 API Key、校验模型与地址、按服务商拼请求头和请求体、
超时、判断 2xx、提取回复内容。现在统一到 _requestContent / _requestPrompt,
底层发送逻辑为 _postJson,请求体由 _buildTextPayload 构造(testConnection 和
transcribeAudio 也改用它们)。各接口只保留提示词和结果解析。

纯重构,不改变行为。已用临时测试录下 3 种服务商、4 种响应(成功、500、401、
网络异常)以及配置无效时的全部请求:共 134 个请求的地址、请求头、请求体和
所有返回值,重构前后逐字节一致。ai_service.dart 从 1291 行减为 1051 行。

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-16 17:14:32 +09:00
..

kouyu_english

A new Flutter project.

Getting Started

This project is a starting point for a Flutter application.

A few resources to get you started if this is your first Flutter project:

For help getting started with Flutter development, view the online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.