opencode 로 바꾸고 작업전 커밋

This commit is contained in:
windpacer
2026-05-08 17:22:10 +09:00
parent 15c17522c8
commit e923aab43b
202 changed files with 1336027 additions and 115 deletions

View File

@@ -95,23 +95,32 @@ class IntelligentMapper:
return MappingResult(resolved_tag="UNKNOWN", reason=f"Error: {str(e)}", confidence=0.0)
# --- 전문화된 Worker 함수들 ---
# vLLM 컨커런시 제한으로 인해 배치 처리 (한 번에 15개 요청)
_BATCH_SIZE = 15
async def _batch_gather(self, node_ids: List[str], prompt: str) -> Dict[str, MappingResult]:
"""노드를 배치로 나누어 순차적으로 LLM 요청.
모든 노드를 동시에 요청하면 vLLM 큐가 가득 차 타임아웃 발생.
"""
all_results = {}
for i in range(0, len(node_ids), self._BATCH_SIZE):
batch = node_ids[i : i + self._BATCH_SIZE]
tasks = [self._resolve_generic(nid, prompt) for nid in batch]
batch_results = await asyncio.gather(*tasks)
all_results.update(dict(zip(batch, batch_results)))
return all_results
async def extract_transmitters(self, node_ids: List[str]) -> Dict[str, MappingResult]:
prompt = "당신은 계측기 전문 엔지니어입니다. 특히 Pressure/Flow/Level Transmitter 매핑에 특화되어 있습니다."
tasks = [self._resolve_generic(nid, prompt) for nid in node_ids]
results = await asyncio.gather(*tasks)
return dict(zip(node_ids, results))
return await self._batch_gather(node_ids, prompt)
async def extract_valves(self, node_ids: List[str]) -> Dict[str, MappingResult]:
prompt = "당신은 밸브 및 액추에이터 전문 엔지니어입니다. 밸브의 개폐 상태 및 제어 태그 매핑에 특화되어 있습니다."
tasks = [self._resolve_generic(nid, prompt) for nid in node_ids]
results = await asyncio.gather(*tasks)
return dict(zip(node_ids, results))
return await self._batch_gather(node_ids, prompt)
async def extract_equipment(self, node_ids: List[str]) -> Dict[str, MappingResult]:
prompt = "당신은 공정 설비 전문 엔지니어입니다. 펌프, 탱크, 열교환기 등의 메인 설비 태그 매핑에 특화되어 있습니다."
tasks = [self._resolve_generic(nid, prompt) for nid in node_ids]
results = await asyncio.gather(*tasks)
return dict(zip(node_ids, results))
return await self._batch_gather(node_ids, prompt)
def validate_mapping(resolved_tag: str, symbol_type: str, tag_metadata: Dict[str, Any]) -> Tuple[bool, str]:
"""심볼 타입과 실제 태그 메타데이터의 엄격한 일치 여부 검증"""