def call_criteria(pdf_path: str, port: int = 50054) -> str:
"""
Criteria Agent 서버를 호출하여 PDF에서 기준을 추출하는 함수
Args:
pdf_path: 분석할 PDF 파일 경로
port: Criteria Agent 서버 포트 (기본값: 50054)
Returns:
str: Criteria Agent의 분석 결과 요약
"""
# insecure 채널을 사용하여 localhost의 지정된 포트로 연결
with grpc.insecure_channel(f"localhost:{port}") as channel:
# CriteriaService의 스텁 생성
stub = agents_pb2_grpc.CriteriaServiceStub(channel)
# PdfRequest 생성 및 전송
req = agents_pb2.PdfRequest(pdf_path=pdf_path)
resp = stub.Extract(req)
return resp.summary