Skip to content

Commit f25e897

Browse files
committed
함수명 변경 및 불필요한 import 제거
1 parent 02c5149 commit f25e897

File tree

3 files changed

+32
-53
lines changed

3 files changed

+32
-53
lines changed

interface/core/config/__init__.py

Lines changed: 10 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -16,24 +16,17 @@
1616
)
1717

1818
from .settings import (
19-
DEFAULT_DATAHUB_SERVER,
20-
DEFAULT_VECTORDB_TYPE,
21-
DEFAULT_VECTORDB_LOCATION,
2219
load_config,
23-
_get_session_value,
2420
update_datahub_server,
2521
update_data_source_mode,
2622
update_vectordb_settings,
2723
update_llm_settings,
2824
update_embedding_settings,
2925
update_db_settings,
30-
_put_env,
31-
_put_session,
3226
)
3327

3428
from .registry_data_sources import (
3529
get_data_sources_registry,
36-
_save_registry,
3730
add_datahub_source,
3831
update_datahub_source,
3932
delete_datahub_source,
@@ -44,7 +37,6 @@
4437

4538
from .registry_db import (
4639
get_db_connections_registry,
47-
_save_db_registry,
4840
add_db_connection,
4941
update_db_connection,
5042
delete_db_connection,
@@ -53,18 +45,16 @@
5345
from .registry_llm import (
5446
get_llm_registry,
5547
save_llm_profile,
56-
_save_llm_registry,
5748
get_embedding_registry,
5849
save_embedding_profile,
59-
_save_embedding_registry,
6050
)
6151

6252
from .paths import (
63-
_get_registry_file_path,
64-
_get_db_registry_file_path,
65-
_get_llm_registry_file_path,
66-
_get_embedding_registry_file_path,
67-
_ensure_parent_dir,
53+
get_registry_file_path,
54+
get_db_registry_file_path,
55+
get_llm_registry_file_path,
56+
get_embedding_registry_file_path,
57+
ensure_parent_dir,
6858
)
6959

7060
from .persist import (
@@ -90,24 +80,16 @@
9080
"LLMRegistry",
9181
"EmbeddingProfile",
9282
"EmbeddingRegistry",
93-
# Defaults
94-
"DEFAULT_DATAHUB_SERVER",
95-
"DEFAULT_VECTORDB_TYPE",
96-
"DEFAULT_VECTORDB_LOCATION",
9783
# Settings APIs
9884
"load_config",
99-
"_get_session_value",
10085
"update_datahub_server",
10186
"update_data_source_mode",
10287
"update_vectordb_settings",
10388
"update_llm_settings",
10489
"update_embedding_settings",
10590
"update_db_settings",
106-
"_put_env",
107-
"_put_session",
10891
# Registries - data sources
10992
"get_data_sources_registry",
110-
"_save_registry",
11193
"add_datahub_source",
11294
"update_datahub_source",
11395
"delete_datahub_source",
@@ -116,23 +98,20 @@
11698
"delete_vectordb_source",
11799
# Registries - db connections
118100
"get_db_connections_registry",
119-
"_save_db_registry",
120101
"add_db_connection",
121102
"update_db_connection",
122103
"delete_db_connection",
123104
# Registries - llm/embedding
124105
"get_llm_registry",
125106
"save_llm_profile",
126-
"_save_llm_registry",
127107
"get_embedding_registry",
128108
"save_embedding_profile",
129-
"_save_embedding_registry",
130109
# Persistence helpers and paths (for backward compatibility)
131-
"_get_registry_file_path",
132-
"_get_db_registry_file_path",
133-
"_get_llm_registry_file_path",
134-
"_get_embedding_registry_file_path",
135-
"_ensure_parent_dir",
110+
"get_registry_file_path",
111+
"get_db_registry_file_path",
112+
"get_llm_registry_file_path",
113+
"get_embedding_registry_file_path",
114+
"ensure_parent_dir",
136115
"save_registry_to_disk",
137116
"save_db_registry_to_disk",
138117
"save_llm_registry_to_disk",

interface/core/config/paths.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,35 +4,35 @@
44
from pathlib import Path
55

66

7-
def _get_registry_file_path() -> Path:
7+
def get_registry_file_path() -> Path:
88
# Allow override via env var, else default to ./config/data_sources.json
99
override = os.getenv("LANG2SQL_REGISTRY_PATH")
1010
if override:
1111
return Path(override).expanduser().resolve()
1212
return Path(os.getcwd()) / "config" / "data_sources.json"
1313

1414

15-
def _get_db_registry_file_path() -> Path:
15+
def get_db_registry_file_path() -> Path:
1616
# Allow override via env var, else default to ./config/db_connections.json
1717
override = os.getenv("LANG2SQL_DB_REGISTRY_PATH")
1818
if override:
1919
return Path(override).expanduser().resolve()
2020
return Path(os.getcwd()) / "config" / "db_connections.json"
2121

2222

23-
def _get_llm_registry_file_path() -> Path:
23+
def get_llm_registry_file_path() -> Path:
2424
override = os.getenv("LANG2SQL_LLM_REGISTRY_PATH")
2525
if override:
2626
return Path(override).expanduser().resolve()
2727
return Path(os.getcwd()) / "config" / "llm_profiles.json"
2828

2929

30-
def _get_embedding_registry_file_path() -> Path:
30+
def get_embedding_registry_file_path() -> Path:
3131
override = os.getenv("LANG2SQL_EMBEDDING_REGISTRY_PATH")
3232
if override:
3333
return Path(override).expanduser().resolve()
3434
return Path(os.getcwd()) / "config" / "embedding_profiles.json"
3535

3636

37-
def _ensure_parent_dir(path: Path) -> None:
37+
def ensure_parent_dir(path: Path) -> None:
3838
path.parent.mkdir(parents=True, exist_ok=True)

interface/core/config/persist.py

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -17,41 +17,41 @@
1717
EmbeddingProfile,
1818
)
1919
from .paths import (
20-
_get_registry_file_path,
21-
_get_db_registry_file_path,
22-
_get_llm_registry_file_path,
23-
_get_embedding_registry_file_path,
24-
_ensure_parent_dir,
20+
get_registry_file_path,
21+
get_db_registry_file_path,
22+
get_llm_registry_file_path,
23+
get_embedding_registry_file_path,
24+
ensure_parent_dir,
2525
)
2626

2727

2828
def save_registry_to_disk(registry: DataSourcesRegistry) -> None:
29-
path = _get_registry_file_path()
30-
_ensure_parent_dir(path)
29+
path = get_registry_file_path()
30+
ensure_parent_dir(path)
3131
payload = asdict(registry)
3232
with path.open("w", encoding="utf-8") as f:
3333
json.dump(payload, f, ensure_ascii=False, indent=2)
3434

3535

3636
def save_db_registry_to_disk(registry: DBConnectionsRegistry) -> None:
37-
path = _get_db_registry_file_path()
38-
_ensure_parent_dir(path)
37+
path = get_db_registry_file_path()
38+
ensure_parent_dir(path)
3939
payload = asdict(registry)
4040
with path.open("w", encoding="utf-8") as f:
4141
json.dump(payload, f, ensure_ascii=False, indent=2)
4242

4343

4444
def save_llm_registry_to_disk(registry: LLMRegistry) -> None:
45-
path = _get_llm_registry_file_path()
46-
_ensure_parent_dir(path)
45+
path = get_llm_registry_file_path()
46+
ensure_parent_dir(path)
4747
payload = asdict(registry)
4848
with path.open("w", encoding="utf-8") as f:
4949
json.dump(payload, f, ensure_ascii=False, indent=2)
5050

5151

5252
def save_embedding_registry_to_disk(registry: EmbeddingRegistry) -> None:
53-
path = _get_embedding_registry_file_path()
54-
_ensure_parent_dir(path)
53+
path = get_embedding_registry_file_path()
54+
ensure_parent_dir(path)
5555
payload = asdict(registry)
5656
with path.open("w", encoding="utf-8") as f:
5757
json.dump(payload, f, ensure_ascii=False, indent=2)
@@ -95,7 +95,7 @@ def _parse_vectordb_list(items: List[Dict[str, Any]]) -> List[VectorDBSource]:
9595

9696

9797
def load_registry_from_disk() -> DataSourcesRegistry:
98-
path = _get_registry_file_path()
98+
path = get_registry_file_path()
9999
if not path.exists():
100100
return DataSourcesRegistry()
101101
with path.open("r", encoding="utf-8") as f:
@@ -141,7 +141,7 @@ def _parse_db_conn_list(items: List[Dict[str, Any]]) -> List[DBConnectionProfile
141141

142142

143143
def load_db_registry_from_disk() -> DBConnectionsRegistry:
144-
path = _get_db_registry_file_path()
144+
path = get_db_registry_file_path()
145145
if not path.exists():
146146
return DBConnectionsRegistry()
147147
with path.open("r", encoding="utf-8") as f:
@@ -169,7 +169,7 @@ def _parse_llm_profiles(items: List[Dict[str, Any]]) -> List[LLMProfile]:
169169

170170

171171
def load_llm_registry_from_disk() -> LLMRegistry:
172-
path = _get_llm_registry_file_path()
172+
path = get_llm_registry_file_path()
173173
if not path.exists():
174174
return LLMRegistry()
175175
with path.open("r", encoding="utf-8") as f:
@@ -195,7 +195,7 @@ def _parse_embedding_profiles(items: List[Dict[str, Any]]) -> List[EmbeddingProf
195195

196196

197197
def load_embedding_registry_from_disk() -> EmbeddingRegistry:
198-
path = _get_embedding_registry_file_path()
198+
path = get_embedding_registry_file_path()
199199
if not path.exists():
200200
return EmbeddingRegistry()
201201
with path.open("r", encoding="utf-8") as f:

0 commit comments

Comments
 (0)