14
14
def etl_process_single_file (product : str , etl_type : str , filename : str ):
15
15
"""Process a single file with ETL for the given product."""
16
16
from etlapp .common .context import EtlContext
17
- from etlapp .etl .flow import etl_generic_embedding_flow , etl_generic_full_flow
17
+ from etlapp .etl .flow import etl_generic_full_flow
18
18
from etlapp .etl .etl_generic .generate import start_generate_generic
19
+ from etlapp .etl .etl_generic .embedding import start_embedding_generic
19
20
20
21
# Remove file extension to get the base filename
21
22
file_base = os .path .splitext (filename )[0 ]
@@ -34,7 +35,7 @@ def etl_process_single_file(product: str, etl_type: str, filename: str):
34
35
start_generate_generic (context )
35
36
elif etl_type == "embedding" :
36
37
# Full embedding flow (generate, merge, embedding)
37
- etl_generic_embedding_flow (context )
38
+ start_embedding_generic (context )
38
39
elif etl_type == "full" :
39
40
# Full answer generation
40
41
etl_generic_full_flow (context )
@@ -50,26 +51,25 @@ def etl_start_execution(
50
51
):
51
52
# 检查配置完整性
52
53
config_errors = []
53
-
54
+
54
55
# 检查LLM配置
55
56
if not app_config .llm .api_key :
56
57
config_errors .append ("LLM API密钥未配置" )
57
58
if not app_config .llm .api_base :
58
59
config_errors .append ("LLM API基础地址未配置" )
59
60
if not app_config .llm .model_name :
60
61
config_errors .append ("LLM模型名称未配置" )
61
-
62
+
62
63
# 检查Embedding配置
63
64
if not app_config .embedding .api_key :
64
65
config_errors .append ("Embedding API密钥未配置" )
65
-
66
+
66
67
# 如果有配置错误,返回错误信息
67
68
if config_errors :
68
69
return JSONResponse (
69
- status_code = 400 ,
70
- content = {"error" : "配置不完整" , "details" : config_errors }
70
+ status_code = 400 , content = {"error" : "配置不完整" , "details" : config_errors }
71
71
)
72
-
72
+
73
73
task_id = f"etl_{ product } _{ etl_type } _{ filename } _{ int (time .time ())} "
74
74
etl_progress_status [task_id ] = {"status" : "running" , "progress" : 0 , "msg" : "" }
75
75
0 commit comments