Repository navigation
英語TTSのプロンプト・CPU設定を調整し駅ナンバリングの発音を修正 - #5538
Conversation
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
📝 WalkthroughWalkthroughTTS機能でGemini向けプロンプトと音量定数を更新し、0–99の数字を英単語に変換する Changes
Sequence Diagram(s)sequenceDiagram
participant Client as Client
participant Func as CloudFunction\n(`functions/src/funcs/tts.ts`)
participant Gemini as Gemini TTS
Client->>Func: onCall TTSリクエスト (テキスト/SSML)
Func-->>Func: SSML正規化・`numberToEnglishWord()`で<say-as>処理
Func->>Gemini: 合成リクエスト (プロンプト, volume=EN_GEMINI_VOLUME_BOOST_DB)
Gemini-->>Func: 音声バイナリ
Func-->>Client: 音声を返却
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
概要TTS機能の音声出力品質を改善するため、Geminiボリューム設定の調整、数字のEnglish単語変換、SSML処理の拡張、CPU割り当て追加、プロンプトテキスト改善、および駅番号の音声合成タグ化が実装されました。 変更内容
推定コード レビュー努力🎯 3 (Moderate) | ⏱️ ~20分 関連する可能性のあるPR
推奨ラベル
詩
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Comment |
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@functions/src/funcs/tts.ts`:
- Line 26: 現在の変更(EN_GEMINI_VOLUME_BOOST_DB と line 372 の値)がキャッシュキーの id
計算に含まれていないため既存キャッシュが使われてしまいます。修正方法:tts のキャッシュキー(id を生成している関数/式、参照されている変数名例:
EN_GEMINI_VOLUME_BOOST_DB と該当の line372 にあるパラメータ)にこれらの定数/パラメータを含めるか、キャッシュ方式に使っている
version 値をインクリメントして確実に新しいプロンプト/音量が反映されるようにしてください。必ず id を生成している箇所(id を
return/保存する関数やキー生成ロジック)を更新し、既存キャッシュと衝突しないことを確認してください。
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: f29b60af-f7fe-4aac-81fa-d611e72b241e
📒 Files selected for processing (2)
functions/src/funcs/tts.tssrc/hooks/useTTSText.ts
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/hooks/useTTSText.test.tsx (1)
132-132: 2桁の駅番号ケースも1本追加したいです。今回の更新はすべて
S-02→<say-as ...>2</say-as>の確認に寄っているので、PR本文で例に出ているJY-12のような 10–99 番台の回帰はまだ拾えません。useNumberingを 1 件だけJY-12でモックしたケースを足しておくと、今回の修正範囲をより直接守れます。Also applies to: 144-144, 159-159, 171-171, 186-186, 198-198, 213-213, 225-225, 240-240, 252-252, 267-267, 279-279, 294-294, 314-326
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/hooks/useTTSText.test.tsx` at line 132, Add a test that covers two-digit station numbers (e.g., "JY-12") by mocking useNumbering once to return a two-digit station id and expected markup, similar to existing S-02 cases; locate the tests in useTTSText.test.tsx and update the relevant test block(s) that currently only assert single-digit conversion (references: useNumbering mock and the test cases around the existing 'S-02' assertions) so the suite verifies 10–99 numbering is converted to <say-as ...>12</say-as>-style output as well.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@src/hooks/useTTSText.test.tsx`:
- Line 132: Add a test that covers two-digit station numbers (e.g., "JY-12") by
mocking useNumbering once to return a two-digit station id and expected markup,
similar to existing S-02 cases; locate the tests in useTTSText.test.tsx and
update the relevant test block(s) that currently only assert single-digit
conversion (references: useNumbering mock and the test cases around the existing
'S-02' assertions) so the suite verifies 10–99 numbering is converted to <say-as
...>12</say-as>-style output as well.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: c085dd5b-05b1-461f-96fc-8944ddc832c5
📒 Files selected for processing (1)
src/hooks/useTTSText.test.tsx
Summary
EN_GEMINI_VOLUME_BOOST_DBを8dBから6dBに戻す<say-as interpret-as="cardinal">SSMLタグで囲み、1文字ずつではなく数値として発音されるように修正stripSsmlに<say-as>タグのハンドリングを追加(数字を英単語に変換)Test plan
🤖 Generated with Claude Code
Summary by CodeRabbit
リリースノート
バグ修正・改善
パフォーマンス最適化