def call_static(code_path: str, port: int = 50053) -> str:
"""
Static Agent 서버를 호출하여 정적 분석을 수행하는 함수
Args:
code_path: 분석할 코드 파일 경로
port: Static Agent 서버 포트 (기본값: 50053)
Returns:
str: Static Agent의 분석 결과 요약
"""
# insecure 채널을 사용하여 localhost의 지정된 포트로 연결
with grpc.insecure_channel(f"localhost:{port}") as channel:
# StaticService의 스텁 생성
stub = agents_pb2_grpc.StaticServiceStub(channel)
# CodeRequest 생성 및 전송
req = agents_pb2.CodeRequest(code_path=code_path)
resp = stub.Analyze(req)
return resp.summary