type hint1 XIII. Python 함수 자체를 분석하여, AI가 사용할 수 있는 Tool 설명서(schema)를 자동으로 만드는 방법 # 1. Type Hint 그리고 __annotations__ def search(query:str, limit:int=3, safe:bool=True)->str: mode = "safe" if safe else "open" return f"'{query}'에 대해 {limit}개의 결과물({mode})" print(search("환불 정책")) print(search("개점 시간", limit=1, safe=False)) print(search.__annotations__) #-------- 2. History 분석 def summarise(messages:list[dict], limit:int|None=None)->dict[str,i.. 2026. 8. 25. 이전 1 다음 반응형