Skip to content

Commit ddc9fe2

Browse files
committed
README.md에 설치 방법 및 출력 포맷 관련 내용 추가, pre-commit black 적용 #134
1 parent b2063df commit ddc9fe2

File tree

20 files changed

+40
-53
lines changed

20 files changed

+40
-53
lines changed

README.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,13 @@ Lang2SQL은 자연어 쿼리를 최적화된 SQL 문으로 변환하는 오픈
5656
### 빠른 설치
5757

5858
```bash
59+
# pip
5960
pip install lang2sql
61+
62+
# uv
63+
uv venv --python 3.11
64+
source .venv/bin/activate
65+
uv add lang2sql
6066
```
6167

6268
### 소스에서 설치
@@ -194,11 +200,6 @@ Lang2SQL은 LangGraph를 사용한 다단계 접근 방식을 따릅니다:
194200
- 현재는 Datahub를 통해 로컬에 FAISS VectorDB를 생성해야만 사용 가능한 구조입니다.
195201
- 이 결합도를 낮춰서 Datahub 없이도 기존에 준비된 VectorDB만 있으면 바로 활용할 수 있도록 아키텍처를 개선하는 작업입니다.
196202

197-
### 출력 포맷 강화
198-
199-
- 현재 Streamlit을 통한 웹 인터페이스만 지원하고 있습니다.
200-
- CLI, JSON 등 다양한 출력 포맷을 지원하여 사용자가 선호하는 환경에서 유연하게 활용할 수 있도록 개선합니다.
201-
202203
### 모니터링 / 로깅 강화
203204

204205
- 프로젝트 사용 패턴과 성능을 모니터링하고, 상세한 로깅 시스템을 구축합니다.
@@ -209,6 +210,10 @@ Lang2SQL은 LangGraph를 사용한 다단계 접근 방식을 따릅니다:
209210
- 프로젝트 기여 장벽을 낮추기 위한 포괄적인 문서화 작업입니다.
210211
- 개발자 가이드, 튜토리얼 등을 체계적으로 정리하여 새로운 기여자들이 쉽게 참여할 수 있는 환경을 조성합니다.
211212

213+
### LLM 프론트에서 분리하기
214+
215+
프런트에서는 LLM 호출·키를 제거하고 내부 백엔드 API로 위임해 보안·권한·모니터링을 중앙화합니다.
216+
212217
---
213218

214219
## 🤝 기여하기

data_utils/datahub_source.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,3 @@ def get_glossary_terms_by_urn(self, dataset_urn):
143143
def _is_valid_gms_server(self, gms_server):
144144
"""GMS 서버 주소의 유효성을 검사하는 함수 (하위 호환성)"""
145145
return self.client._is_valid_gms_server(gms_server)
146-
147-
148-

engine/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
11
"""Lang2SQL Data Processing 진입점 패키지"""
2-
3-

engine/query_executor.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,5 +115,3 @@ def extract_sql_from_result(res: Dict[str, Any]) -> Optional[str]:
115115
except ValueError:
116116
logger.error("SQL을 추출할 수 없습니다.")
117117
return None
118-
119-

infra/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
11
"""인프라 계층 패키지 (DB, 모니터링 등)"""
2-
3-

infra/db/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
11
"""DB 접근 계층 패키지"""
2-
3-

infra/db/connect_db.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,5 +118,3 @@ def run_sql(self, sql: str) -> pd.DataFrame:
118118
except Exception as e:
119119
logger.exception("An error occurred while executing SQL: %s", e)
120120
raise
121-
122-

infra/monitoring/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
11
"""모니터링/헬스체크 패키지"""
2-
3-

infra/monitoring/check_server.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,5 +72,3 @@ def is_gms_server_healthy(*, url: str) -> bool:
7272
logger.exception("Unexpected request error to GMS server: %s", health_url)
7373

7474
return False
75-
76-

interface/graph_builder.py

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@
2626
)
2727

2828

29-
def build_selected_sequence(preset: str, use_profile: bool, use_context: bool) -> List[str]:
29+
def build_selected_sequence(
30+
preset: str, use_profile: bool, use_context: bool
31+
) -> List[str]:
3032
"""
3133
프리셋과 커스텀 토글에 따라 실행할 노드 시퀀스를 생성합니다.
3234
@@ -110,9 +112,6 @@ def render_sequence(sequence: List[str]) -> str:
110112
return " → ".join(label_map[s] for s in sequence)
111113

112114

113-
114-
115-
116115
st.title("LangGraph 구성 UI")
117116
st.caption("기본/확장/커스텀으로 StateGraph를 구성하고 세션에 적용합니다.")
118117

@@ -129,7 +128,10 @@ def render_sequence(sequence: List[str]) -> str:
129128
# 프리셋에서는 QUERY_MAKER 자동 포함
130129
use_query_maker = True
131130

132-
def build_sequence_with_qm(preset: str, use_profile: bool, use_context: bool, use_qm: bool) -> List[str]:
131+
132+
def build_sequence_with_qm(
133+
preset: str, use_profile: bool, use_context: bool, use_qm: bool
134+
) -> List[str]:
133135
"""
134136
QUERY_MAKER 포함 여부를 반영하여 시퀀스를 생성합니다.
135137
@@ -152,13 +154,19 @@ def build_sequence_with_qm(preset: str, use_profile: bool, use_context: bool, us
152154
base_seq = build_selected_sequence(preset, use_profile, use_context)
153155
return base_seq
154156

157+
155158
sequence = build_sequence_with_qm(preset, use_profile, use_context, use_query_maker)
156159

157160
st.subheader("실행 순서")
158161
st.write(render_sequence(sequence))
159162

160163
st.subheader("그래프 생성")
161-
config = {"preset": preset, "use_profile": use_profile, "use_context": use_context, "use_query_maker": use_query_maker}
164+
config = {
165+
"preset": preset,
166+
"use_profile": use_profile,
167+
"use_context": use_context,
168+
"use_query_maker": use_query_maker,
169+
}
162170

163171
# 선택이 바뀌면 자동으로 세션 그래프 갱신
164172
prev_config = st.session_state.get("graph_config")
@@ -177,4 +185,3 @@ def build_sequence_with_qm(preset: str, use_profile: bool, use_context: bool, us
177185

178186
with st.expander("현재 세션 그래프 설정"):
179187
st.json(st.session_state.get("graph_config", {}))
180-

0 commit comments

Comments
 (0)