fix simulation context and add model name to ouput

This commit is contained in:
TQuynh109 2026-06-01 04:07:18 +00:00
parent 84e2d2930f
commit 640b7fc47c
2 changed files with 7 additions and 3 deletions

View File

@ -309,7 +309,7 @@ def _check_simulation_prepared(simulation_id: str) -> tuple:
# - completed: đã chạy xong, nghĩa là đã chuẩn bị xong từ trước
# - stopped: đã dừng, nghĩa là đã chuẩn bị xong từ trước
# - failed: chạy thất bại (nhưng phần chuẩn bị đã hoàn tất)
prepared_statuses = ["ready", "preparing", "running", "completed", "stopped", "failed"]
prepared_statuses = ["ready", "preparing", "running", "completed", "stopped", "failed", "paused"]
if status in prepared_statuses and config_generated:
# Lấy thông tin thống kê file
@ -468,7 +468,7 @@ def prepare_simulation():
entity_types_list = data.get('entity_types')
use_llm_for_profiles = data.get('use_llm_for_profiles', True)
parallel_profile_count = data.get('parallel_profile_count', 5)
parallel_profile_count = data.get('parallel_profile_count', 20)
# ========== Đồng bộ lấy số lượng thực thể (trước khi chạy tác vụ nền) ==========
# Nhờ đó frontend có thể lấy ngay tổng số Agent dự kiến sau khi gọi prepare

View File

@ -49,6 +49,7 @@ class Project:
simulation_requirement: Optional[str] = None
chunk_size: int = 500
chunk_overlap: int = 50
llm_model_name: Optional[str] = None
# Thông tin lỗi
error: Optional[str] = None
@ -63,6 +64,7 @@ class Project:
"updated_at": self.updated_at,
"files": self.files,
"total_text_length": self.total_text_length,
"llm_model_name": self.llm_model_name,
"ontology": self.ontology,
"analysis_summary": self.analysis_summary,
"graph_id": self.graph_id,
@ -88,6 +90,7 @@ class Project:
updated_at=data.get('updated_at', ''),
files=data.get('files', []),
total_text_length=data.get('total_text_length', 0),
llm_model_name=data.get('llm_model_name'),
ontology=data.get('ontology'),
analysis_summary=data.get('analysis_summary'),
graph_id=data.get('graph_id'),
@ -151,7 +154,8 @@ class ProjectManager:
name=name,
status=ProjectStatus.CREATED,
created_at=now,
updated_at=now
updated_at=now,
llm_model_name=Config.LLM_MODEL_NAME
)
# Thiết lập các thư mục con trong không gian thư mục của project