"""
Task: task00003-260207-09.00
작업: NotebookLM 쿼리 기능 테스트 (notebook_query API) - Reflect Memo 기능 추출
"""
import asyncio
import sys
import os

source_path = r"C:\Users\drumb\.gemini\antigravity\scratch\autoAIagent\notebooklm-mcp-source\src"
if source_path not in sys.path:
    sys.path.append(source_path)

from notebooklm_mcp.server import notebook_query

async def main():
    try:
        query = "노트북에 있는 '영상 내용을 정리한 부분'이나 'Reflect Memo' 관련 영상 요약 내용 중 우리 프로젝트 스펙에 들어갈만한 핵심 기능들을 정리해줘."
        res = notebook_query.fn(notebook_id='f78b6285-b938-4ae3-bc12-c643f8603abc', query=query)
        if asyncio.iscoroutine(res):
            res = await res
        
        if isinstance(res, dict) and res.get("status") == "success":
            print(f"ANSWER:\n{res.get('answer')}")
        else:
            print(f"ERROR: {res}")
            
    except Exception as e:
        print(f"EXCEPTION:{str(e)}")

if __name__ == "__main__":
    asyncio.run(main())
