Repository navigation
AIチャットの応答言語仕様を直近のユーザ発話に合わせる形へ更新 - #6507
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_016urFSJDYbEpai9SexJFpKD
Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_016urFSJDYbEpai9SexJFpKD
Contributor
📝 WalkthroughWalkthroughAIエージェントの言語選択仕様を更新しました。通常の応答は直近のユーザー発話の言語で生成します。localeは判定不能時の既定言語と、サーバ生成定型文の言語選択に使用します。 Changes言語選択ポリシー
Estimated code review effort: 1 (Trivial) | ~5 minutes Possibly related issues
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Contributor
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs/spec/ai-agent/architecture.md`:
- Around line 746-754: エラー処理表の429レート制限メッセージを、`locale`
に応じてサーバ生成定型文を選択する仕様と一致させてください。該当する429メッセージの記載を`locale`対応の表現へ更新するか、日本語が例示であることを明記し、直近の言語仕様と矛盾しない内容にしてください。
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 9b11c908-af52-4228-b610-02eac5ee514c
📒 Files selected for processing (1)
docs/spec/ai-agent/architecture.md
Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_016urFSJDYbEpai9SexJFpKD
Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_016urFSJDYbEpai9SexJFpKD
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
AI チャット(行き先提案エージェント)の応答言語の仕様を、端末の言語設定追従から「直近のユーザ発話の言語に合わせる」へ改める。英語端末で日本語を打っても英語で返ってきていたため。
判定はサーバ側のシステムプロンプトでモデルに行わせる方針とし、アプリ側には言語判定を持たせない。そのためこの PR はドキュメントのみの変更で、アプリのコード変更はない。実装は BFF 側(TrainLCD/BFF#38)で行う。
変更の種類
変更内容
docs/spec/ai-agent/architecture.mdの「多言語対応」節を更新。エージェント応答言語は直近のユーザ発話と同じ言語に合わせ、指示はシステムプロンプトの出力規約で行う(クライアントは言語判定をしない)ことを明記localeの役割を 2 つに限定して記載。(1) モデルが入力言語を判別できないときの既定言語のヒント、(2) サーバ生成の定型文(トピックゲートの謝絶文、モデル出力が空だったときのフォールバック文)の言語選択translate('destinationAgentRateLimited')(端末の言語設定に従う)。エラー処理表の 429 行も実装に合わせて修正localeフィールドの説明を上記に合わせて修正(従来は「応答言語の指示に使う」)replyの言語規約を追記localeのワイヤ形式は従来どおりja|enで変更なし。アプリ側の送信ロジック(src/hooks/useDestinationAgent.ts)も現状のまま。テスト
npm run lintが通ることnpm testが通ることnpm run typecheckが通ること省略: コード変更なし(ドキュメントのみ)。
markdownlint-cli2はクリーン。関連Issue
スクリーンショット(任意)