"""계층 분석 Feature Plugin. API: /api/v1/hierarchy ADR-017: Hierarchy Generator Python Migration """ import streamlit as st from . import request, monitor FEATURE_CONFIG = { "key": "hierarchy", "name": "계층 분석", "icon": "🔗", "description": "키워드 기반 소비자 여정 계층 분석 및 질문 생성", "api_base": "/api/v1/hierarchy", "order": 5, } def render(base_ctx): """계층 분석 feature 렌더링.""" st.caption("키워드를 입력하면 소비자 여정(CEJ) 기반으로 계층 구조를 분석하고 질문을 생성합니다") tabs = st.tabs([ "📝 분석 요청", "⏳ 진행 현황", "📋 분석 결과", ]) tab_renderers = [ ("분석 요청", request.render), ("진행 현황", monitor.render_active), ("분석 결과", monitor.render_history), ] for tab, (label, renderer) in zip(tabs, tab_renderers): with tab: try: renderer(base_ctx) except Exception as e: st.error(f"{label} 로딩 실패: {e}")