Skip to content

Feature/stt refine#103

Merged
jundoring merged 4 commits into
developfrom
feature/stt-refine
Apr 10, 2026
Merged

Feature/stt refine#103
jundoring merged 4 commits into
developfrom
feature/stt-refine

Conversation

@jundoring

@jundoring jundoring commented Apr 10, 2026

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • 새로운 기능

    • STT 오류를 보정하는 기능이 도입되어 음성 입력의 정정된 텍스트를 활용합니다.
  • 개선사항

    • 여러 최종 트랜스크립트를 누적해 더 정확한 쿼리 구성을 지원합니다.
    • 의도 분류 로직이 개선되어 더 안정적이고 풍부한 분류 결과를 제공합니다.
  • 잡무(Chores)

    • 더 이상 사용되지 않는 음성 파일 변환 스크립트를 제거했습니다.

@coderabbitai

coderabbitai Bot commented Apr 10, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@jundoring has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 3 minutes and 52 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 3 minutes and 52 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 052b54e2-bcaa-4459-8581-df49c5df868e

📥 Commits

Reviewing files that changed from the base of the PR and between 0ec8fec and 61200d7.

📒 Files selected for processing (1)
  • app/graph/nodes/classify/intent_gate.py

Walkthrough

내부 QA 실행 경로를 그래프 직접 호출에서 추적 가능한 래퍼(traced_internal_run)로 전환하고, WebSocket STT 누적 로직을 최종 파트 리스트로 변경했으며, 의도 분류 노드에 STT 정정(corrected_text)을 추가했습니다. 테스트 WAV 경로와 불필요한 스크립트도 정리되었습니다.

Changes

Cohort / File(s) Summary
QA 실행 경로 개선
app/api/qa.py, app/core/dependencies.py
app/api/qa.py의 내부 QA 실행이 직접 text_pipeline.graph.invoke(initial_state) 대신 traced_internal_run(initial_state)(asyncio.to_thread 통해 호출)으로 변경됨. app/core/dependencies.py@traceable(name="internal_qa_pipeline")로 장식된 traced_internal_run(initial_state: dict)->dict 추가.
STT 트랜스크립트 누적
app/api/websocket.py
ws_stream에서 최종 트랜스크립트를 단일 문자열 덮어쓰기 대신 final_parts: list[str]로 누적하고, 쿼리는 (sep.join(final_parts) or last_interim).strip()로 구성되도록 변경(언어별 구분자 적용 포함).
의도 분류 및 STT 정정
app/graph/nodes/classify/intent_gate.py
LLM 프롬프트/출력 계약을 확장하여 먼저 corrected_text(STT 오류 정정)를 반환하고 그 후 의도 랭킹을 수행하도록 로직 변경. normalized_text에 정정된 텍스트를 넣고 추적 페이로드에 original_text/corrected_text를 기록. max_tokens 증가(60→150).
테스트 및 정리
app/core/ws_stt_test.py, app/graph/graph_builder.py, audio/m4a.py
테스트 오디오 파일 경로를 audio/wav/6_sh.wav로 변경, 임포트/주석 사이의 빈 줄 제거, 더 이상 필요 없는 audio/m4a.py 스크립트 삭제.

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant QA_API as "app/api/qa.py"
    participant Thread as "asyncio.to_thread"
    participant Traced as "traced_internal_run\n(`@traceable`)"
    participant Graph as "text_pipeline.graph.invoke"

    Client->>QA_API: 내부 QA 요청
    QA_API->>Thread: to_thread(traced_internal_run, initial_state)
    Thread->>Traced: 실행
    Traced->>Graph: graph.invoke(initial_state)
    Graph-->>Traced: 결과(state)
    Traced-->>Thread: 반환(state)
    Thread-->>QA_API: 결과(state)
    QA_API-->>Client: 응답 반환
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~30 minutes

Possibly related PRs

  • Feature/event #55: WebSocket STT→쿼리 조립 및 실시간 LLM 제어 흐름 변경과 관련된 코드(유사 수정 지점).
  • Feature/tts stream #25: app/api/websocket.py의 STT 최종/중간 트랜스크립트 집계 로직을 수정한 PR로 코드 레벨 연관성 있음.

🐰 달그락 달그락 귀를 세우고,
잘못된 말도 살며시 고쳐 담아,
조각난 음성들을 모아 묶으면,
의도가 반짝 얼굴을 내미네.
추적의 실로 길을 잇는 나, 춤추며 축하해요. 🥕✨

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive PR 제목이 변경사항의 주요 내용을 모호하게 설명하고 있습니다. 'Feature/stt refine'은 STT 관련 개선이라는 의도는 있으나, 구체적인 변경 내용(STT 오류 수정, 다중 최종 토사본 수집, 내부 QA 파이프라인 등)을 명확하게 전달하지 못합니다. PR 제목을 더 구체적으로 변경하세요. 예: 'Refine STT transcript handling with multi-final support and intent correction' 또는 '다중 최종 토사본 수집 및 의도 분류 개선'.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/stt-refine

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@app/api/websocket.py`:
- Line 346: The current join always uses a space: change the construction of
query so it uses an empty separator for CJK languages and a space otherwise —
e.g., determine sep = "" if last_lang_code in ("ja","zh") else " ", then set
query = (sep.join(final_parts) or last_interim).strip(); update the code around
variables final_parts, last_interim and last_lang_code (where query is assigned)
to use that language-aware separator.

In `@app/graph/nodes/classify/intent_gate.py`:
- Around line 74-80: The parsed JSON from llm.chat (variable parsed in
intent_gate.py) must be validated as a dict before using parsed.get(); modify
the logic in the block around raw = llm.chat(...) and parsed = json.loads(raw)
to: 1) catch json.JSONDecodeError/ValueError and route to the existing fallback
flow (e.g., set ranking=_DEFAULT_RANKING, place_category=None,
method="llm_fallback_invalid_json", error=str(e)); 2) if json.loads succeeds but
parsed is not a dict (e.g., list, string, null), treat that as an invalid schema
and perform the same fallback handling; and 3) only access
parsed.get("corrected_text") when isinstance(parsed, dict) to avoid
AttributeError and ensure fallback is used for malformed responses.
🪄 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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: ff52fdb0-e161-498f-b0d4-4b78dc10420c

📥 Commits

Reviewing files that changed from the base of the PR and between bff6597 and 3fd4661.

📒 Files selected for processing (7)
  • app/api/qa.py
  • app/api/websocket.py
  • app/core/dependencies.py
  • app/core/ws_stt_test.py
  • app/graph/graph_builder.py
  • app/graph/nodes/classify/intent_gate.py
  • audio/m4a.py
💤 Files with no reviewable changes (2)
  • app/graph/graph_builder.py
  • audio/m4a.py

Comment thread app/api/websocket.py Outdated
Comment thread app/graph/nodes/classify/intent_gate.py
@jundoring jundoring merged commit 5da2c44 into develop Apr 10, 2026
1 check passed
@jundoring jundoring deleted the feature/stt-refine branch April 10, 2026 00:57
@coderabbitai coderabbitai Bot mentioned this pull request Apr 17, 2026
This was referenced Apr 27, 2026
@coderabbitai coderabbitai Bot mentioned this pull request May 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant