Phase G: Kei API 통신 정상화 — streaming 전환 + Sonnet fallback 제거
G-1: httpx non-streaming → streaming 전환 (3개 파일)
- client.post() → client.stream("POST") + response.aiter_lines()
- SSE 토큰을 실시간 수신 (30분+ 무응답 해소)
G-2: Sonnet fallback 완전 제거
- kei_client.py: classify_content()에서 _call_anthropic_direct() 호출 제거
- content_editor.py: fill_content()에서 Sonnet fallback 분기 제거
- Kei API만 사용. 실패 시 manual_classify() 또는 _apply_defaults() 안전망
G-3: _parse_json() 마크다운 제거 3파일 동기화
- content_editor.py, design_director.py에 kei_client.py와 동일한 전처리 추가
G-4: FAISS를 CPU로 전환 (GPU 메모리 경쟁 해소)
- block_search.py + build_block_index.py: device="cpu"
G-5: streaming 파서에 event:error 처리
- persona_agent 에러 시 무한 대기 방지. 즉시 중단.
G-6: content_editor.py None 가드
- Kei API 실패 시 _parse_json(None) TypeError 방지
G-7: "mode" → "mode_hint" 필드명 수정 (3개 파일)
- persona_agent의 실제 필드명에 맞춤
persona_agent 수정: 0건
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -75,7 +75,7 @@ def _resolve_template_path(env: Environment, block_type: str) -> str | None:
|
||||
|
||||
검색 순서:
|
||||
0. catalog.yaml 매핑 (id → template 경로, 최우선)
|
||||
1. 정확한 경로 (blocks/cards/card-text-grid.html 등 — 팀장이 카테고리 포함 지정)
|
||||
1. 정확한 경로 (blocks/cards/card-icon-desc.html 등 — 팀장이 카테고리 포함 지정)
|
||||
2. 카테고리 폴더 검색 (blocks/{category}/{block_type}.html)
|
||||
3. _legacy fallback (blocks/_legacy/{block_type}.html)
|
||||
4. 루트 fallback (blocks/{block_type}.html)
|
||||
@@ -91,7 +91,7 @@ def _resolve_template_path(env: Environment, block_type: str) -> str | None:
|
||||
if not catalog_path.endswith(".html"):
|
||||
candidates.append(f"{catalog_path}.html")
|
||||
|
||||
# 1. 이미 카테고리 경로가 포함된 경우 (예: "cards/card-text-grid")
|
||||
# 1. 이미 카테고리 경로가 포함된 경우 (예: "cards/card-icon-desc")
|
||||
if "/" in block_type:
|
||||
candidates.append(f"blocks/{block_type}.html")
|
||||
candidates.append(f"blocks/{block_type}") # .html 이미 포함된 경우
|
||||
@@ -116,6 +116,7 @@ def _resolve_template_path(env: Environment, block_type: str) -> str | None:
|
||||
return None
|
||||
|
||||
|
||||
|
||||
def _preprocess_svg_data(block_type: str, block_data: dict[str, Any]) -> dict[str, Any]:
|
||||
"""P2-B: SVG 시각화 블록의 좌표를 사전 계산한다.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user