diff --git "a/Appendix/A-RAG\354\235\221\354\232\251/03-LangGraph-Add-Groundedness-Check.ipynb" "b/Appendix/A-RAG\354\235\221\354\232\251/03-LangGraph-Add-Groundedness-Check.ipynb" index 14a72e7..0c44105 100644 --- "a/Appendix/A-RAG\354\235\221\354\232\251/03-LangGraph-Add-Groundedness-Check.ipynb" +++ "b/Appendix/A-RAG\354\235\221\354\232\251/03-LangGraph-Add-Groundedness-Check.ipynb" @@ -255,9 +255,9 @@ " 검색된 문서가 질문과 관련이 있는지 평가합니다.\n", " \"\"\"\n", " # 관련성 평가기를 생성합니다.\n", - " # When using an OpenAI key, change to models like gpt-5.4-mini, gpt-5.4-nano etc.\n", + " # When using an OpenAI key, change to models like gpt-5.6-luna, gpt-5.6-terra-nano etc.\n", " question_retrieval_relevant = GroundednessChecker(\n", - " llm=init_chat_model(\"gpt-5.4\", temperature=0),\n", + " llm=init_chat_model(\"gpt-5.6-terra\", reasoning_effort=\"none\", temperature=0),\n", " target=\"question-retrieval\"\n", " ).create()\n", "\n", diff --git "a/Appendix/A-RAG\354\235\221\354\232\251/04-LangGraph-Add-Web-Search.ipynb" "b/Appendix/A-RAG\354\235\221\354\232\251/04-LangGraph-Add-Web-Search.ipynb" index a971d7c..e45d18b 100644 --- "a/Appendix/A-RAG\354\235\221\354\232\251/04-LangGraph-Add-Web-Search.ipynb" +++ "b/Appendix/A-RAG\354\235\221\354\232\251/04-LangGraph-Add-Web-Search.ipynb" @@ -256,9 +256,9 @@ " 검색된 문서가 질문과 관련이 있는지 평가합니다.\n", " \"\"\"\n", " # 관련성 평가기를 생성합니다.\n", - " # When using an OpenAI key, change to models like gpt-5.4-mini, gpt-5.4-nano etc.\n", + " # When using an OpenAI key, change to models like gpt-5.6-luna, gpt-5.6-terra-nano etc.\n", " question_retrieval_relevant = GroundednessChecker(\n", - " llm=init_chat_model(\"gpt-5.4\", temperature=0),\n", + " llm=init_chat_model(\"gpt-5.6-terra\", reasoning_effort=\"none\", temperature=0),\n", " target=\"question-retrieval\"\n", " ).create()\n", "\n", diff --git "a/Appendix/A-RAG\354\235\221\354\232\251/05-LangGraph-Add-Query-Rewrite.ipynb" "b/Appendix/A-RAG\354\235\221\354\232\251/05-LangGraph-Add-Query-Rewrite.ipynb" index 1436c2f..f008243 100644 --- "a/Appendix/A-RAG\354\235\221\354\232\251/05-LangGraph-Add-Query-Rewrite.ipynb" +++ "b/Appendix/A-RAG\354\235\221\354\232\251/05-LangGraph-Add-Query-Rewrite.ipynb" @@ -302,9 +302,9 @@ " 검색된 문서가 질문과 관련이 있는지 평가합니다.\n", " \"\"\"\n", " # 관련성 평가기를 생성합니다.\n", - " # When using an OpenAI key, change to models like gpt-5.4-mini, gpt-5.4-nano etc.\n", + " # When using an OpenAI key, change to models like gpt-5.6-luna, gpt-5.6-terra-nano etc.\n", " question_retrieval_relevant = GroundednessChecker(\n", - " llm=init_chat_model(\"gpt-5.4-mini\", temperature=0),\n", + " llm=init_chat_model(\"gpt-5.6-luna\", reasoning_effort=\"none\", temperature=0),\n", " target=\"question-retrieval\"\n", " ).create()\n", "\n", @@ -428,10 +428,10 @@ ")\n", "\n", "# 쿼리 재작성 체인 생성 (프롬프트 -> LLM -> 문자열 파싱)\n", - "# When using an OpenAI key, change to models like gpt-5.4-mini, gpt-5.4-nano etc.\n", + "# When using an OpenAI key, change to models like gpt-5.6-luna, gpt-5.6-terra-nano etc.\n", "question_rewriter = (\n", " re_write_prompt\n", - " | init_chat_model(\"gpt-5.4-mini\", temperature=0)\n", + " | init_chat_model(\"gpt-5.6-luna\", reasoning_effort=\"none\", temperature=0)\n", " | StrOutputParser()\n", ")" ] diff --git "a/Appendix/A-RAG\354\235\221\354\232\251/06-LangGraph-Agentic-RAG.ipynb" "b/Appendix/A-RAG\354\235\221\354\232\251/06-LangGraph-Agentic-RAG.ipynb" index 5432ad2..830d0b3 100644 --- "a/Appendix/A-RAG\354\235\221\354\232\251/06-LangGraph-Agentic-RAG.ipynb" +++ "b/Appendix/A-RAG\354\235\221\354\232\251/06-LangGraph-Agentic-RAG.ipynb" @@ -208,8 +208,8 @@ "ls_client = Client()\n", "\n", "# 사용할 모델을 정의합니다.\n", - "# 다른 모델을 사용하려면 gpt-5.4-mini, claude-sonnet-5 등으로 변경하세요\n", - "MODEL_NAME = \"gpt-5.4\"\n", + "# 모델 등급: gpt-5.6-sol(high) / gpt-5.6-terra(medium) / gpt-5.6-luna(low)\n", + "MODEL_NAME = \"gpt-5.6-terra\"\n", "\n", "\n", "# 관련성 평가를 위한 데이터 모델\n", @@ -224,7 +224,7 @@ "def grade_documents(state) -> Literal[\"generate\", \"rewrite\"]:\n", " \"\"\"검색된 문서의 관련성을 평가하는 함수입니다.\"\"\"\n", " # LLM 초기화\n", - " model = init_chat_model(MODEL_NAME, temperature=0)\n", + " model = init_chat_model(MODEL_NAME, reasoning_effort=\"none\", temperature=0)\n", "\n", " # 구조화된 출력을 위한 LLM 설정\n", " llm_with_tool = model.with_structured_output(GradeDocuments)\n", @@ -266,7 +266,7 @@ " messages = state[\"messages\"]\n", "\n", " # LLM 초기화 및 도구 바인딩\n", - " model = init_chat_model(MODEL_NAME, temperature=0)\n", + " model = init_chat_model(MODEL_NAME, reasoning_effort=\"none\", temperature=0)\n", " model = model.bind_tools(tools)\n", "\n", " # 에이전트 응답 생성\n", @@ -295,7 +295,7 @@ " ]\n", "\n", " # LLM으로 질문 개선\n", - " model = init_chat_model(MODEL_NAME, temperature=0)\n", + " model = init_chat_model(MODEL_NAME, reasoning_effort=\"none\", temperature=0)\n", " response = model.invoke(msg)\n", "\n", " return {\"messages\": [response]}\n", @@ -308,10 +308,10 @@ " docs = messages[-1].content\n", "\n", " # LangSmith 허브에서 RAG 프롬프트 가져오기\n", - " prompt = ls_client.pull_prompt(\"teddynote/rag-prompt\")\n", + " prompt = ls_client.pull_prompt(\"teddynote/rag-prompt\", dangerously_pull_public_prompt=True)\n", "\n", " # LLM 초기화 및 체인 구성\n", - " llm = init_chat_model(MODEL_NAME, temperature=0)\n", + " llm = init_chat_model(MODEL_NAME, reasoning_effort=\"none\", temperature=0)\n", " rag_chain = prompt | llm | StrOutputParser()\n", "\n", " # 답변 생성\n", diff --git "a/Appendix/A-RAG\354\235\221\354\232\251/07-LangGraph-CRAG.ipynb" "b/Appendix/A-RAG\354\235\221\354\232\251/07-LangGraph-CRAG.ipynb" index 65e6d81..3703779 100644 --- "a/Appendix/A-RAG\354\235\221\354\232\251/07-LangGraph-CRAG.ipynb" +++ "b/Appendix/A-RAG\354\235\221\354\232\251/07-LangGraph-CRAG.ipynb" @@ -174,8 +174,8 @@ "\n", "\n", "# LLM 초기화\n", - "# 다른 모델을 사용하려면 gpt-5.4-mini, claude-sonnet-5 등으로 변경 가능합니다.\n", - "llm = init_chat_model(\"gpt-5.4\", temperature=0)\n", + "# 모델 등급: gpt-5.6-sol(high) / gpt-5.6-terra(medium) / gpt-5.6-luna(low)합니다.\n", + "llm = init_chat_model(\"gpt-5.6-terra\", reasoning_effort=\"none\", temperature=0)\n", "# 구조화된 출력을 생성하는 LLM\n", "structured_llm_grader = llm.with_structured_output(GradeDocuments)\n", "\n", @@ -284,11 +284,11 @@ "from langchain_core.output_parsers import StrOutputParser\n", "\n", "# LangChain Hub에서 프롬프트 가져오기\n", - "prompt = Client().pull_prompt(\"teddynote/rag-prompt\")\n", + "prompt = Client().pull_prompt(\"teddynote/rag-prompt\", dangerously_pull_public_prompt=True)\n", "\n", "# LLM 초기화\n", - "# 다른 모델을 사용하려면 gpt-5.4-mini, claude-sonnet-5 등으로 변경 가능합니다.\n", - "llm = init_chat_model(\"gpt-5.4\", temperature=0)\n", + "# 모델 등급: gpt-5.6-sol(high) / gpt-5.6-terra(medium) / gpt-5.6-luna(low)합니다.\n", + "llm = init_chat_model(\"gpt-5.6-terra\", reasoning_effort=\"none\", temperature=0)\n", "\n", "# 문서 포맷팅 함수\n", "def format_docs(docs):\n", @@ -332,8 +332,8 @@ "from langchain_core.output_parsers import StrOutputParser\n", "\n", "# LLM 설정\n", - "# 다른 모델을 사용하려면 gpt-5.4-mini, claude-sonnet-5 등으로 변경 가능합니다.\n", - "llm = init_chat_model(\"gpt-5.4\", temperature=0)\n", + "# 모델 등급: gpt-5.6-sol(high) / gpt-5.6-terra(medium) / gpt-5.6-luna(low)합니다.\n", + "llm = init_chat_model(\"gpt-5.6-terra\", reasoning_effort=\"none\", temperature=0)\n", "\n", "# Query Rewrite 시스템 프롬프트\n", "system = \"\"\"You a question re-writer that converts an input question to a better version that is optimized \n", diff --git "a/Appendix/A-RAG\354\235\221\354\232\251/08-LangGraph-Self-RAG.ipynb" "b/Appendix/A-RAG\354\235\221\354\232\251/08-LangGraph-Self-RAG.ipynb" index b88123b..274c4a0 100644 --- "a/Appendix/A-RAG\354\235\221\354\232\251/08-LangGraph-Self-RAG.ipynb" +++ "b/Appendix/A-RAG\354\235\221\354\232\251/08-LangGraph-Self-RAG.ipynb" @@ -225,8 +225,8 @@ "\n", "\n", "# LLM 초기화\n", - "# OpenAI 키를 사용하는 경우 gpt-5.4-mini, gpt-5.4 등의 모델로 변경하세요.\n", - "llm = init_chat_model(\"gpt-5.4\", temperature=0)\n", + "# OpenAI 키를 사용하는 경우 gpt-5.6-luna, gpt-5.6-terra 등의 모델로 변경하세요.\n", + "llm = init_chat_model(\"gpt-5.6-terra\", reasoning_effort=\"none\", temperature=0)\n", "\n", "# GradeDocuments 데이터 모델을 사용하여 LLM의 구조화된 출력 생성\n", "structured_llm_grader = llm.with_structured_output(GradeDocuments)\n", @@ -319,7 +319,7 @@ "from langchain_core.output_parsers import StrOutputParser\n", "\n", "# LangChain Hub에서 프롬프트 가져오기\n", - "prompt = Client().pull_prompt(\"teddynote/rag-prompt\")\n", + "prompt = Client().pull_prompt(\"teddynote/rag-prompt\", dangerously_pull_public_prompt=True)\n", "\n", "# 문서 포맷팅 함수\n", "def format_docs(docs):\n", diff --git "a/Appendix/A-RAG\354\235\221\354\232\251/09-LangGraph-Adaptive-RAG.ipynb" "b/Appendix/A-RAG\354\235\221\354\232\251/09-LangGraph-Adaptive-RAG.ipynb" index 5b7b316..eab352e 100644 --- "a/Appendix/A-RAG\354\235\221\354\232\251/09-LangGraph-Adaptive-RAG.ipynb" +++ "b/Appendix/A-RAG\354\235\221\354\232\251/09-LangGraph-Adaptive-RAG.ipynb" @@ -203,8 +203,8 @@ " )\n", "\n", "\n", - "# LLM 초기화 (OpenAI 키 사용 시 gpt-5.4, gpt-5.4-mini 등의 모델로 변경하세요.)\n", - "llm = init_chat_model(\"gpt-5.4\")\n", + "# LLM 초기화 (OpenAI 키 사용 시 gpt-5.6-terra, gpt-5.6-luna 등의 모델로 변경하세요.)\n", + "llm = init_chat_model(\"gpt-5.6-terra\", reasoning_effort=\"none\")\n", "# 구조화된 출력을 위한 라우터 LLM 설정\n", "structured_llm_router = llm.with_structured_output(RouteQuery)\n", "\n", @@ -310,8 +310,8 @@ " )\n", "\n", "\n", - "# LLM 초기화 (OpenAI 키 사용 시 gpt-5.4, gpt-5.4-mini 등의 모델로 변경하세요.)\n", - "llm = init_chat_model(\"gpt-5.4\")\n", + "# LLM 초기화 (OpenAI 키 사용 시 gpt-5.6-terra, gpt-5.6-luna 등의 모델로 변경하세요.)\n", + "llm = init_chat_model(\"gpt-5.6-terra\", reasoning_effort=\"none\")\n", "# 구조화된 출력을 위한 평가기 LLM 설정\n", "structured_llm_grader = llm.with_structured_output(GradeDocuments)\n", "\n", @@ -422,10 +422,10 @@ "from langchain.chat_models import init_chat_model\n", "\n", "# LangSmith Client를 사용하여 프롬프트 가져오기(RAG 프롬프트는 자유롭게 수정 가능)\n", - "prompt = Client().pull_prompt(\"teddynote/rag-prompt\")\n", + "prompt = Client().pull_prompt(\"teddynote/rag-prompt\", dangerously_pull_public_prompt=True)\n", "\n", - "# LLM 초기화 (OpenAI 키 사용 시 gpt-5.4, gpt-5.4-mini 등의 모델로 변경하세요.)\n", - "llm = init_chat_model(\"gpt-5.4\")\n", + "# LLM 초기화 (OpenAI 키 사용 시 gpt-5.6-terra, gpt-5.6-luna 등의 모델로 변경하세요.)\n", + "llm = init_chat_model(\"gpt-5.6-terra\", reasoning_effort=\"none\")\n", "\n", "\n", "def format_docs(docs):\n", @@ -512,8 +512,8 @@ " )\n", "\n", "\n", - "# LLM 초기화 (OpenAI 키 사용 시 gpt-5.4, gpt-5.4-mini 등의 모델로 변경하세요.)\n", - "llm = init_chat_model(\"gpt-5.4\")\n", + "# LLM 초기화 (OpenAI 키 사용 시 gpt-5.6-terra, gpt-5.6-luna 등의 모델로 변경하세요.)\n", + "llm = init_chat_model(\"gpt-5.6-terra\", reasoning_effort=\"none\")\n", "# 구조화된 출력을 위한 평가기 LLM 설정\n", "structured_llm_grader = llm.with_structured_output(GradeHallucinations)\n", "\n", @@ -597,8 +597,8 @@ " )\n", "\n", "\n", - "# LLM 초기화 (OpenAI 키 사용 시 gpt-5.4, gpt-5.4-mini 등의 모델로 변경하세요.)\n", - "llm = init_chat_model(\"gpt-5.4\")\n", + "# LLM 초기화 (OpenAI 키 사용 시 gpt-5.6-terra, gpt-5.6-luna 등의 모델로 변경하세요.)\n", + "llm = init_chat_model(\"gpt-5.6-terra\", reasoning_effort=\"none\")\n", "# 구조화된 출력을 위한 평가기 LLM 설정\n", "structured_llm_grader = llm.with_structured_output(GradeAnswer)\n", "\n", @@ -663,8 +663,8 @@ "from langchain_core.output_parsers import StrOutputParser\n", "from langchain.chat_models import init_chat_model\n", "\n", - "# LLM 초기화 (OpenAI 키 사용 시 gpt-5.4, gpt-5.4-mini 등의 모델로 변경하세요.)\n", - "llm = init_chat_model(\"gpt-5.4\")\n", + "# LLM 초기화 (OpenAI 키 사용 시 gpt-5.6-terra, gpt-5.6-luna 등의 모델로 변경하세요.)\n", + "llm = init_chat_model(\"gpt-5.6-terra\", reasoning_effort=\"none\")\n", "\n", "# Query Rewriter 프롬프트 정의(자유롭게 수정이 가능합니다)\n", "system = \"\"\"You a question re-writer that converts an input question to a better version that is optimized \\n \n", diff --git "a/Appendix/A-RAG\354\235\221\354\232\251/10-LangGraph-Retrieval.ipynb" "b/Appendix/A-RAG\354\235\221\354\232\251/10-LangGraph-Retrieval.ipynb" index e3dd377..aa6c7cc 100644 --- "a/Appendix/A-RAG\354\235\221\354\232\251/10-LangGraph-Retrieval.ipynb" +++ "b/Appendix/A-RAG\354\235\221\354\232\251/10-LangGraph-Retrieval.ipynb" @@ -273,8 +273,8 @@ "\n", "prompt = ChatPromptTemplate.from_template(template)\n", "\n", - "# LLM 초기화 (OpenAI 키 사용 시 gpt-5.4-mini 등으로 변경하세요)\n", - "llm = init_chat_model(\"gpt-5.4\", temperature=0)\n", + "# LLM 초기화 (OpenAI 키 사용 시 gpt-5.6-luna 등으로 변경하세요)\n", + "llm = init_chat_model(\"gpt-5.6-terra\", reasoning_effort=\"none\", temperature=0)\n", "\n", "\n", "def format_docs(docs):\n", diff --git "a/Appendix/A-RAG\354\235\221\354\232\251/rag/base.py" "b/Appendix/A-RAG\354\235\221\354\232\251/rag/base.py" index 2b2eb67..7a79028 100644 --- "a/Appendix/A-RAG\354\235\221\354\232\251/rag/base.py" +++ "b/Appendix/A-RAG\354\235\221\354\232\251/rag/base.py" @@ -14,7 +14,7 @@ class RetrievalChain(ABC): def __init__(self): self.source_uri = None self.k = 8 - self.model_name = "gpt-5.4" # 다른 모델을 사용하려면 gpt-5.4-mini, claude-sonnet-5 등으로 변경 + self.model_name = "gpt-5.6-terra" # 모델 등급: gpt-5.6-sol(high) / gpt-5.6-terra(medium) / gpt-5.6-luna(low) self.temperature = 0 self.prompt = "teddynote/rag-prompt" self.embeddings = "text-embedding-3-small" @@ -103,12 +103,13 @@ def create_retriever(self, vectorstore): def create_model(self): # LangChain v1 방식: init_chat_model로 모델 초기화 - # 다른 모델을 사용하려면 gpt-5.4-mini, claude-sonnet-5 등으로 변경 - return init_chat_model(self.model_name, temperature=self.temperature) + # 모델 등급: gpt-5.6-sol(high) / gpt-5.6-terra(medium) / gpt-5.6-luna(low) + return init_chat_model(self.model_name, reasoning_effort="none", temperature=self.temperature) def create_prompt(self): # LangSmith Client를 사용하여 프롬프트 로드 - return Client().pull_prompt(self.prompt) + # langsmith>=0.8: 공개 프롬프트(owner/name) 를 가져오려면 명시적 동의 플래그가 필요합니다 + return Client().pull_prompt(self.prompt, dangerously_pull_public_prompt=True) def create_chain(self): docs = self.load_documents(self.source_uri) diff --git a/Appendix/B-Use-Cases/01-LangGraph-Agent-Simulation.ipynb b/Appendix/B-Use-Cases/01-LangGraph-Agent-Simulation.ipynb index 216a282..d4ac3ca 100644 --- a/Appendix/B-Use-Cases/01-LangGraph-Agent-Simulation.ipynb +++ b/Appendix/B-Use-Cases/01-LangGraph-Agent-Simulation.ipynb @@ -145,7 +145,7 @@ " ]\n", " )\n", " # 모델 초기화\n", - " model = init_chat_model(\"gpt-5.4\", temperature=0.6)\n", + " model = init_chat_model(\"gpt-5.6-terra\", reasoning_effort=\"none\", temperature=0.6)\n", " chain = prompt | model | StrOutputParser()\n", " return chain.invoke({\"messages\": messages})" ] @@ -256,7 +256,7 @@ "outputs": [], "source": [ "# 챗봇 모델을 초기화합니다.\n", - "model = init_chat_model(\"gpt-5.4\", temperature=0.6)\n", + "model = init_chat_model(\"gpt-5.6-terra\", reasoning_effort=\"none\", temperature=0.6)\n", "\n", "# 시뮬레이션된 사용자 대화를 생성합니다.\n", "simulated_user = create_scenario(name, instructions) | model | StrOutputParser()" diff --git a/Appendix/B-Use-Cases/02-LangGraph-Prompt-Generation.ipynb b/Appendix/B-Use-Cases/02-LangGraph-Prompt-Generation.ipynb index b1c7ed8..842c9b4 100644 --- a/Appendix/B-Use-Cases/02-LangGraph-Prompt-Generation.ipynb +++ b/Appendix/B-Use-Cases/02-LangGraph-Prompt-Generation.ipynb @@ -207,8 +207,8 @@ "\n", "\n", "# LLM 초기화\n", - "# OpenAI 키를 사용하는 경우 gpt-5.4-mini, gpt-5.4 등의 모델로 변경하세요.\n", - "llm = init_chat_model(\"gpt-5.4\", temperature=0)\n", + "# OpenAI 키를 사용하는 경우 gpt-5.6-luna, gpt-5.6-terra 등의 모델로 변경하세요.\n", + "llm = init_chat_model(\"gpt-5.6-terra\", reasoning_effort=\"none\", temperature=0)\n", "\n", "# PromptInstructions 구조체를 바인딩\n", "llm_with_tool = llm.bind_tools([PromptInstructions])\n", diff --git a/Appendix/B-Use-Cases/03-LangGraph-Plan-and-Execute.ipynb b/Appendix/B-Use-Cases/03-LangGraph-Plan-and-Execute.ipynb index 09c2e94..84d53f0 100644 --- a/Appendix/B-Use-Cases/03-LangGraph-Plan-and-Execute.ipynb +++ b/Appendix/B-Use-Cases/03-LangGraph-Plan-and-Execute.ipynb @@ -143,10 +143,10 @@ "from langchain.chat_models import init_chat_model\n", "\n", "# 계획(Plan) 및 재계획(Re-Plan) 단계에서 사용할 모델\n", - "PLANNER_MODEL = \"gpt-5.4\"\n", + "PLANNER_MODEL = \"gpt-5.6-terra\"\n", "\n", "# 실행(Execute) 단계에서 사용할 모델\n", - "EXECUTOR_MODEL = \"gpt-5.4-mini\"\n", + "EXECUTOR_MODEL = \"gpt-5.6-luna\"\n", "\n", "print(f\"Planner Model: {PLANNER_MODEL}\")\n", "print(f\"Executor Model: {EXECUTOR_MODEL}\")" @@ -206,7 +206,7 @@ "# ReAct 에이전트 생성 (실행 단계에서는 가벼운 모델 사용)\n", "# system_prompt를 사용하여 시스템 프롬프트를 설정합니다.\n", "agent_executor = create_agent(\n", - " init_chat_model(EXECUTOR_MODEL, temperature=0),\n", + " init_chat_model(EXECUTOR_MODEL, reasoning_effort=\"none\", temperature=0),\n", " tools,\n", " system_prompt=system_prompt,\n", ")" @@ -332,7 +332,7 @@ "\n", "# 계획 단계에서는 추론 능력이 뛰어난 모델 사용\n", "planner = planner_prompt | init_chat_model(\n", - " PLANNER_MODEL, temperature=0\n", + " PLANNER_MODEL, reasoning_effort=\"none\", temperature=0\n", ").with_structured_output(Plan)" ] }, @@ -450,7 +450,7 @@ "\n", "# 재계획 단계에서도 추론 능력이 뛰어난 모델 사용\n", "replanner = replanner_prompt | init_chat_model(\n", - " PLANNER_MODEL, temperature=0\n", + " PLANNER_MODEL, reasoning_effort=\"none\", temperature=0\n", ").with_structured_output(Act)" ] }, @@ -548,7 +548,7 @@ "# 최종 보고서 생성에는 추론 능력이 뛰어난 모델 사용\n", "final_report = (\n", " final_report_prompt\n", - " | init_chat_model(PLANNER_MODEL, temperature=0)\n", + " | init_chat_model(PLANNER_MODEL, reasoning_effort=\"none\", temperature=0)\n", " | StrOutputParser()\n", ")\n", "\n", diff --git a/Appendix/B-Use-Cases/04-LangGraph-SQL-Agent.ipynb b/Appendix/B-Use-Cases/04-LangGraph-SQL-Agent.ipynb index de70656..f83852e 100644 --- a/Appendix/B-Use-Cases/04-LangGraph-SQL-Agent.ipynb +++ b/Appendix/B-Use-Cases/04-LangGraph-SQL-Agent.ipynb @@ -104,8 +104,8 @@ "source": [ "from langchain.chat_models import init_chat_model\n", "\n", - "# OpenAI 키를 사용하는 경우 gpt-5.4, gpt-5.4-mini 등의 모델로 변경하세요\n", - "llm = init_chat_model(\"gpt-5.4\", temperature=0)" + "# OpenAI 키를 사용하는 경우 gpt-5.6-terra, gpt-5.6-luna 등의 모델로 변경하세요\n", + "llm = init_chat_model(\"gpt-5.6-terra\", reasoning_effort=\"none\", temperature=0)" ] }, { @@ -317,8 +317,8 @@ "from langchain.chat_models import init_chat_model\n", "\n", "# SQLDatabaseToolkit 생성\n", - "# OpenAI 키를 사용하는 경우 gpt-5.4-mini 등의 모델로 변경하세요\n", - "toolkit = SQLDatabaseToolkit(db=db, llm=init_chat_model(\"gpt-5.4\"))\n", + "# OpenAI 키를 사용하는 경우 gpt-5.6-luna 등의 모델로 변경하세요\n", + "toolkit = SQLDatabaseToolkit(db=db, llm=init_chat_model(\"gpt-5.6-terra\", reasoning_effort=\"none\"))\n", "\n", "# SQLDatabaseToolkit에서 사용 가능한 도구 목록\n", "tools = toolkit.get_tools()\n", @@ -514,10 +514,10 @@ " [(\"system\", query_check_system), (\"placeholder\", \"{messages}\")]\n", ")\n", "\n", - "# OpenAI 키를 사용하는 경우 gpt-5.4-mini 등의 모델로 변경하세요\n", + "# OpenAI 키를 사용하는 경우 gpt-5.6-luna 등의 모델로 변경하세요\n", "# Query Checker 체인 생성\n", "query_check = query_check_prompt | init_chat_model(\n", - " \"gpt-5.4\", temperature=0\n", + " \"gpt-5.6-terra\", reasoning_effort=\"none\", temperature=0\n", ").bind_tools([db_query_tool], tool_choice=\"db_query_tool\")" ] }, @@ -646,8 +646,8 @@ "workflow.add_node(\"get_schema_tool\", create_tool_node_with_fallback([get_schema_tool]))\n", "\n", "# 질문과 사용 가능한 테이블을 기반으로 관련 테이블을 선택하는 모델 노드 추가\n", - "# OpenAI 키를 사용하는 경우 gpt-5.4, gpt-5.4-mini 등의 모델로 변경하세요\n", - "model_get_schema = init_chat_model(\"gpt-5.4\", temperature=0).bind_tools(\n", + "# OpenAI 키를 사용하는 경우 gpt-5.6-terra, gpt-5.6-luna 등의 모델로 변경하세요\n", + "model_get_schema = init_chat_model(\"gpt-5.6-terra\", reasoning_effort=\"none\", temperature=0).bind_tools(\n", " [get_schema_tool]\n", ")\n", "workflow.add_node(\n", @@ -685,10 +685,10 @@ " [(\"system\", QUERY_GEN_INSTRUCTION), (\"placeholder\", \"{messages}\")]\n", ")\n", "\n", - "# OpenAI 키를 사용하는 경우 gpt-5.4, gpt-5.4-mini 등의 모델로 변경하세요\n", + "# OpenAI 키를 사용하는 경우 gpt-5.6-terra, gpt-5.6-luna 등의 모델로 변경하세요\n", "# SubmitFinalAnswer 도구만 바인딩 (model_check_query는 도구가 아닌 노드 함수)\n", "query_gen = query_gen_prompt | init_chat_model(\n", - " \"gpt-5.4\", temperature=0\n", + " \"gpt-5.6-terra\", reasoning_effort=\"none\", temperature=0\n", ").bind_tools([SubmitFinalAnswer])\n", "\n", "\n", @@ -1323,9 +1323,9 @@ " # 예측 답변\n", " prediction = run.outputs[\"response\"]\n", "\n", - " # OpenAI 키를 사용하는 경우 gpt-5.4, gpt-5.4-mini 등의 모델로 변경하세요\n", + " # OpenAI 키를 사용하는 경우 gpt-5.6-terra, gpt-5.6-luna 등의 모델로 변경하세요\n", " # LLM 평가자 초기화 (structured output으로 점수를 안정적으로 추출)\n", - " llm = init_chat_model(\"gpt-5.4\", temperature=0)\n", + " llm = init_chat_model(\"gpt-5.6-terra\", reasoning_effort=\"none\", temperature=0)\n", " answer_grader = grade_prompt_answer_accuracy | llm.with_structured_output(\n", " GradeAnswer\n", " )\n", @@ -1395,7 +1395,7 @@ " num_repetitions=3, # 실험 반복 횟수 설정\n", " experiment_prefix=\"sql-agent-eval\",\n", " metadata={\n", - " \"version\": \"chinook db, sql-agent-eval: gpt-5.4\"\n", + " \"version\": \"chinook db, sql-agent-eval: gpt-5.6-terra\"\n", " }, # 실험 메타데이터\n", " )\n", "except Exception as e:\n", diff --git a/Appendix/B-Use-Cases/05-LangGraph-Research-Assistant.ipynb b/Appendix/B-Use-Cases/05-LangGraph-Research-Assistant.ipynb index b0e909e..0d5c11b 100644 --- a/Appendix/B-Use-Cases/05-LangGraph-Research-Assistant.ipynb +++ b/Appendix/B-Use-Cases/05-LangGraph-Research-Assistant.ipynb @@ -125,8 +125,8 @@ "from langchain.chat_models import init_chat_model\n", "\n", "# 모델 초기화\n", - "# When using an OpenAI key, change to models like gpt-5.4-mini, gpt-5.4-nano etc.\n", - "llm = init_chat_model(\"gpt-5.4\")" + "# When using an OpenAI key, change to models like gpt-5.6-luna, gpt-5.6-terra-nano etc.\n", + "llm = init_chat_model(\"gpt-5.6-terra\", reasoning_effort=\"none\")" ] }, { diff --git a/Appendix/B-Use-Cases/rag/base.py b/Appendix/B-Use-Cases/rag/base.py index 3f0f5ec..558fe93 100644 --- a/Appendix/B-Use-Cases/rag/base.py +++ b/Appendix/B-Use-Cases/rag/base.py @@ -13,7 +13,7 @@ class RetrievalChain(ABC): def __init__(self): self.source_uri = None self.k = 8 - self.model_name = "gpt-5.4-mini" + self.model_name = "gpt-5.6-luna" self.temperature = 0 self.prompt = "teddynote/rag-prompt" self.embeddings = "text-embedding-3-small" @@ -101,10 +101,11 @@ def create_retriever(self, vectorstore): return dense_retriever def create_model(self): - return ChatOpenAI(model_name=self.model_name, temperature=self.temperature) + return ChatOpenAI(model_name=self.model_name, reasoning_effort="none", temperature=self.temperature) def create_prompt(self): - return Client().pull_prompt(self.prompt) + # langsmith>=0.8: 공개 프롬프트(owner/name) 를 가져오려면 명시적 동의 플래그가 필요합니다 + return Client().pull_prompt(self.prompt, dangerously_pull_public_prompt=True) def create_chain(self): docs = self.load_documents(self.source_uri) diff --git a/Appendix/C-GraphRAG/01-LangGraph-Text2Cypher-Neo4j.ipynb b/Appendix/C-GraphRAG/01-LangGraph-Text2Cypher-Neo4j.ipynb index 759c52b..96de055 100644 --- a/Appendix/C-GraphRAG/01-LangGraph-Text2Cypher-Neo4j.ipynb +++ b/Appendix/C-GraphRAG/01-LangGraph-Text2Cypher-Neo4j.ipynb @@ -381,8 +381,8 @@ "source": [ "from langchain.chat_models import init_chat_model\n", "\n", - "# OpenAI 키를 사용하는 경우 gpt-5.4-mini, gpt-5.4 등의 모델로 변경하세요.\n", - "llm = init_chat_model(\"gpt-5.4\", temperature=0)" + "# OpenAI 키를 사용하는 경우 gpt-5.6-luna, gpt-5.6-terra 등의 모델로 변경하세요.\n", + "llm = init_chat_model(\"gpt-5.6-terra\", reasoning_effort=\"none\", temperature=0)" ] }, { diff --git "a/PART01-LangGraph-\352\270\260\354\264\210/Ch01-\352\267\270\353\236\230\355\224\204-\354\203\235\354\204\261\355\225\230\352\270\260/01-LangGraph-Models.ipynb" "b/PART01-LangGraph-\352\270\260\354\264\210/Ch01-\352\267\270\353\236\230\355\224\204-\354\203\235\354\204\261\355\225\230\352\270\260/01-LangGraph-Models.ipynb" index ee11d3d..2553845 100644 --- "a/PART01-LangGraph-\352\270\260\354\264\210/Ch01-\352\267\270\353\236\230\355\224\204-\354\203\235\354\204\261\355\225\230\352\270\260/01-LangGraph-Models.ipynb" +++ "b/PART01-LangGraph-\352\270\260\354\264\210/Ch01-\352\267\270\353\236\230\355\224\204-\354\203\235\354\204\261\355\225\230\352\270\260/01-LangGraph-Models.ipynb" @@ -77,8 +77,19 @@ "source": [ "from langchain.chat_models import init_chat_model\n", "\n", - "# To use another model, change to gpt-5.4-mini, claude-sonnet-5 etc.\n", - "model = init_chat_model(\"gpt-5.4\")" + "# Model tiers: gpt-5.6-sol (high) / gpt-5.6-terra (medium) / gpt-5.6-luna (low)\n", + "model = init_chat_model(\"gpt-5.6-terra\", reasoning_effort=\"none\")" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "> **`reasoning_effort=\"none\"` 에 대하여**\n", + ">\n", + "> 이 튜토리얼의 모든 실습은 OpenAI **gpt-5.6 계열**(`gpt-5.6-sol` high / `gpt-5.6-terra` medium / `gpt-5.6-luna` low)을 사용하며, 대부분은 medium 또는 low 등급을 씁니다.\n", + "> gpt-5.6 계열은 기본적으로 추론(reasoning) 모드로 동작하는데, Chat Completions API 에서는 **추론이 켜진 상태로 함수 도구(tool calling)를 사용할 수 없습니다** (`Function tools with reasoning_effort are not supported ... set reasoning_effort to 'none'` 오류).\n", + "> 따라서 실습 코드는 모델을 만들 때 `reasoning_effort=\"none\"` 을 지정하여 추론을 끄고 도구 호출·스트리밍·구조화된 출력을 그대로 사용합니다. 추론을 켠 채로 도구를 쓰려면 `init_chat_model(..., use_responses_api=True)` 로 Responses API 를 사용하면 되지만, 이 경우 `response.content` 가 문자열이 아닌 콘텐츠 블록 리스트로 바뀝니다.\n" ] }, { @@ -113,7 +124,7 @@ "\n", "# 모델 인스턴스를 직접 초기화하여 더 세밀한 제어\n", "model = ChatOpenAI(\n", - " model=\"gpt-5.4\",\n", + " model=\"gpt-5.6-terra\", reasoning_effort=\"none\",\n", " temperature=0.1, # 응답의 무작위성 제어\n", " max_tokens=1000, # 최대 생성 토큰 수\n", " timeout=30, # 요청 타임아웃(초)\n", @@ -143,7 +154,7 @@ "source": [ "from langchain.chat_models import init_chat_model\n", "\n", - "model = init_chat_model(\"openai:gpt-5.4-mini\")" + "model = init_chat_model(\"openai:gpt-5.6-luna\", reasoning_effort=\"none\")" ] }, { @@ -671,9 +682,9 @@ "from langchain.chat_models import init_chat_model\n", "from langchain_core.callbacks import UsageMetadataCallbackHandler\n", "\n", - "# To use another model, change to gpt-5.4-mini, claude-sonnet-5 etc.\n", - "model_1 = init_chat_model(model=\"gpt-5.4\")\n", - "model_2 = init_chat_model(model=\"gpt-5.4-mini\")\n", + "# Model tiers: gpt-5.6-sol (high) / gpt-5.6-terra (medium) / gpt-5.6-luna (low)\n", + "model_1 = init_chat_model(model=\"gpt-5.6-terra\", reasoning_effort=\"none\")\n", + "model_2 = init_chat_model(model=\"gpt-5.6-luna\", reasoning_effort=\"none\")\n", "\n", "# 콜백 핸들러를 사용하여 토큰 사용량 추적\n", "callback = UsageMetadataCallbackHandler()\n", @@ -769,15 +780,16 @@ "source": [ "## 추론 강도 조절: reasoning_effort\n", "\n", - "OpenAI의 최신 모델(gpt-5 등)은 `reasoning_effort` 옵션을 통해 추론의 깊이를 조절할 수 있습니다. 복잡한 문제에는 더 깊은 추론을, 간단한 질문에는 빠른 응답을 설정할 수 있어 비용과 품질 사이의 균형을 맞출 수 있습니다.\n", + "OpenAI의 최신 모델(gpt-5.6 계열 등)은 `reasoning_effort` 옵션을 통해 추론의 깊이를 조절할 수 있습니다. 복잡한 문제에는 더 깊은 추론을, 간단한 질문에는 빠른 응답을 설정할 수 있어 비용과 품질 사이의 균형을 맞출 수 있습니다.\n", "\n", "**reasoning_effort 옵션:**\n", - "- `minimal`: 최소한의 추론 (가장 빠름)\n", + "- `none`: 추론 비활성화 (가장 빠름, 이 튜토리얼의 기본값)\n", + "- `minimal`: 최소한의 추론\n", "- `low`: 낮은 수준의 추론\n", "- `medium`: 중간 수준의 추론 (균형)\n", "- `high`: 깊은 추론 (가장 정확)\n", "\n", - "아래 코드는 medium 수준의 추론으로 모델을 설정하는 예시입니다." + "아래 코드는 high 등급 모델(`gpt-5.6-sol`)을 medium 수준의 추론으로 설정하는 예시입니다. (추론 모델은 `temperature` 를 무시하므로 지정하지 않습니다.)" ] }, { @@ -790,9 +802,8 @@ "\n", "# reasoning_effort는 OpenAI의 gpt-5 모델에서 지원됩니다\n", "model = ChatOpenAI(\n", - " model=\"gpt-5.4\",\n", - " temperature=0.1,\n", - " reasoning_effort=\"medium\", # \"minimal\", \"low\", \"medium\", \"high\"\n", + " model=\"gpt-5.6-sol\", # high 등급 모델에서 추론 강도를 조절하는 예시\n", + " reasoning_effort=\"medium\", # \"none\", \"low\", \"medium\", \"high\"\n", ")" ] }, @@ -845,9 +856,9 @@ "from langchain_teddynote.messages import stream_response\n", "from langchain.chat_models import init_chat_model\n", "\n", - "# To use another model, change to gpt-5.4-mini, claude-sonnet-5 etc.\n", + "# Model tiers: gpt-5.6-sol (high) / gpt-5.6-terra (medium) / gpt-5.6-luna (low)\n", "llm = init_chat_model(\n", - " model=\"gpt-5.4\",\n", + " model=\"gpt-5.6-terra\", reasoning_effort=\"none\",\n", " temperature=0.1,\n", ")\n", "\n", @@ -912,11 +923,11 @@ } ], "source": [ - "# 웹상의 이미지 URL\n", - "IMAGE_URL = \"https://wetalkotalk.oci.co.kr/images/sub/investment/graph_img_2022_kor.jpg\"\n", + "# 분석할 이미지 (로컬 파일 경로 또는 http(s) URL 모두 사용 가능)\n", + "IMAGE_PATH = \"assets/finance-statement-sample.png\"\n", "\n", - "# 웹 이미지를 직접 분석하여 스트리밍 응답 생성\n", - "answer = multimodal.stream(IMAGE_URL)\n", + "# 이미지를 분석하여 스트리밍 응답 생성\n", + "answer = multimodal.stream(IMAGE_PATH)\n", "\n", "# 실시간으로 이미지 분석 결과 출력\n", "stream_response(answer)" @@ -1057,8 +1068,8 @@ "\n", "# logprobs는 OpenAI 모델에서만 지원됩니다\n", "llm = ChatOpenAI(\n", - " temperature=0.1,\n", - " model=\"gpt-5.4\",\n", + " temperature=0.1, reasoning_effort=\"none\",\n", + " model=\"gpt-5.6-terra\",\n", ")\n", "\n", "logprobs_model = llm.bind(logprobs=True)\n", @@ -1159,7 +1170,7 @@ "source": [ "# model_kwargs 예시\n", "# model = ChatOpenAI(\n", - "# model=\"gpt-5.4\",\n", + "# model=\"gpt-5.6-terra\",\n", "# model_kwargs={\n", "# \"stream_options\": {\"include_usage\": True},\n", "# \"max_completion_tokens\": 300,\n", diff --git "a/PART01-LangGraph-\352\270\260\354\264\210/Ch01-\352\267\270\353\236\230\355\224\204-\354\203\235\354\204\261\355\225\230\352\270\260/01-QuickStart-LangGraph-Tutorial.ipynb" "b/PART01-LangGraph-\352\270\260\354\264\210/Ch01-\352\267\270\353\236\230\355\224\204-\354\203\235\354\204\261\355\225\230\352\270\260/01-QuickStart-LangGraph-Tutorial.ipynb" index 40d37b1..6ad3ebe 100644 --- "a/PART01-LangGraph-\352\270\260\354\264\210/Ch01-\352\267\270\353\236\230\355\224\204-\354\203\235\354\204\261\355\225\230\352\270\260/01-QuickStart-LangGraph-Tutorial.ipynb" +++ "b/PART01-LangGraph-\352\270\260\354\264\210/Ch01-\352\267\270\353\236\230\355\224\204-\354\203\235\354\204\261\355\225\230\352\270\260/01-QuickStart-LangGraph-Tutorial.ipynb" @@ -93,7 +93,7 @@ "from langchain.chat_models import init_chat_model\n", "\n", "# 모델 식별자 문자열을 사용한 간단한 방법\n", - "llm = init_chat_model(\"openai:gpt-5.4\")" + "llm = init_chat_model(\"openai:gpt-5.6-terra\", reasoning_effort=\"none\")" ] }, { @@ -496,7 +496,7 @@ "\n", "\n", "def create_memory_extractor(\n", - " model_name: Optional[str] = \"openai:gpt-5.4\",\n", + " model_name: Optional[str] = \"openai:gpt-5.6-terra\",\n", " system_prompt: Optional[str] = None,\n", ") -> any:\n", " \"\"\"메모리 추출기를 생성합니다.\n", @@ -538,7 +538,7 @@ " )\n", "\n", " # 모델 설정\n", - " model = init_chat_model(model_name)\n", + " model = init_chat_model(model_name, reasoning_effort=\"none\")\n", "\n", " # 메모리 추출 체인 생성\n", " memory_extractor = prompt | model | memory_parser\n", @@ -561,8 +561,8 @@ "from langchain_teddynote.memory import create_memory_extractor\n", "import uuid\n", "\n", - "model = init_chat_model(\"openai:gpt-5.4\")\n", - "memory_extractor = create_memory_extractor(model=\"openai:gpt-5.4\")\n", + "model = init_chat_model(\"openai:gpt-5.6-terra\", reasoning_effort=\"none\")\n", + "memory_extractor = create_memory_extractor(model=\"openai:gpt-5.6-terra\")\n", "\n", "\n", "def call_model(\n", @@ -1226,7 +1226,13 @@ { "cell_type": "markdown", "metadata": {}, - "source": "### 상태 이력 탐색\n\n`get_state_history`로 전체 상태 이력을 조회하고 롤백할 체크포인트를 선택합니다. 이력은 최신순으로 반환되며, 각 체크포인트에는 해당 시점의 상태 정보가 포함됩니다.\n\n아래 코드는 상태 이력을 조회하고 특정 조건(메시지 수가 6개)에 해당하는 체크포인트를 선택합니다." + "source": [ + "### 상태 이력 탐색\n", + "\n", + "`get_state_history`로 전체 상태 이력을 조회하고 롤백할 체크포인트를 선택합니다. 이력은 최신순으로 반환되며, 각 체크포인트에는 해당 시점의 상태 정보가 포함됩니다.\n", + "\n", + "아래 코드는 상태 이력을 조회하고, 가장 최근에 도구가 호출되기 직전(다음 노드가 `tools`)인 체크포인트를 선택합니다. 이 시점의 마지막 메시지는 도구 호출 정보를 담은 AI 메시지이므로, 이어지는 단계에서 검색어를 수정해 재실행할 수 있습니다." + ] }, { "cell_type": "code", @@ -1246,7 +1252,8 @@ " print(f\" 다음 노드: {state.next}\")\n", " print(f\" 체크포인트 ID: {state.config['configurable']['checkpoint_id']}\")\n", "\n", - " if len(state.values[\"messages\"]) == 6 and to_replay is None:\n", + " # 도구 호출 직전(다음 노드가 tools)인 가장 최근 체크포인트를 선택합니다\n", + " if state.next == (\"tools\",) and to_replay is None:\n", " print(\" 이 상태로 되돌아갈 예정\")\n", " display_message_tree(state.values[\"messages\"][-1])\n", " to_replay = state\n", diff --git "a/PART01-LangGraph-\352\270\260\354\264\210/Ch01-\352\267\270\353\236\230\355\224\204-\354\203\235\354\204\261\355\225\230\352\270\260/02-LangGraph-Messages.ipynb" "b/PART01-LangGraph-\352\270\260\354\264\210/Ch01-\352\267\270\353\236\230\355\224\204-\354\203\235\354\204\261\355\225\230\352\270\260/02-LangGraph-Messages.ipynb" index d58bd5a..fd73494 100644 --- "a/PART01-LangGraph-\352\270\260\354\264\210/Ch01-\352\267\270\353\236\230\355\224\204-\354\203\235\354\204\261\355\225\230\352\270\260/02-LangGraph-Messages.ipynb" +++ "b/PART01-LangGraph-\352\270\260\354\264\210/Ch01-\352\267\270\353\236\230\355\224\204-\354\203\235\354\204\261\355\225\230\352\270\260/02-LangGraph-Messages.ipynb" @@ -102,8 +102,8 @@ "from langchain.chat_models import init_chat_model\n", "from langchain.messages import HumanMessage, AIMessage, SystemMessage\n", "\n", - "# 다른 모델을 사용하려면 gpt-5.4-mini, claude-sonnet-5 등으로 변경 가능\n", - "model = init_chat_model(\"gpt-5.4\")\n", + "# 모델 등급: gpt-5.6-sol(high) / gpt-5.6-terra(medium) / gpt-5.6-luna(low)\n", + "model = init_chat_model(\"gpt-5.6-terra\", reasoning_effort=\"none\")\n", "\n", "# 메시지 객체 생성\n", "system_msg = SystemMessage(\"당신은 친절한 Assistant입니다.\")\n", @@ -832,8 +832,8 @@ "from langchain.messages import HumanMessage\n", "from langchain.chat_models import init_chat_model\n", "\n", - "# 다른 모델을 사용하려면 gpt-5.4-mini, claude-sonnet-5 등으로 변경 가능\n", - "model = init_chat_model(\"gpt-5.4\")\n", + "# 모델 등급: gpt-5.6-sol(high) / gpt-5.6-terra(medium) / gpt-5.6-luna(low)\n", + "model = init_chat_model(\"gpt-5.6-terra\", reasoning_effort=\"none\")\n", "\n", "# 문자열 콘텐츠\n", "human_message = HumanMessage(\"Hello, how are you?\")\n", @@ -846,7 +846,7 @@ " {\n", " \"type\": \"image_url\",\n", " \"image_url\": {\n", - " \"url\": \"https://blog.langchain.com/content/images/2023/09/image.png\"\n", + " \"url\": \"https://raw.githubusercontent.com/braincrew-lab/langgraph-v1-tutorial/main/assets/tool_message.png\"\n", " },\n", " },\n", " ]\n", @@ -921,7 +921,7 @@ " {\"type\": \"text\", \"text\": \"다음은 어떤 내용인지 설명해줘\"},\n", " {\n", " \"type\": \"image\",\n", - " \"url\": \"https://blog.langchain.com/content/images/2023/09/image.png\",\n", + " \"url\": \"https://raw.githubusercontent.com/braincrew-lab/langgraph-v1-tutorial/main/assets/tool_message.png\",\n", " },\n", " ]\n", ")\n", diff --git "a/PART01-LangGraph-\352\270\260\354\264\210/Ch01-\352\267\270\353\236\230\355\224\204-\354\203\235\354\204\261\355\225\230\352\270\260/02-QuickStart-LangGraph-Graph-API.ipynb" "b/PART01-LangGraph-\352\270\260\354\264\210/Ch01-\352\267\270\353\236\230\355\224\204-\354\203\235\354\204\261\355\225\230\352\270\260/02-QuickStart-LangGraph-Graph-API.ipynb" index b049775..58689f6 100644 --- "a/PART01-LangGraph-\352\270\260\354\264\210/Ch01-\352\267\270\353\236\230\355\224\204-\354\203\235\354\204\261\355\225\230\352\270\260/02-QuickStart-LangGraph-Graph-API.ipynb" +++ "b/PART01-LangGraph-\352\270\260\354\264\210/Ch01-\352\267\270\353\236\230\355\224\204-\354\203\235\354\204\261\355\225\230\352\270\260/02-QuickStart-LangGraph-Graph-API.ipynb" @@ -1703,7 +1703,7 @@ "import random\n", "\n", "# ChatGPT 모델 초기화\n", - "llm = ChatOpenAI(model=\"gpt-5.4-mini\", temperature=0.7)\n", + "llm = ChatOpenAI(model=\"gpt-5.6-luna\", reasoning_effort=\"none\", temperature=0.7)\n", "\n", "\n", "# State 정의\n", diff --git "a/PART01-LangGraph-\352\270\260\354\264\210/Ch01-\352\267\270\353\236\230\355\224\204-\354\203\235\354\204\261\355\225\230\352\270\260/assets/finance-statement-sample.png" "b/PART01-LangGraph-\352\270\260\354\264\210/Ch01-\352\267\270\353\236\230\355\224\204-\354\203\235\354\204\261\355\225\230\352\270\260/assets/finance-statement-sample.png" new file mode 100644 index 0000000..17f9b7d Binary files /dev/null and "b/PART01-LangGraph-\352\270\260\354\264\210/Ch01-\352\267\270\353\236\230\355\224\204-\354\203\235\354\204\261\355\225\230\352\270\260/assets/finance-statement-sample.png" differ diff --git "a/PART02-\354\227\220\354\235\264\354\240\204\355\212\270/Ch02-\354\227\220\354\235\264\354\240\204\355\212\270/01-LangGraph-Agents.ipynb" "b/PART02-\354\227\220\354\235\264\354\240\204\355\212\270/Ch02-\354\227\220\354\235\264\354\240\204\355\212\270/01-LangGraph-Agents.ipynb" index 0ff4642..425a8f1 100644 --- "a/PART02-\354\227\220\354\235\264\354\240\204\355\212\270/Ch02-\354\227\220\354\235\264\354\240\204\355\212\270/01-LangGraph-Agents.ipynb" +++ "b/PART02-\354\227\220\354\235\264\354\240\204\355\212\270/Ch02-\354\227\220\354\235\264\354\240\204\355\212\270/01-LangGraph-Agents.ipynb" @@ -82,11 +82,11 @@ "from langchain.chat_models import init_chat_model\n", "\n", "# 방법 1: 문자열 식별자를 직접 전달 (빠른 프로토타이핑에 적합)\n", - "# agent = create_agent(\"openai:gpt-5.4\", tools=[])\n", + "# agent = create_agent(\"openai:gpt-5.6-terra\", tools=[])\n", "\n", "# 방법 2: init_chat_model로 모델 인스턴스 생성 후 전달\n", - "# 다른 모델을 사용하려면 gpt-5.4-mini, claude-sonnet-5 등으로 변경하세요\n", - "model = init_chat_model(\"gpt-5.4\")\n", + "# 모델 등급: gpt-5.6-sol(high) / gpt-5.6-terra(medium) / gpt-5.6-luna(low)\n", + "model = init_chat_model(\"gpt-5.6-terra\", reasoning_effort=\"none\")\n", "\n", "# 모델 인스턴스를 사용하여 에이전트 생성\n", "agent = create_agent(model, tools=[])" @@ -126,7 +126,7 @@ "# 방법 1: init_chat_model에 추가 옵션 전달\n", "# Provider에 관계없이 동일한 인터페이스로 사용 가능\n", "model = init_chat_model(\n", - " \"gpt-5.4\", # 다른 모델을 사용하려면 gpt-5.4-mini, claude-sonnet-5 등으로 변경하세요\n", + " \"gpt-5.6-terra\", reasoning_effort=\"none\", # 모델 등급: gpt-5.6-sol(high) / gpt-5.6-terra(medium) / gpt-5.6-luna(low)\n", " temperature=0.1, # 응답의 무작위성 제어\n", " max_tokens=1000, # 최대 생성 토큰 수\n", " timeout=30, # 요청 타임아웃(초)\n", @@ -147,7 +147,7 @@ "# from langchain_openai import ChatOpenAI # Anthropic 사용 시\n", "\n", "model = ChatOpenAI(\n", - " model=\"gpt-5.4\",\n", + " model=\"gpt-5.6-terra\", reasoning_effort=\"none\",\n", " temperature=0.1,\n", " max_tokens=1000,\n", " timeout=30,\n", @@ -191,8 +191,8 @@ "from langchain.agents.middleware import wrap_model_call, ModelRequest, ModelResponse\n", "\n", "# 기본 모델과 고급 모델 정의\n", - "basic_model = init_chat_model(\"gpt-5.4-mini\")\n", - "advanced_model = init_chat_model(\"gpt-5.4\")\n", + "basic_model = init_chat_model(\"gpt-5.6-luna\", reasoning_effort=\"none\")\n", + "advanced_model = init_chat_model(\"gpt-5.6-terra\", reasoning_effort=\"none\")\n", "\n", "\n", "@wrap_model_call\n", @@ -502,8 +502,8 @@ "metadata": {}, "outputs": [], "source": [ - "# 다른 모델을 사용하려면 gpt-5.4-mini, claude-sonnet-5 등으로 변경하세요\n", - "model = init_chat_model(\"gpt-5.4\")\n", + "# 모델 등급: gpt-5.6-sol(high) / gpt-5.6-terra(medium) / gpt-5.6-luna(low)\n", + "model = init_chat_model(\"gpt-5.6-terra\", reasoning_effort=\"none\")\n", "\n", "agent = create_agent(\n", " model,\n", @@ -728,8 +728,8 @@ " f\"\\033[95m\\n\\n모델 호출 전 메시지 {len(state['messages'])}개가 있습니다\\033[0m\"\n", " )\n", " last_message = state[\"messages\"][-1].content\n", - " # 다른 모델을 사용하려면 gpt-5.4-mini, claude-sonnet-5 등으로 변경하세요\n", - " llm = init_chat_model(\"gpt-5.4\")\n", + " # 모델 등급: gpt-5.6-sol(high) / gpt-5.6-terra(medium) / gpt-5.6-luna(low)\n", + " llm = init_chat_model(\"gpt-5.6-terra\", reasoning_effort=\"none\")\n", "\n", " query_rewrite = (\n", " PromptTemplate.from_template(\n", @@ -910,9 +910,9 @@ "metadata": {}, "outputs": [], "source": [ - "# 다른 모델을 사용하려면 gpt-5.4-mini, claude-sonnet-5 등으로 변경하세요\n", + "# 모델 등급: gpt-5.6-sol(high) / gpt-5.6-terra(medium) / gpt-5.6-luna(low)\n", "# 일부러 존재하지 않는 모델명을 사용하여 재시도 로직을 테스트합니다\n", - "model = init_chat_model(\"gpt-5.4-invalid\")\n", + "model = init_chat_model(\"gpt-5.6-terra-invalid\", reasoning_effort=\"none\")\n", "\n", "agent = create_agent(\n", " model,\n", diff --git "a/PART02-\354\227\220\354\235\264\354\240\204\355\212\270/Ch02-\354\227\220\354\235\264\354\240\204\355\212\270/02-LangGraph-ChatBot.ipynb" "b/PART02-\354\227\220\354\235\264\354\240\204\355\212\270/Ch02-\354\227\220\354\235\264\354\240\204\355\212\270/02-LangGraph-ChatBot.ipynb" index a4a609a..4b0c8b0 100644 --- "a/PART02-\354\227\220\354\235\264\354\240\204\355\212\270/Ch02-\354\227\220\354\235\264\354\240\204\355\212\270/02-LangGraph-ChatBot.ipynb" +++ "b/PART02-\354\227\220\354\235\264\354\240\204\355\212\270/Ch02-\354\227\220\354\235\264\354\240\204\355\212\270/02-LangGraph-ChatBot.ipynb" @@ -130,8 +130,8 @@ "source": [ "from langchain.chat_models import init_chat_model\n", "\n", - "# OpenAI 키를 사용할 경우 gpt-5.4, gpt-5.4-mini 등의 모델로 변경하세요.\n", - "llm = init_chat_model(\"gpt-5.4\")\n", + "# OpenAI 키를 사용할 경우 gpt-5.6-terra, gpt-5.6-luna 등의 모델로 변경하세요.\n", + "llm = init_chat_model(\"gpt-5.6-terra\", reasoning_effort=\"none\")\n", "\n", "\n", "# 챗봇 함수 정의\n", @@ -529,8 +529,8 @@ "\n", "\n", "###### STEP 2. 노드(Node) 정의 ######\n", - "# OpenAI 키를 사용할 경우 gpt-5.4, gpt-5.4-mini 등의 모델로 변경하세요.\n", - "llm = init_chat_model(\"gpt-5.4\")\n", + "# OpenAI 키를 사용할 경우 gpt-5.6-terra, gpt-5.6-luna 등의 모델로 변경하세요.\n", + "llm = init_chat_model(\"gpt-5.6-terra\", reasoning_effort=\"none\")\n", "\n", "\n", "# 챗봇 함수 정의\n", diff --git "a/PART02-\354\227\220\354\235\264\354\240\204\355\212\270/Ch02-\354\227\220\354\235\264\354\240\204\355\212\270/02-LangGraph-Tools.ipynb" "b/PART02-\354\227\220\354\235\264\354\240\204\355\212\270/Ch02-\354\227\220\354\235\264\354\240\204\355\212\270/02-LangGraph-Tools.ipynb" index 459012c..68f4334 100644 --- "a/PART02-\354\227\220\354\235\264\354\240\204\355\212\270/Ch02-\354\227\220\354\235\264\354\240\204\355\212\270/02-LangGraph-Tools.ipynb" +++ "b/PART02-\354\227\220\354\235\264\354\240\204\355\212\270/Ch02-\354\227\220\354\235\264\354\240\204\355\212\270/02-LangGraph-Tools.ipynb" @@ -443,8 +443,8 @@ "\n", "\n", "# 에이전트 생성\n", - "# 다른 모델을 사용하려면 gpt-5.4-mini, claude-sonnet-5 등으로 변경 가능합니다.\n", - "model = init_chat_model(\"gpt-5.4\")\n", + "# 모델 등급: gpt-5.6-sol(high) / gpt-5.6-terra(medium) / gpt-5.6-luna(low)합니다.\n", + "model = init_chat_model(\"gpt-5.6-terra\", reasoning_effort=\"none\")\n", "agent = create_agent(\n", " model,\n", " tools=[summarize_conversation, get_user_preference],\n", @@ -590,8 +590,8 @@ "\n", "\n", "# 에이전트 생성\n", - "# 다른 모델을 사용하려면 gpt-5.4-mini, claude-sonnet-5 등으로 변경 가능합니다.\n", - "model = init_chat_model(\"gpt-5.4\")\n", + "# 모델 등급: gpt-5.6-sol(high) / gpt-5.6-terra(medium) / gpt-5.6-luna(low)합니다.\n", + "model = init_chat_model(\"gpt-5.6-terra\", reasoning_effort=\"none\")\n", "agent = create_agent(\n", " model,\n", " tools=[update_user_name, clear_messages],\n", @@ -902,8 +902,8 @@ "\n", "\n", "# 에이전트 생성\n", - "# 다른 모델을 사용하려면 gpt-5.4-mini, claude-sonnet-5 등으로 변경 가능합니다.\n", - "model = init_chat_model(\"gpt-5.4\")\n", + "# 모델 등급: gpt-5.6-sol(high) / gpt-5.6-terra(medium) / gpt-5.6-luna(low)합니다.\n", + "model = init_chat_model(\"gpt-5.6-terra\", reasoning_effort=\"none\")\n", "agent = create_agent(\n", " model,\n", " tools=[get_account_info],\n", @@ -986,8 +986,8 @@ "\n", "# 스토어와 에이전트 생성\n", "store = InMemoryStore()\n", - "# 다른 모델을 사용하려면 gpt-5.4-mini, claude-sonnet-5 등으로 변경 가능합니다.\n", - "model = init_chat_model(\"gpt-5.4\")\n", + "# 모델 등급: gpt-5.6-sol(high) / gpt-5.6-terra(medium) / gpt-5.6-luna(low)합니다.\n", + "model = init_chat_model(\"gpt-5.6-terra\", reasoning_effort=\"none\")\n", "agent = create_agent(model, tools=[get_user_info, save_user_info], store=store)\n", "\n", "# 첫 번째 세션: 사용자 정보 저장\n", @@ -1073,8 +1073,8 @@ "from langchain_teddynote.messages import stream_graph\n", "\n", "# 스토어와 에이전트 생성\n", - "# 다른 모델을 사용하려면 gpt-5.4-mini, claude-sonnet-5 등으로 변경 가능합니다.\n", - "model = init_chat_model(\"gpt-5.4\")\n", + "# 모델 등급: gpt-5.6-sol(high) / gpt-5.6-terra(medium) / gpt-5.6-luna(low)합니다.\n", + "model = init_chat_model(\"gpt-5.6-terra\", reasoning_effort=\"none\")\n", "agent = create_agent(model, tools=[get_weather_with_updates])\n", "\n", "inputs = {\"messages\": [{\"role\": \"user\", \"content\": \"서울 날씨 알려줘\"}]}\n", diff --git "a/PART02-\354\227\220\354\235\264\354\240\204\355\212\270/Ch02-\354\227\220\354\235\264\354\240\204\355\212\270/03-QuickStart-LangGraph-Ollama.ipynb" "b/PART02-\354\227\220\354\235\264\354\240\204\355\212\270/Ch02-\354\227\220\354\235\264\354\240\204\355\212\270/03-QuickStart-LangGraph-Ollama.ipynb" index a229a14..ef2cece 100644 --- "a/PART02-\354\227\220\354\235\264\354\240\204\355\212\270/Ch02-\354\227\220\354\235\264\354\240\204\355\212\270/03-QuickStart-LangGraph-Ollama.ipynb" +++ "b/PART02-\354\227\220\354\235\264\354\240\204\355\212\270/Ch02-\354\227\220\354\235\264\354\240\204\355\212\270/03-QuickStart-LangGraph-Ollama.ipynb" @@ -56,8 +56,8 @@ "### 기본 형식\n", "\n", "단순히 모델 이름만 지정:\n", - "* `'gpt-5.4'`\n", - "* `'gpt-5.4'`\n", + "* `'gpt-5.6-terra'`\n", + "* `'gpt-5.6-terra'`\n", "\n", "### 통합 형식\n", "\n", @@ -68,8 +68,8 @@ "```\n", "\n", "**예시:**\n", - "* `'openai:gpt-5.4'`\n", - "* `'openai:gpt-5.4'`\n", + "* `'openai:gpt-5.6-terra'`\n", + "* `'openai:gpt-5.6-terra'`\n", "\n", "이 형식을 사용하면 하나의 인자로 모델 제공자와 모델을 동시에 명시할 수 있습니다.\n", "\n", diff --git "a/PART02-\354\227\220\354\235\264\354\240\204\355\212\270/Ch03-Runtime/04-LangGraph-Runtime.ipynb" "b/PART02-\354\227\220\354\235\264\354\240\204\355\212\270/Ch03-Runtime/04-LangGraph-Runtime.ipynb" index a63469b..5e5628e 100644 --- "a/PART02-\354\227\220\354\235\264\354\240\204\355\212\270/Ch03-Runtime/04-LangGraph-Runtime.ipynb" +++ "b/PART02-\354\227\220\354\235\264\354\240\204\355\212\270/Ch03-Runtime/04-LangGraph-Runtime.ipynb" @@ -142,8 +142,8 @@ " user_name = runtime.context.user_name\n", " return f\"안녕하세요, {user_name}님! 무엇을 도와드릴까요?\"\n", "\n", - "# LLM 초기화 (OpenAI 키 사용 시 gpt-5.4, gpt-5.4-mini 등으로 변경 가능)\n", - "model = init_chat_model(\"gpt-5.4\")\n", + "# LLM 초기화 (OpenAI 키 사용 시 gpt-5.6-terra, gpt-5.6-luna 등으로 변경 가능)\n", + "model = init_chat_model(\"gpt-5.6-terra\", reasoning_effort=\"none\")\n", "\n", "# 에이전트 생성\n", "agent = create_agent(\n", diff --git "a/PART02-\354\227\220\354\235\264\354\240\204\355\212\270/Ch04-\352\265\254\354\241\260\355\231\224\353\220\234-\354\266\234\353\240\245/05-LangGraph-Structured-Output.ipynb" "b/PART02-\354\227\220\354\235\264\354\240\204\355\212\270/Ch04-\352\265\254\354\241\260\355\231\224\353\220\234-\354\266\234\353\240\245/05-LangGraph-Structured-Output.ipynb" index 6e56758..66a037a 100644 --- "a/PART02-\354\227\220\354\235\264\354\240\204\355\212\270/Ch04-\352\265\254\354\241\260\355\231\224\353\220\234-\354\266\234\353\240\245/05-LangGraph-Structured-Output.ipynb" +++ "b/PART02-\354\227\220\354\235\264\354\240\204\355\212\270/Ch04-\352\265\254\354\241\260\355\231\224\353\220\234-\354\266\234\353\240\245/05-LangGraph-Structured-Output.ipynb" @@ -143,8 +143,8 @@ "\n", "\n", "# 모델 초기화\n", - "# OpenAI 키 사용 시 gpt-5.4-mini, gpt-5.4 등으로 변경하세요.\n", - "model = init_chat_model(\"gpt-5.4\")\n", + "# OpenAI 키 사용 시 gpt-5.6-luna, gpt-5.6-terra 등으로 변경하세요.\n", + "model = init_chat_model(\"gpt-5.6-terra\", reasoning_effort=\"none\")\n", "\n", "# 에이전트 생성 - response_format에 스키마 타입 전달 시 ProviderStrategy 자동 선택\n", "agent = create_agent(\n", diff --git "a/PART02-\354\227\220\354\235\264\354\240\204\355\212\270/Ch05-Human-in-the-Loop/02-LangGraph-Human-In-The-Loop.ipynb" "b/PART02-\354\227\220\354\235\264\354\240\204\355\212\270/Ch05-Human-in-the-Loop/02-LangGraph-Human-In-The-Loop.ipynb" index 0a410b1..a95faa4 100644 --- "a/PART02-\354\227\220\354\235\264\354\240\204\355\212\270/Ch05-Human-in-the-Loop/02-LangGraph-Human-In-The-Loop.ipynb" +++ "b/PART02-\354\227\220\354\235\264\354\240\204\355\212\270/Ch05-Human-in-the-Loop/02-LangGraph-Human-In-The-Loop.ipynb" @@ -130,8 +130,8 @@ " return f\"File {filename} not found\"\n", "\n", "# 모델 초기화\n", - "# OpenAI 키 사용 시 gpt-5.4-mini, gpt-5.4 등으로 변경하세요.\n", - "model = init_chat_model(\"gpt-5.4\")\n", + "# OpenAI 키 사용 시 gpt-5.6-luna, gpt-5.6-terra 등으로 변경하세요.\n", + "model = init_chat_model(\"gpt-5.6-terra\", reasoning_effort=\"none\")\n", "\n", "# HITL 미들웨어와 함께 에이전트 생성\n", "agent = create_agent(\n", diff --git "a/PART02-\354\227\220\354\235\264\354\240\204\355\212\270/Ch05-Human-in-the-Loop/06-LangGraph-Human-In-the-Loop.ipynb" "b/PART02-\354\227\220\354\235\264\354\240\204\355\212\270/Ch05-Human-in-the-Loop/06-LangGraph-Human-In-the-Loop.ipynb" index a9399b5..8725abf 100644 --- "a/PART02-\354\227\220\354\235\264\354\240\204\355\212\270/Ch05-Human-in-the-Loop/06-LangGraph-Human-In-the-Loop.ipynb" +++ "b/PART02-\354\227\220\354\235\264\354\240\204\355\212\270/Ch05-Human-in-the-Loop/06-LangGraph-Human-In-the-Loop.ipynb" @@ -107,8 +107,8 @@ "\n", "tools = [search_keyword]\n", "\n", - "# LLM 초기화 (OpenAI 키 사용 시 gpt-5.4, gpt-5.4-mini 등으로 변경)\n", - "llm = init_chat_model(\"gpt-5.4\")\n", + "# LLM 초기화 (OpenAI 키 사용 시 gpt-5.6-terra, gpt-5.6-luna 등으로 변경)\n", + "llm = init_chat_model(\"gpt-5.6-terra\", reasoning_effort=\"none\")\n", "\n", "# 도구와 LLM 결합\n", "llm_with_tools = llm.bind_tools(tools)\n", diff --git "a/PART02-\354\227\220\354\235\264\354\240\204\355\212\270/Ch05-Human-in-the-Loop/modified.txt" "b/PART02-\354\227\220\354\235\264\354\240\204\355\212\270/Ch05-Human-in-the-Loop/modified.txt" new file mode 100644 index 0000000..b7e1a1b --- /dev/null +++ "b/PART02-\354\227\220\354\235\264\354\240\204\355\212\270/Ch05-Human-in-the-Loop/modified.txt" @@ -0,0 +1 @@ +Modified content \ No newline at end of file diff --git "a/PART02-\354\227\220\354\235\264\354\240\204\355\212\270/Ch05-Human-in-the-Loop/test.txt" "b/PART02-\354\227\220\354\235\264\354\240\204\355\212\270/Ch05-Human-in-the-Loop/test.txt" new file mode 100644 index 0000000..5e1c309 --- /dev/null +++ "b/PART02-\354\227\220\354\235\264\354\240\204\355\212\270/Ch05-Human-in-the-Loop/test.txt" @@ -0,0 +1 @@ +Hello World \ No newline at end of file diff --git "a/PART03-\354\227\220\354\235\264\354\240\204\355\212\270-\355\231\225\354\236\245/Ch06-\353\257\270\353\223\244\354\233\250\354\226\264/01-LangGraph-Middleware.ipynb" "b/PART03-\354\227\220\354\235\264\354\240\204\355\212\270-\355\231\225\354\236\245/Ch06-\353\257\270\353\223\244\354\233\250\354\226\264/01-LangGraph-Middleware.ipynb" index 62ec7e7..58a034e 100644 --- "a/PART03-\354\227\220\354\235\264\354\240\204\355\212\270-\355\231\225\354\236\245/Ch06-\353\257\270\353\223\244\354\233\250\354\226\264/01-LangGraph-Middleware.ipynb" +++ "b/PART03-\354\227\220\354\235\264\354\240\204\355\212\270-\355\231\225\354\236\245/Ch06-\353\257\270\353\223\244\354\233\250\354\226\264/01-LangGraph-Middleware.ipynb" @@ -145,8 +145,8 @@ " return f\"It's sunny in {city}!\"\n", "\n", "\n", - "# 모델 생성 (OpenAI 키를 사용하는 경우 gpt-5.4, gpt-5.4-mini 등으로 변경 가능)\n", - "model = init_chat_model(\"gpt-5.4\")\n", + "# 모델 생성 (OpenAI 키를 사용하는 경우 gpt-5.6-terra, gpt-5.6-luna 등으로 변경 가능)\n", + "model = init_chat_model(\"gpt-5.6-terra\", reasoning_effort=\"none\")\n", "\n", "# 에이전트 생성\n", "agent = create_agent(\n", @@ -199,8 +199,8 @@ " tools=[get_weather],\n", " middleware=[\n", " SummarizationMiddleware(\n", - " # 요약에 사용할 모델 (OpenAI 키를 사용하는 경우 openai:gpt-5.4-mini 등으로 변경 가능)\n", - " model=\"gpt-5.4\",\n", + " # 요약에 사용할 모델 (OpenAI 키를 사용하는 경우 openai:gpt-5.6-luna 등으로 변경 가능)\n", + " model=\"gpt-5.6-terra\",\n", " trigger=(\"tokens\", 4000), # 4000 토큰에서 요약 트리거\n", " keep=(\"messages\", 20), # 요약 후 최근 20개 메시지 유지\n", " ),\n", @@ -318,7 +318,7 @@ "- 더 저렴한 모델로 폴백하여 비용 최적화\n", "- Anthropic, OpenAI 등에 걸친 제공자 중복성\n", "\n", - "아래 코드는 기본 모델(`gpt-5.4`) 실패 시 순차적으로 대체 모델로 폴백하는 에이전트를 생성합니다." + "아래 코드는 기본 모델(`gpt-5.6-terra`) 실패 시 순차적으로 대체 모델로 폴백하는 에이전트를 생성합니다." ] }, { @@ -327,15 +327,16 @@ "metadata": {}, "outputs": [], "source": [ + "from langchain.chat_models import init_chat_model\n", "from langchain.agents.middleware import ModelFallbackMiddleware\n", "\n", "agent = create_agent(\n", - " model=\"gpt-5.4\", # 기본 모델\n", + " model=init_chat_model(\"gpt-5.6-terra\", reasoning_effort=\"none\"), # 기본 모델\n", " tools=[get_weather],\n", " middleware=[\n", " ModelFallbackMiddleware(\n", - " \"gpt-5.4-mini\", # 오류 시 먼저 시도\n", - " \"openai:gpt-5.4-mini\", # 그 다음 이것\n", + " init_chat_model(\"gpt-5.6-luna\", reasoning_effort=\"none\"), # 오류 시 먼저 시도\n", + " init_chat_model(\"openai:gpt-5.6-luna\", reasoning_effort=\"none\"), # 그 다음 이것\n", " ),\n", " ],\n", ")" @@ -831,7 +832,7 @@ "\n", "랩 스타일 후크의 또 다른 활용 예제로, 대화 길이나 상황에 따라 다른 모델을 선택하는 미들웨어를 구현할 수 있습니다. 짧은 대화에는 가벼운 모델을, 긴 대화에는 더 큰 컨텍스트 창을 가진 모델을 사용하여 비용과 성능을 최적화할 수 있습니다.\n", "\n", - "아래 코드는 메시지 수에 따라 `gpt-5.4` 또는 `gpt-5.4-mini` 모델을 동적으로 선택하는 `DynamicModelMiddleware` 클래스를 구현합니다." + "아래 코드는 메시지 수에 따라 `gpt-5.6-terra` 또는 `gpt-5.6-luna` 모델을 동적으로 선택하는 `DynamicModelMiddleware` 클래스를 구현합니다." ] }, { @@ -865,12 +866,12 @@ " # 대화 길이에 따라 다른 모델 사용\n", " if len(request.messages) > 10:\n", " # 긴 대화: 더 큰 컨텍스트 창을 가진 모델 사용\n", - " new_request = request.override(model=init_chat_model(\"gpt-5.4\"))\n", - " print(\"Using gpt-5.4 for long conversation\")\n", + " new_request = request.override(model=init_chat_model(\"gpt-5.6-terra\", reasoning_effort=\"none\"))\n", + " print(\"Using gpt-5.6-terra for long conversation\")\n", " else:\n", " # 짧은 대화: 가벼운 모델로 비용 최적화\n", - " new_request = request.override(model=init_chat_model(\"gpt-5.4-mini\"))\n", - " print(\"Using gpt-5.4-mini for short conversation\")\n", + " new_request = request.override(model=init_chat_model(\"gpt-5.6-luna\", reasoning_effort=\"none\"))\n", + " print(\"Using gpt-5.6-luna for short conversation\")\n", "\n", " return handler(new_request)\n", "\n", diff --git "a/PART03-\354\227\220\354\235\264\354\240\204\355\212\270-\355\231\225\354\236\245/Ch07-\354\273\250\355\205\215\354\212\244\355\212\270-\354\227\224\354\247\200\353\213\210\354\226\264\353\247\201/03-LangGraph-Context-Engineering.ipynb" "b/PART03-\354\227\220\354\235\264\354\240\204\355\212\270-\355\231\225\354\236\245/Ch07-\354\273\250\355\205\215\354\212\244\355\212\270-\354\227\224\354\247\200\353\213\210\354\226\264\353\247\201/03-LangGraph-Context-Engineering.ipynb" index 1f35bca..670637a 100644 --- "a/PART03-\354\227\220\354\235\264\354\240\204\355\212\270-\355\231\225\354\236\245/Ch07-\354\273\250\355\205\215\354\212\244\355\212\270-\354\227\224\354\247\200\353\213\210\354\226\264\353\247\201/03-LangGraph-Context-Engineering.ipynb" +++ "b/PART03-\354\227\220\354\235\264\354\240\204\355\212\270-\355\231\225\354\236\245/Ch07-\354\273\250\355\205\215\354\212\244\355\212\270-\354\227\224\354\247\200\353\213\210\354\226\264\353\247\201/03-LangGraph-Context-Engineering.ipynb" @@ -194,7 +194,7 @@ " return base\n", "\n", "\n", - "model = ChatOpenAI(model=\"gpt-5.4-mini\")\n", + "model = ChatOpenAI(model=\"gpt-5.6-luna\", reasoning_effort=\"none\")\n", "\n", "agent = create_agent(model=model, tools=[search_tool], middleware=[state_aware_prompt])\n", "\n", @@ -897,8 +897,8 @@ "from langchain.chat_models import init_chat_model\n", "\n", "# 모델을 미들웨어 외부에서 한 번만 초기화\n", - "large_model = init_chat_model(\"openai:gpt-5.4\")\n", - "efficient_model = init_chat_model(\"openai:gpt-5.4-mini\")\n", + "large_model = init_chat_model(\"openai:gpt-5.6-terra\", reasoning_effort=\"none\")\n", + "efficient_model = init_chat_model(\"openai:gpt-5.6-luna\", reasoning_effort=\"none\")\n", "\n", "\n", "@wrap_model_call\n", @@ -1397,6 +1397,7 @@ } ], "source": [ + "from langchain.chat_models import init_chat_model\n", "from langchain.agents.middleware import SummarizationMiddleware\n", "\n", "agent = create_agent(\n", @@ -1404,7 +1405,7 @@ " tools=[search_tool],\n", " middleware=[\n", " SummarizationMiddleware(\n", - " model=\"openai:gpt-5.4-mini\",\n", + " model=init_chat_model(\"openai:gpt-5.6-luna\", reasoning_effort=\"none\"),\n", " trigger=('tokens', 4000), # 4000 토큰에서 요약 트리거\n", " keep=('messages', 20), # 요약 후 최근 20개 메시지 유지\n", " ),\n", diff --git "a/PART03-\354\227\220\354\235\264\354\240\204\355\212\270-\355\231\225\354\236\245/Ch08-\352\260\200\353\223\234\353\240\210\354\235\274/04-LangGraph-Guardrail.ipynb" "b/PART03-\354\227\220\354\235\264\354\240\204\355\212\270-\355\231\225\354\236\245/Ch08-\352\260\200\353\223\234\353\240\210\354\235\274/04-LangGraph-Guardrail.ipynb" index 899a7dd..b66e29f 100644 --- "a/PART03-\354\227\220\354\235\264\354\240\204\355\212\270-\355\231\225\354\236\245/Ch08-\352\260\200\353\223\234\353\240\210\354\235\274/04-LangGraph-Guardrail.ipynb" +++ "b/PART03-\354\227\220\354\235\264\354\240\204\355\212\270-\355\231\225\354\236\245/Ch08-\352\260\200\353\223\234\353\240\210\354\235\274/04-LangGraph-Guardrail.ipynb" @@ -175,8 +175,8 @@ " return f\"Processing customer query: {query}\"\n", "\n", "\n", - "# 다른 모델을 사용하려면 gpt-5.4-mini, claude-sonnet-5 등으로 변경하세요\n", - "model = init_chat_model(\"gpt-5.4\")\n", + "# 모델 등급: gpt-5.6-sol(high) / gpt-5.6-terra(medium) / gpt-5.6-luna(low)\n", + "model = init_chat_model(\"gpt-5.6-terra\", reasoning_effort=\"none\")\n", "\n", "# PII 보호가 적용된 에이전트 생성\n", "agent = create_agent(\n", @@ -916,8 +916,8 @@ "from typing import Any\n", "\n", "# 안전성 평가를 위한 별도 모델 (비용 효율적인 모델 사용)\n", - "# 다른 모델을 사용하려면 gpt-5.4-mini, claude-sonnet-5 등으로 변경하세요\n", - "safety_model = init_chat_model(\"gpt-5.4\")\n", + "# 모델 등급: gpt-5.6-sol(high) / gpt-5.6-terra(medium) / gpt-5.6-luna(low)\n", + "safety_model = init_chat_model(\"gpt-5.6-terra\", reasoning_effort=\"none\")\n", "\n", "\n", "@after_agent(can_jump_to=[\"end\"])\n", diff --git "a/PART03-\354\227\220\354\235\264\354\240\204\355\212\270-\355\231\225\354\236\245/Ch09-\353\251\224\353\252\250\353\246\254-\354\266\224\352\260\200\355\225\230\352\270\260/01-LangGraph-Add-Memory.ipynb" "b/PART03-\354\227\220\354\235\264\354\240\204\355\212\270-\355\231\225\354\236\245/Ch09-\353\251\224\353\252\250\353\246\254-\354\266\224\352\260\200\355\225\230\352\270\260/01-LangGraph-Add-Memory.ipynb" index ffea96d..1d5eda1 100644 --- "a/PART03-\354\227\220\354\235\264\354\240\204\355\212\270-\355\231\225\354\236\245/Ch09-\353\251\224\353\252\250\353\246\254-\354\266\224\352\260\200\355\225\230\352\270\260/01-LangGraph-Add-Memory.ipynb" +++ "b/PART03-\354\227\220\354\235\264\354\240\204\355\212\270-\355\231\225\354\236\245/Ch09-\353\251\224\353\252\250\353\246\254-\354\266\224\352\260\200\355\225\230\352\270\260/01-LangGraph-Add-Memory.ipynb" @@ -178,7 +178,7 @@ "\n", "\n", "# LLM 초기화\n", - "llm = init_chat_model(\"gpt-5.4\", temperature=0)\n", + "llm = init_chat_model(\"gpt-5.6-terra\", reasoning_effort=\"none\", temperature=0)\n", "\n", "# 챗봇 노드 함수 정의\n", "def chatbot(state: State):\n", @@ -559,7 +559,7 @@ "tools = [search_tool]\n", "\n", "# LLM에 도구 바인딩\n", - "llm_with_tools = init_chat_model(\"gpt-5.4\").bind_tools(tools)\n", + "llm_with_tools = init_chat_model(\"gpt-5.6-terra\", reasoning_effort=\"none\").bind_tools(tools)\n", "\n", "# 에이전트 노드 함수\n", "def agent(state: State):\n", @@ -766,7 +766,7 @@ "tool_node = ToolNode(tools)\n", "\n", "# 모델 초기화 및 도구 바인딩\n", - "model = init_chat_model(\"gpt-5.4\")\n", + "model = init_chat_model(\"gpt-5.6-terra\", reasoning_effort=\"none\")\n", "model_with_tools = model.bind_tools(tools)\n", "\n", "\n", diff --git "a/PART03-\354\227\220\354\235\264\354\240\204\355\212\270-\355\231\225\354\236\245/Ch09-\353\251\224\353\252\250\353\246\254-\354\266\224\352\260\200\355\225\230\352\270\260/02-LangGraph-Memory-Postgres.ipynb" "b/PART03-\354\227\220\354\235\264\354\240\204\355\212\270-\355\231\225\354\236\245/Ch09-\353\251\224\353\252\250\353\246\254-\354\266\224\352\260\200\355\225\230\352\270\260/02-LangGraph-Memory-Postgres.ipynb" index 9237c78..e3e327d 100644 --- "a/PART03-\354\227\220\354\235\264\354\240\204\355\212\270-\355\231\225\354\236\245/Ch09-\353\251\224\353\252\250\353\246\254-\354\266\224\352\260\200\355\225\230\352\270\260/02-LangGraph-Memory-Postgres.ipynb" +++ "b/PART03-\354\227\220\354\235\264\354\240\204\355\212\270-\355\231\225\354\236\245/Ch09-\353\251\224\353\252\250\353\246\254-\354\266\224\352\260\200\355\225\230\352\270\260/02-LangGraph-Memory-Postgres.ipynb" @@ -241,8 +241,8 @@ " else:\n", " return \"Unknown user\"\n", "\n", - "# OpenAI 키를 사용하는 경우 gpt-5.4, gpt-5.4-mini 등으로 변경하세요.\n", - "model = init_chat_model(\"gpt-5.4\")\n", + "# OpenAI 키를 사용하는 경우 gpt-5.6-terra, gpt-5.6-luna 등으로 변경하세요.\n", + "model = init_chat_model(\"gpt-5.6-terra\", reasoning_effort=\"none\")\n", "\n", "# 에이전트 생성: store 매개변수를 전달하여 도구에서 Store 접근 가능\n", "agent = create_agent(\n", @@ -911,8 +911,8 @@ "source": [ "from langchain_teddynote.memory import create_memory_extractor\n", "\n", - "# 메모리 추출기 생성 (내부적으로 OpenAI gpt-5.4 모델 사용)\n", - "memory_extractor = create_memory_extractor(model=\"gpt-5.4\")" + "# 메모리 추출기 생성 (내부적으로 OpenAI gpt-5.6-terra 모델 사용)\n", + "memory_extractor = create_memory_extractor(model=\"gpt-5.6-terra\")" ] }, { @@ -936,8 +936,8 @@ "source": [ "from langchain.chat_models import init_chat_model\n", "\n", - "# OpenAI 키를 사용하는 경우 gpt-5.4, gpt-5.4-mini 등으로 변경하세요.\n", - "pg_model = init_chat_model(\"gpt-5.4\")" + "# OpenAI 키를 사용하는 경우 gpt-5.6-terra, gpt-5.6-luna 등으로 변경하세요.\n", + "pg_model = init_chat_model(\"gpt-5.6-terra\", reasoning_effort=\"none\")" ] }, { diff --git "a/PART03-\354\227\220\354\235\264\354\240\204\355\212\270-\355\231\225\354\236\245/Ch09-\353\251\224\353\252\250\353\246\254-\354\266\224\352\260\200\355\225\230\352\270\260/04-LangGraph-Agent-With-Memory.ipynb" "b/PART03-\354\227\220\354\235\264\354\240\204\355\212\270-\355\231\225\354\236\245/Ch09-\353\251\224\353\252\250\353\246\254-\354\266\224\352\260\200\355\225\230\352\270\260/04-LangGraph-Agent-With-Memory.ipynb" index 13c7f4e..55a9617 100644 --- "a/PART03-\354\227\220\354\235\264\354\240\204\355\212\270-\355\231\225\354\236\245/Ch09-\353\251\224\353\252\250\353\246\254-\354\266\224\352\260\200\355\225\230\352\270\260/04-LangGraph-Agent-With-Memory.ipynb" +++ "b/PART03-\354\227\220\354\235\264\354\240\204\355\212\270-\355\231\225\354\236\245/Ch09-\353\251\224\353\252\250\353\246\254-\354\266\224\352\260\200\355\225\230\352\270\260/04-LangGraph-Agent-With-Memory.ipynb" @@ -167,8 +167,8 @@ "tools = [tool]\n", "\n", "# LLM 초기화\n", - "# 다른 모델을 사용하려면 gpt-5.4-mini, claude-sonnet-5 등으로 변경 가능\n", - "llm = init_chat_model(\"gpt-5.4\")\n", + "# 모델 등급: gpt-5.6-sol(high) / gpt-5.6-terra(medium) / gpt-5.6-luna(low)\n", + "llm = init_chat_model(\"gpt-5.6-terra\", reasoning_effort=\"none\")\n", "\n", "# 도구와 LLM 결합\n", "llm_with_tools = llm.bind_tools(tools)\n", diff --git "a/PART03-\354\227\220\354\235\264\354\240\204\355\212\270-\355\231\225\354\236\245/Ch09-\353\251\224\353\252\250\353\246\254-\354\266\224\352\260\200\355\225\230\352\270\260/09-LangGraph-DeleteMessages.ipynb" "b/PART03-\354\227\220\354\235\264\354\240\204\355\212\270-\355\231\225\354\236\245/Ch09-\353\251\224\353\252\250\353\246\254-\354\266\224\352\260\200\355\225\230\352\270\260/09-LangGraph-DeleteMessages.ipynb" index 31aa83e..9ba2e45 100644 --- "a/PART03-\354\227\220\354\235\264\354\240\204\355\212\270-\355\231\225\354\236\245/Ch09-\353\251\224\353\252\250\353\246\254-\354\266\224\352\260\200\355\225\230\352\270\260/09-LangGraph-DeleteMessages.ipynb" +++ "b/PART03-\354\227\220\354\235\264\354\240\204\355\212\270-\355\231\225\354\236\245/Ch09-\353\251\224\353\252\250\353\246\254-\354\266\224\352\260\200\355\225\230\352\270\260/09-LangGraph-DeleteMessages.ipynb" @@ -121,8 +121,8 @@ "tools = [search]\n", "tool_node = ToolNode(tools)\n", "\n", - "# LLM 초기화 (OpenAI 키 사용 시 gpt-5.4, gpt-5.4-mini 등으로 변경)\n", - "model = init_chat_model(\"gpt-5.4\")\n", + "# LLM 초기화 (OpenAI 키 사용 시 gpt-5.6-terra, gpt-5.6-luna 등으로 변경)\n", + "model = init_chat_model(\"gpt-5.6-terra\", reasoning_effort=\"none\")\n", "bound_model = model.bind_tools(tools)\n", "\n", "\n", diff --git "a/PART03-\354\227\220\354\235\264\354\240\204\355\212\270-\355\231\225\354\236\245/Ch09-\353\251\224\353\252\250\353\246\254-\354\266\224\352\260\200\355\225\230\352\270\260/12-LangGraph-Add-Conversation-Summary.ipynb" "b/PART03-\354\227\220\354\235\264\354\240\204\355\212\270-\355\231\225\354\236\245/Ch09-\353\251\224\353\252\250\353\246\254-\354\266\224\352\260\200\355\225\230\352\270\260/12-LangGraph-Add-Conversation-Summary.ipynb" index 438f60c..cb56d43 100644 --- "a/PART03-\354\227\220\354\235\264\354\240\204\355\212\270-\355\231\225\354\236\245/Ch09-\353\251\224\353\252\250\353\246\254-\354\266\224\352\260\200\355\225\230\352\270\260/12-LangGraph-Add-Conversation-Summary.ipynb" +++ "b/PART03-\354\227\220\354\235\264\354\240\204\355\212\270-\355\231\225\354\236\245/Ch09-\353\251\224\353\252\250\353\246\254-\354\266\224\352\260\200\355\225\230\352\270\260/12-LangGraph-Add-Conversation-Summary.ipynb" @@ -123,8 +123,8 @@ "\n", "\n", "# 대화 및 요약을 위한 모델 초기화\n", - "# OpenAI 키를 사용하는 경우 gpt-5.4-mini, gpt-5.4 등의 모델로 변경하세요.\n", - "llm = init_chat_model(\"gpt-5.4\", temperature=0)" + "# OpenAI 키를 사용하는 경우 gpt-5.6-luna, gpt-5.6-terra 등의 모델로 변경하세요.\n", + "llm = init_chat_model(\"gpt-5.6-terra\", reasoning_effort=\"none\", temperature=0)" ] }, { diff --git "a/PART03-\354\227\220\354\235\264\354\240\204\355\212\270-\355\231\225\354\236\245/Ch10-LangGraph-MCP-\354\213\244\354\212\265/01-LangGraph-MCP-Tutorial.ipynb" "b/PART03-\354\227\220\354\235\264\354\240\204\355\212\270-\355\231\225\354\236\245/Ch10-LangGraph-MCP-\354\213\244\354\212\265/01-LangGraph-MCP-Tutorial.ipynb" index 070db34..34ded31 100644 --- "a/PART03-\354\227\220\354\235\264\354\240\204\355\212\270-\355\231\225\354\236\245/Ch10-LangGraph-MCP-\354\213\244\354\212\265/01-LangGraph-MCP-Tutorial.ipynb" +++ "b/PART03-\354\227\220\354\235\264\354\240\204\355\212\270-\355\231\225\354\236\245/Ch10-LangGraph-MCP-\354\213\244\354\212\265/01-LangGraph-MCP-Tutorial.ipynb" @@ -271,8 +271,8 @@ "outputs": [], "source": [ "# LLM 설정\n", - "# 다른 모델을 사용하려면 gpt-5.4-mini, claude-sonnet-5 등으로 변경 가능\n", - "llm = init_chat_model(\"gpt-5.4\", temperature=0)\n", + "# 모델 등급: gpt-5.6-sol(high) / gpt-5.6-terra(medium) / gpt-5.6-luna(low)\n", + "llm = init_chat_model(\"gpt-5.6-terra\", reasoning_effort=\"none\", temperature=0)\n", "\n", "# 에이전트 생성: MCP 도구를 사용하는 에이전트\n", "agent = create_agent(\n", @@ -371,8 +371,8 @@ "outputs": [], "source": [ "# LLM 설정\n", - "# 다른 모델을 사용하려면 gpt-5.4-mini, claude-sonnet-5 등으로 변경 가능\n", - "llm = init_chat_model(\"gpt-5.4\", temperature=0)\n", + "# 모델 등급: gpt-5.6-sol(high) / gpt-5.6-terra(medium) / gpt-5.6-luna(low)\n", + "llm = init_chat_model(\"gpt-5.6-terra\", reasoning_effort=\"none\", temperature=0)\n", "\n", "# HTTP 도구를 사용하는 에이전트 생성\n", "agent = create_agent(\n", @@ -484,8 +484,8 @@ "outputs": [], "source": [ "# LLM 설정\n", - "# 다른 모델을 사용하려면 gpt-5.4-mini, claude-sonnet-5 등으로 변경 가능\n", - "llm = init_chat_model(\"gpt-5.4\", temperature=0)\n", + "# 모델 등급: gpt-5.6-sol(high) / gpt-5.6-terra(medium) / gpt-5.6-luna(low)\n", + "llm = init_chat_model(\"gpt-5.6-terra\", reasoning_effort=\"none\", temperature=0)\n", "\n", "# RAG 도구를 사용하는 에이전트 생성\n", "rag_agent = create_agent(\n", @@ -622,8 +622,8 @@ " tools = await load_mcp_tools(target)\n", "\n", " # LLM 설정\n", - " # 다른 모델을 사용하려면 gpt-5.4-mini, claude-sonnet-5 등으로 변경 가능\n", - " llm = init_chat_model(\"gpt-5.4\", temperature=0)\n", + " # 모델 등급: gpt-5.6-sol(high) / gpt-5.6-terra(medium) / gpt-5.6-luna(low)\n", + " llm = init_chat_model(\"gpt-5.6-terra\", reasoning_effort=\"none\", temperature=0)\n", "\n", " # 에이전트 생성\n", " agent = create_agent(\n", @@ -774,8 +774,8 @@ " tools.append(tavily_tool)\n", "\n", " # LLM 설정 및 도구 바인딩\n", - " # 다른 모델을 사용하려면 gpt-5.4-mini, claude-sonnet-5 등으로 변경 가능\n", - " llm = init_chat_model(\"gpt-5.4\", temperature=0)\n", + " # 모델 등급: gpt-5.6-sol(high) / gpt-5.6-terra(medium) / gpt-5.6-luna(low)\n", + " llm = init_chat_model(\"gpt-5.6-terra\", reasoning_effort=\"none\", temperature=0)\n", " llm_with_tools = llm.bind_tools(tools)\n", "\n", " # 워크플로우 그래프 생성\n", diff --git "a/PART03-\354\227\220\354\235\264\354\240\204\355\212\270-\355\231\225\354\236\245/Ch10-LangGraph-MCP-\354\213\244\354\212\265/server/rag/base.py" "b/PART03-\354\227\220\354\235\264\354\240\204\355\212\270-\355\231\225\354\236\245/Ch10-LangGraph-MCP-\354\213\244\354\212\265/server/rag/base.py" index c028362..5ba3ce6 100644 --- "a/PART03-\354\227\220\354\235\264\354\240\204\355\212\270-\355\231\225\354\236\245/Ch10-LangGraph-MCP-\354\213\244\354\212\265/server/rag/base.py" +++ "b/PART03-\354\227\220\354\235\264\354\240\204\355\212\270-\355\231\225\354\236\245/Ch10-LangGraph-MCP-\354\213\244\354\212\265/server/rag/base.py" @@ -14,8 +14,8 @@ class RetrievalChain(ABC): def __init__(self): self.source_uri = None self.k = 8 - # 다른 모델을 사용하려면 gpt-5.4-mini, claude-sonnet-5 등으로 변경 가능 - self.model_name = "gpt-5.4" + # 모델 등급: gpt-5.6-sol(high) / gpt-5.6-terra(medium) / gpt-5.6-luna(low) + self.model_name = "gpt-5.6-terra" self.temperature = 0 self.prompt = "teddynote/rag-prompt" self.embeddings = "text-embedding-3-small" @@ -103,10 +103,11 @@ def create_retriever(self, vectorstore): return dense_retriever def create_model(self): - return init_chat_model(self.model_name, temperature=self.temperature) + return init_chat_model(self.model_name, reasoning_effort="none", temperature=self.temperature) def create_prompt(self): - return Client().pull_prompt(self.prompt) + # langsmith>=0.8: 공개 프롬프트(owner/name) 를 가져오려면 명시적 동의 플래그가 필요합니다 + return Client().pull_prompt(self.prompt, dangerously_pull_public_prompt=True) def create_chain(self): docs = self.load_documents(self.source_uri) diff --git "a/PART04-\353\251\200\355\213\260\354\227\220\354\235\264\354\240\204\355\212\270/Ch11-\353\251\200\355\213\260\354\227\220\354\235\264\354\240\204\355\212\270-Supervisor/01-LangGraph-Supervisor.ipynb" "b/PART04-\353\251\200\355\213\260\354\227\220\354\235\264\354\240\204\355\212\270/Ch11-\353\251\200\355\213\260\354\227\220\354\235\264\354\240\204\355\212\270-Supervisor/01-LangGraph-Supervisor.ipynb" index ab64818..fa5eb9d 100644 --- "a/PART04-\353\251\200\355\213\260\354\227\220\354\235\264\354\240\204\355\212\270/Ch11-\353\251\200\355\213\260\354\227\220\354\235\264\354\240\204\355\212\270-Supervisor/01-LangGraph-Supervisor.ipynb" +++ "b/PART04-\353\251\200\355\213\260\354\227\220\354\235\264\354\240\204\355\212\270/Ch11-\353\251\200\355\213\260\354\227\220\354\235\264\354\240\204\355\212\270-Supervisor/01-LangGraph-Supervisor.ipynb" @@ -244,6 +244,7 @@ } ], "source": [ + "from langchain.chat_models import init_chat_model\n", "import warnings\n", "\n", "from langchain_tavily import TavilySearch\n", @@ -261,9 +262,9 @@ "print(f\"첫 번째 결과 미리보기: {test_results['results'][0]['content'][:200]}...\\n\")\n", "\n", "# Research Agent 생성 (웹 검색 전문 에이전트)\n", - "# To use another model, change to gpt-5.4-mini, claude-sonnet-5 etc.\n", + "# Model tiers: gpt-5.6-sol (high) / gpt-5.6-terra (medium) / gpt-5.6-luna (low)\n", "research_agent = create_agent(\n", - " model=\"gpt-5.4\", # 사용할 LLM 모델\n", + " model=init_chat_model(\"gpt-5.6-terra\", reasoning_effort=\"none\"), # 사용할 LLM 모델\n", " tools=[web_search], # 웹 검색 도구 제공\n", " system_prompt=(\n", " \"You are a research specialist agent.\\n\\n\"\n", @@ -402,6 +403,7 @@ } ], "source": [ + "from langchain.chat_models import init_chat_model\n", "# 수학 도구 정의 (기본 계산 함수들)\n", "def add(a: float, b: float) -> float:\n", " \"\"\"두 숫자를 더합니다.\"\"\"\n", @@ -433,9 +435,9 @@ "\n", "\n", "# Math Agent 생성 (수학 계산 전문 에이전트)\n", - "# To use another model, change to gpt-5.4-mini, claude-sonnet-5 etc.\n", + "# Model tiers: gpt-5.6-sol (high) / gpt-5.6-terra (medium) / gpt-5.6-luna (low)\n", "math_agent = create_agent(\n", - " model=\"gpt-5.4\", # 사용할 LLM 모델\n", + " model=init_chat_model(\"gpt-5.6-terra\", reasoning_effort=\"none\"), # 사용할 LLM 모델\n", " tools=[add, multiply, divide, power, percentage], # 수학 도구들 제공\n", " system_prompt=(\n", " \"You are a mathematics specialist agent.\\n\\n\"\n", @@ -583,8 +585,8 @@ "from langchain.tools import tool\n", "from langchain.chat_models import init_chat_model\n", "\n", - "# To use another model, change to gpt-5.4-mini, claude-sonnet-5 etc.\n", - "model = init_chat_model(\"gpt-5.4\")\n", + "# Model tiers: gpt-5.6-sol (high) / gpt-5.6-terra (medium) / gpt-5.6-luna (low)\n", + "model = init_chat_model(\"gpt-5.6-terra\", reasoning_effort=\"none\")\n", "\n", "\n", "@tool\n", @@ -752,9 +754,9 @@ "from langgraph_supervisor import create_supervisor\n", "\n", "# Supervisor 생성 - 사전 구축된 패턴 사용\n", - "# To use another model, change to gpt-5.4-mini, claude-sonnet-5 etc.\n", + "# Model tiers: gpt-5.6-sol (high) / gpt-5.6-terra (medium) / gpt-5.6-luna (low)\n", "supervisor = create_supervisor(\n", - " model=init_chat_model(\"gpt-5.4\"), # Supervisor가 사용할 LLM 모델\n", + " model=init_chat_model(\"gpt-5.6-terra\", reasoning_effort=\"none\"), # Supervisor가 사용할 LLM 모델\n", " agents=[research_agent, math_agent], # 관리할 에이전트들 (연구, 수학)\n", " system_prompt=(\n", " \"You are a supervisor managing two specialized agents:\\n\\n\"\n", @@ -1048,12 +1050,13 @@ } ], "source": [ + "from langchain.chat_models import init_chat_model\n", "from langgraph.graph import END\n", "\n", "# 커스텀 Supervisor 에이전트 생성 (핸드오프 도구 활용)\n", - "# To use another model, change to gpt-5.4-mini, claude-sonnet-5 etc.\n", + "# Model tiers: gpt-5.6-sol (high) / gpt-5.6-terra (medium) / gpt-5.6-luna (low)\n", "supervisor_agent = create_agent(\n", - " model=\"gpt-5.4\", # 사용할 LLM 모델\n", + " model=init_chat_model(\"gpt-5.6-terra\", reasoning_effort=\"none\"), # 사용할 LLM 모델\n", " tools=[assign_to_research_agent, assign_to_math_agent], # 핸드오프 도구들\n", " system_prompt=(\n", " \"You are a supervisor orchestrating specialized agents.\\n\\n\"\n", @@ -1371,10 +1374,11 @@ } ], "source": [ + "from langchain.chat_models import init_chat_model\n", "# 작업 설명을 사용하는 고급 Supervisor 생성\n", - "# To use another model, change to gpt-5.4-mini, claude-sonnet-5 etc.\n", + "# Model tiers: gpt-5.6-sol (high) / gpt-5.6-terra (medium) / gpt-5.6-luna (low)\n", "supervisor_with_delegation = create_agent(\n", - " model=\"gpt-5.4\", # 사용할 LLM 모델\n", + " model=init_chat_model(\"gpt-5.6-terra\", reasoning_effort=\"none\"), # 사용할 LLM 모델\n", " tools=[\n", " assign_research_with_description,\n", " assign_math_with_description,\n", @@ -2560,7 +2564,7 @@ "\n", "\n", "# 기본 수학 에이전트 생성\n", - "# To use another model, change to gpt-5.4-mini, claude-sonnet-5 etc.\n", + "# Model tiers: gpt-5.6-sol (high) / gpt-5.6-terra (medium) / gpt-5.6-luna (low)\n", "basic_math = create_agent(\n", " model=model,\n", " tools=[add_numbers],\n", diff --git "a/PART04-\353\251\200\355\213\260\354\227\220\354\235\264\354\240\204\355\212\270/Ch11-\353\251\200\355\213\260\354\227\220\354\235\264\354\240\204\355\212\270-Supervisor/03-LangGraph-Multi-Agent-Supervisor.ipynb" "b/PART04-\353\251\200\355\213\260\354\227\220\354\235\264\354\240\204\355\212\270/Ch11-\353\251\200\355\213\260\354\227\220\354\235\264\354\240\204\355\212\270-Supervisor/03-LangGraph-Multi-Agent-Supervisor.ipynb" index 62ec141..58e3256 100644 --- "a/PART04-\353\251\200\355\213\260\354\227\220\354\235\264\354\240\204\355\212\270/Ch11-\353\251\200\355\213\260\354\227\220\354\235\264\354\240\204\355\212\270-Supervisor/03-LangGraph-Multi-Agent-Supervisor.ipynb" +++ "b/PART04-\353\251\200\355\213\260\354\227\220\354\235\264\354\240\204\355\212\270/Ch11-\353\251\200\355\213\260\354\227\220\354\235\264\354\240\204\355\212\270-Supervisor/03-LangGraph-Multi-Agent-Supervisor.ipynb" @@ -121,11 +121,11 @@ "source": [ "from langchain.chat_models import init_chat_model\n", "\n", - "# 사용할 모델 이름 설정 (OpenAI 키를 사용하는 경우 gpt-5.4, gpt-5.4-mini 등으로 변경하세요.)\n", - "MODEL_NAME = \"gpt-5.4\"\n", + "# 사용할 모델 이름 설정 (OpenAI 키를 사용하는 경우 gpt-5.6-terra, gpt-5.6-luna 등으로 변경하세요.)\n", + "MODEL_NAME = \"gpt-5.6-terra\"\n", "\n", "# 모델 초기화\n", - "model = init_chat_model(MODEL_NAME)\n", + "model = init_chat_model(MODEL_NAME, reasoning_effort=\"none\")\n", "print(f\"사용 모델: {MODEL_NAME}\")" ] }, diff --git "a/PART04-\353\251\200\355\213\260\354\227\220\354\235\264\354\240\204\355\212\270/Ch12-\353\251\200\355\213\260-\354\227\220\354\235\264\354\240\204\355\212\270-\355\230\221\354\227\205-\353\204\244\355\212\270\354\233\214\355\201\254/02-LangGraph-Multi-Agent-Collaboration.ipynb" "b/PART04-\353\251\200\355\213\260\354\227\220\354\235\264\354\240\204\355\212\270/Ch12-\353\251\200\355\213\260-\354\227\220\354\235\264\354\240\204\355\212\270-\355\230\221\354\227\205-\353\204\244\355\212\270\354\233\214\355\201\254/02-LangGraph-Multi-Agent-Collaboration.ipynb" index f9c50df..9384a79 100644 --- "a/PART04-\353\251\200\355\213\260\354\227\220\354\235\264\354\240\204\355\212\270/Ch12-\353\251\200\355\213\260-\354\227\220\354\235\264\354\240\204\355\212\270-\355\230\221\354\227\205-\353\204\244\355\212\270\354\233\214\355\201\254/02-LangGraph-Multi-Agent-Collaboration.ipynb" +++ "b/PART04-\353\251\200\355\213\260\354\227\220\354\235\264\354\240\204\355\212\270/Ch12-\353\251\200\355\213\260-\354\227\220\354\235\264\354\240\204\355\212\270-\355\230\221\354\227\205-\353\204\244\355\212\270\354\233\214\355\201\254/02-LangGraph-Multi-Agent-Collaboration.ipynb" @@ -134,8 +134,8 @@ "source": [ "from langchain.chat_models import init_chat_model\n", "\n", - "# OpenAI 키를 사용하는 경우 gpt-5.4, gpt-5.4-mini 등으로 변경할 수 있습니다.\n", - "model = init_chat_model(\"gpt-5.4\")\n", + "# OpenAI 키를 사용하는 경우 gpt-5.6-terra, gpt-5.6-luna 등으로 변경할 수 있습니다.\n", + "model = init_chat_model(\"gpt-5.6-terra\", reasoning_effort=\"none\")\n", "\n", "print(f\"사용 모델: {model.model}\")" ] diff --git "a/PART04-\353\251\200\355\213\260\354\227\220\354\235\264\354\240\204\355\212\270/Ch13-\352\263\204\354\270\265\354\240\201-\354\227\220\354\235\264\354\240\204\355\212\270-\355\214\200/04-LangGraph-Hierarchial-Agent-Team.ipynb" "b/PART04-\353\251\200\355\213\260\354\227\220\354\235\264\354\240\204\355\212\270/Ch13-\352\263\204\354\270\265\354\240\201-\354\227\220\354\235\264\354\240\204\355\212\270-\355\214\200/04-LangGraph-Hierarchial-Agent-Team.ipynb" index 120e807..3a6a73d 100644 --- "a/PART04-\353\251\200\355\213\260\354\227\220\354\235\264\354\240\204\355\212\270/Ch13-\352\263\204\354\270\265\354\240\201-\354\227\220\354\235\264\354\240\204\355\212\270-\355\214\200/04-LangGraph-Hierarchial-Agent-Team.ipynb" +++ "b/PART04-\353\251\200\355\213\260\354\227\220\354\235\264\354\240\204\355\212\270/Ch13-\352\263\204\354\270\265\354\240\201-\354\227\220\354\235\264\354\240\204\355\212\270-\355\214\200/04-LangGraph-Hierarchial-Agent-Team.ipynb" @@ -397,8 +397,8 @@ " Args:\n", " model_name: 사용할 LLM 모델명\n", " \"\"\"\n", - " # To use another model, change to gpt-5.4-mini, claude-sonnet-5 etc.\n", - " self.llm = init_chat_model(model_name, temperature=0)\n", + " # Model tiers: gpt-5.6-sol (high) / gpt-5.6-terra (medium) / gpt-5.6-luna (low)\n", + " self.llm = init_chat_model(model_name, reasoning_effort=\"none\", temperature=0)\n", "\n", " def create_agent_node(self, agent, name: str):\n", " \"\"\"에이전트를 그래프 노드 함수로 변환\n", @@ -423,11 +423,11 @@ "\n", "\n", "# LLM 초기화\n", - "# To use another model, change to gpt-5.4-mini, claude-sonnet-5 etc.\n", - "llm = init_chat_model(\"gpt-5.4\", temperature=0)\n", + "# Model tiers: gpt-5.6-sol (high) / gpt-5.6-terra (medium) / gpt-5.6-luna (low)\n", + "llm = init_chat_model(\"gpt-5.6-terra\", reasoning_effort=\"none\", temperature=0)\n", "\n", "# AgentFactory 인스턴스 생성\n", - "agent_factory = AgentFactory(\"gpt-5.4\")" + "agent_factory = AgentFactory(\"gpt-5.6-terra\")" ] }, { @@ -533,8 +533,8 @@ " ).partial(options=str(options_for_next))\n", "\n", " # LLM 초기화\n", - " # To use another model, change to gpt-5.4-mini, claude-sonnet-5 etc.\n", - " llm = init_chat_model(model_name, temperature=0)\n", + " # Model tiers: gpt-5.6-sol (high) / gpt-5.6-terra (medium) / gpt-5.6-luna (low)\n", + " llm = init_chat_model(model_name, reasoning_effort=\"none\", temperature=0)\n", "\n", " # Supervisor 체인 구성: 프롬프트 -> LLM (구조화된 출력)\n", " supervisor_chain = prompt | llm.with_structured_output(RouteResponse)\n", @@ -598,8 +598,8 @@ "\n", "\n", "# LLM 초기화\n", - "# To use another model, change to gpt-5.4-mini, claude-sonnet-5 etc.\n", - "llm = init_chat_model(\"gpt-5.4\", temperature=0)\n", + "# Model tiers: gpt-5.6-sol (high) / gpt-5.6-terra (medium) / gpt-5.6-luna (low)\n", + "llm = init_chat_model(\"gpt-5.6-terra\", reasoning_effort=\"none\", temperature=0)\n", "\n", "# Searcher 에이전트 및 노드 생성\n", "search_agent = create_agent(llm, tools=[tavily_tool])\n", @@ -613,7 +613,7 @@ "\n", "# Research Team Supervisor 생성\n", "supervisor_agent = create_team_supervisor(\n", - " \"gpt-5.4\",\n", + " \"gpt-5.6-terra\",\n", " \"You are a supervisor tasked with managing a conversation between the\"\n", " \" following workers: Search, WebScraper. Given the following user request,\"\n", " \" respond with the worker to act next. Each worker will perform a\"\n", @@ -1851,8 +1851,8 @@ "\n", "\n", "# LLM 초기화\n", - "# To use another model, change to gpt-5.4-mini, claude-sonnet-5 etc.\n", - "llm = init_chat_model(\"gpt-5.4\")\n", + "# Model tiers: gpt-5.6-sol (high) / gpt-5.6-terra (medium) / gpt-5.6-luna (low)\n", + "llm = init_chat_model(\"gpt-5.6-terra\", reasoning_effort=\"none\")\n", "\n", "# DocWriter 에이전트 생성\n", "doc_writer_agent = create_agent(\n", @@ -1888,7 +1888,7 @@ "# Doc Writing Team Supervisor 생성\n", "# 워크플로우 순서를 명시하여 무한 루프를 방지합니다.\n", "doc_writing_supervisor = create_team_supervisor(\n", - " \"gpt-5.4\",\n", + " \"gpt-5.6-terra\",\n", " \"You are a supervisor tasked with managing a conversation between the\"\n", " \" following workers: ['DocWriter', 'NoteTaker', 'ChartGenerator']. Given the following user request,\"\n", " \" respond with the worker to act next. Each worker will perform a\"\n", @@ -2088,13 +2088,13 @@ "from langchain.chat_models import init_chat_model\n", "\n", "# LLM 초기화\n", - "# To use another model, change to gpt-5.4-mini, claude-sonnet-5 etc.\n", - "llm = init_chat_model(\"gpt-5.4\")\n", + "# Model tiers: gpt-5.6-sol (high) / gpt-5.6-terra (medium) / gpt-5.6-luna (low)\n", + "llm = init_chat_model(\"gpt-5.6-terra\", reasoning_effort=\"none\")\n", "\n", "# 총 감독자 노드 생성: 두 팀을 관리\n", "# 각 팀이 결과를 보고하면 즉시 FINISH하도록 명시합니다.\n", "supervisor_node = create_team_supervisor(\n", - " \"gpt-5.4\",\n", + " \"gpt-5.6-terra\",\n", " \"You are a supervisor tasked with managing a conversation between the\"\n", " \" following teams: ['ResearchTeam', 'PaperWritingTeam']. Given the following user request,\"\n", " \" respond with the worker to act next. Each worker will perform a\"\n", diff --git "a/PART04-\353\251\200\355\213\260\354\227\220\354\235\264\354\240\204\355\212\270/Ch13-\352\263\204\354\270\265\354\240\201-\354\227\220\354\235\264\354\240\204\355\212\270-\355\214\200/tmp/transformer_\352\265\254\354\241\260_\354\213\254\354\270\265_\354\227\260\352\265\254\353\205\274\353\254\270_\353\252\251\354\260\250_\353\260\217_\354\203\201\354\204\270.md" "b/PART04-\353\251\200\355\213\260\354\227\220\354\235\264\354\240\204\355\212\270/Ch13-\352\263\204\354\270\265\354\240\201-\354\227\220\354\235\264\354\240\204\355\212\270-\355\214\200/tmp/transformer_\352\265\254\354\241\260_\354\213\254\354\270\265_\354\227\260\352\265\254\353\205\274\353\254\270_\353\252\251\354\260\250_\353\260\217_\354\203\201\354\204\270.md" new file mode 100644 index 0000000..7f63740 --- /dev/null +++ "b/PART04-\353\251\200\355\213\260\354\227\220\354\235\264\354\240\204\355\212\270/Ch13-\352\263\204\354\270\265\354\240\201-\354\227\220\354\235\264\354\240\204\355\212\270-\355\214\200/tmp/transformer_\352\265\254\354\241\260_\354\213\254\354\270\265_\354\227\260\352\265\254\353\205\274\353\254\270_\353\252\251\354\260\250_\353\260\217_\354\203\201\354\204\270.md" @@ -0,0 +1,52 @@ +1. 논문 제목: Transformer 구조의 심층 분석: 자기어텐션, 병렬화, 학습 안정성 및 현대적 변형 +2. 초록 +3. 1. 서론 +4. 1.1 연구 배경과 문제 정의 +5. 1.2 연구 목적 및 연구 질문 +6. 1.3 논문의 구성 +7. 2. Transformer의 이론적·기술적 배경 +8. 2.1 순차 모델(RNN/LSTM)과 CNN 기반 접근의 한계 +9. 2.2 Attention 메커니즘의 발전 +10. 2.3 Transformer의 핵심 설계 원칙 +11. 3. Transformer 전체 아키텍처 +12. 3.1 Encoder–Decoder 구성 +13. 3.2 입력 표현: 토큰 임베딩과 위치 정보 +14. 3.3 계층적 정보 흐름과 잔차 연결 +15. 4. 자기어텐션(Self-Attention)의 수학적 구조 +16. 4.1 Query, Key, Value의 정의와 의미 +17. 4.2 Scaled Dot-Product Attention +18. 4.3 Multi-Head Attention +19. 4.4 마스킹과 인과적 어텐션 +20. 5. Transformer 블록의 구성 요소 +21. 5.1 Position-wise Feed-Forward Network +22. 5.2 Layer Normalization과 Residual Connection +23. 5.3 Dropout 및 정규화 전략 +24. 6. 위치 정보의 표현 방법 +25. 6.1 Sinusoidal Positional Encoding +26. 6.2 학습형 위치 임베딩 +27. 6.3 Relative Position 및 Rotary Position Embedding +28. 7. 학습과 추론 과정 +29. 7.1 교사강요(Teacher Forcing)와 다음 토큰 예측 +30. 7.2 목적함수, 최적화기 및 학습률 스케줄링 +31. 7.3 Autoregressive Decoding과 KV Cache +32. 8. 계산 복잡도, 확장성 및 효율화 +33. 8.1 표준 어텐션의 시간·메모리 복잡도 +34. 8.2 긴 문맥 문제와 희소·선형 어텐션 +35. 8.3 FlashAttention, MQA/GQA 및 시스템 최적화 +36. 9. 대표 Transformer 계열 모델과 구조적 변형 +37. 9.1 Encoder-only: BERT 계열 +38. 9.2 Decoder-only: GPT 계열 +39. 9.3 Encoder–Decoder: T5 및 번역 모델 +40. 9.4 Vision Transformer와 멀티모달 확장 +41. 10. 장점, 한계 및 위험 요인 +42. 10.1 병렬성, 표현력 및 전이학습의 장점 +43. 10.2 데이터·연산 자원 의존성과 장문 취약성 +44. 10.3 환각, 편향, 보안 및 해석 가능성 문제 +45. 11. 평가 방법과 실험 설계 +46. 11.1 과제별 성능 지표 +47. 11.2 절제 연구와 재현성 검증 +48. 11.3 효율성·안전성·공정성의 종합 평가 +49. 12. 결론 및 향후 연구 방향 +50. 12.1 연구 내용 요약 +51. 12.2 차세대 Transformer 연구 과제 +52. 참고문헌 diff --git "a/PART04-\353\251\200\355\213\260\354\227\220\354\235\264\354\240\204\355\212\270/Ch13-\352\263\204\354\270\265\354\240\201-\354\227\220\354\235\264\354\240\204\355\212\270-\355\214\200/tmp/transformer_\352\265\254\354\241\260_\354\213\254\354\270\265_\354\227\260\352\265\254\353\205\274\353\254\270_\353\252\251\354\260\250_\353\260\217_\354\203\201\354\204\270\353\202\264\354\232\251.md" "b/PART04-\353\251\200\355\213\260\354\227\220\354\235\264\354\240\204\355\212\270/Ch13-\352\263\204\354\270\265\354\240\201-\354\227\220\354\235\264\354\240\204\355\212\270-\355\214\200/tmp/transformer_\352\265\254\354\241\260_\354\213\254\354\270\265_\354\227\260\352\265\254\353\205\274\353\254\270_\353\252\251\354\260\250_\353\260\217_\354\203\201\354\204\270\353\202\264\354\232\251.md" new file mode 100644 index 0000000..4fbcc90 --- /dev/null +++ "b/PART04-\353\251\200\355\213\260\354\227\220\354\235\264\354\240\204\355\212\270/Ch13-\352\263\204\354\270\265\354\240\201-\354\227\220\354\235\264\354\240\204\355\212\270-\355\214\200/tmp/transformer_\352\265\254\354\241\260_\354\213\254\354\270\265_\354\227\260\352\265\254\353\205\274\353\254\270_\353\252\251\354\260\250_\353\260\217_\354\203\201\354\204\270\353\202\264\354\232\251.md" @@ -0,0 +1,64 @@ +1. 제목: Transformer 구조의 심층 분석: 자기주의 기반 신경망의 구성, 학습, 확장 및 응용 +2. 초록 +3. 1. 서론 +- 연구 배경과 문제 정의 +- 연구 목적 및 범위 +- 논문의 구성 +4. 2. Transformer의 이론적 배경과 등장 배경 +- 순환신경망·합성곱신경망 기반 시퀀스 모델의 한계 +- Attention 메커니즘의 발전 +- “Attention Is All You Need”의 핵심 기여 +5. 3. Transformer의 전체 아키텍처 +- 인코더–디코더 구조 +- 입력 처리 흐름과 출력 생성 흐름 +- 모듈 간 데이터 흐름 +6. 4. 입력 표현: 토큰화, 임베딩, 위치 정보 +- 토큰화와 어휘 표현 +- 토큰 임베딩 및 스케일링 +- 절대·상대 위치 인코딩 +7. 5. 자기주의 메커니즘 +- Query, Key, Value의 개념 +- Scaled Dot-Product Attention의 계산 +- 마스킹과 인과적 자기주의 +8. 6. 멀티헤드 어텐션과 표현 학습 +- 다중 헤드 분할과 병렬 주의 +- 헤드 결합 및 출력 투영 +- 헤드 다양성, 중복 및 해석 가능성 +9. 7. 인코더 블록의 세부 구조 +- 자기주의 하위층 +- 위치별 피드포워드 네트워크 +- 잔차 연결, Layer Normalization, Dropout +10. 8. 디코더 블록의 세부 구조 +- 마스크드 자기주의 +- 인코더–디코더 교차주의 +- 자기회귀적 토큰 생성 +11. 9. 학습 목적함수와 최적화 전략 +- 교사 강요와 다음 토큰 예측 +- Cross-Entropy Loss와 라벨 스무딩 +- Adam, 학습률 스케줄링, 정규화 +12. 10. 추론 과정과 디코딩 전략 +- Greedy, Beam Search, 샘플링 +- Top-k·Top-p·Temperature +- KV 캐시와 지연시간 최적화 +13. 11. 계산 복잡도와 효율성 문제 +- 시퀀스 길이에 대한 이차 복잡도 +- 메모리 병목과 병렬화 특성 +- 희소·선형 어텐션 및 FlashAttention +14. 12. 사전학습 패러다임과 Transformer 계열 모델 +- Encoder-only: BERT 계열 +- Decoder-only: GPT 계열 +- Encoder–decoder: T5·BART 계열 +15. 13. 규모 확장과 현대적 구조 개선 +- Scaling laws와 데이터·파라미터·연산량 +- RoPE, RMSNorm, SwiGLU, GQA/MQA +- Mixture-of-Experts와 장문맥 처리 +16. 14. 주요 응용 분야 +- 기계번역과 텍스트 생성 +- 정보검색, 질의응답, 요약 +- 비전·음성·멀티모달 Transformer +17. 15. 한계, 위험 및 연구 과제 +- 환각, 편향, 설명 가능성 +- 장문맥 일반화와 사실성 +- 에너지 비용, 데이터 거버넌스, 안전성 +18. 16. 결론 +19. 참고문헌 작성 지침 diff --git "a/PART05-\355\225\265\354\213\254-\352\270\260\353\212\245-\352\265\254\355\230\204\355\225\230\352\270\260/Ch14-LangGraph-\355\231\234\354\232\251-Agent-\352\265\254\354\266\225/03-LangGraph-Agent.ipynb" "b/PART05-\355\225\265\354\213\254-\352\270\260\353\212\245-\352\265\254\355\230\204\355\225\230\352\270\260/Ch14-LangGraph-\355\231\234\354\232\251-Agent-\352\265\254\354\266\225/03-LangGraph-Agent.ipynb" index 396d508..ec6f2fd 100644 --- "a/PART05-\355\225\265\354\213\254-\352\270\260\353\212\245-\352\265\254\355\230\204\355\225\230\352\270\260/Ch14-LangGraph-\355\231\234\354\232\251-Agent-\352\265\254\354\266\225/03-LangGraph-Agent.ipynb" +++ "b/PART05-\355\225\265\354\213\254-\352\270\260\353\212\245-\352\265\254\355\230\204\355\225\230\352\270\260/Ch14-LangGraph-\355\231\234\354\232\251-Agent-\352\265\254\354\266\225/03-LangGraph-Agent.ipynb" @@ -209,8 +209,8 @@ "from langchain.chat_models import init_chat_model\n", "\n", "# LLM 초기화\n", - "# 다른 모델을 사용하려면 gpt-5.4-mini, claude-sonnet-5 등으로 변경 가능\n", - "llm = init_chat_model(\"gpt-5.4\")\n", + "# 모델 등급: gpt-5.6-sol(high) / gpt-5.6-terra(medium) / gpt-5.6-luna(low)\n", + "llm = init_chat_model(\"gpt-5.6-terra\", reasoning_effort=\"none\")\n", "\n", "# LLM 에 도구 바인딩\n", "llm_with_tools = llm.bind_tools(tools)" diff --git "a/PART05-\355\225\265\354\213\254-\352\270\260\353\212\245-\352\265\254\355\230\204\355\225\230\352\270\260/Ch15-\354\244\221\352\260\204-\353\213\250\352\263\204\354\235\230-\354\203\201\355\203\234-\354\210\230\353\217\231-\354\227\205\353\215\260\354\235\264\355\212\270/07-LangGraph-Manual-State-Update.ipynb" "b/PART05-\355\225\265\354\213\254-\352\270\260\353\212\245-\352\265\254\355\230\204\355\225\230\352\270\260/Ch15-\354\244\221\352\260\204-\353\213\250\352\263\204\354\235\230-\354\203\201\355\203\234-\354\210\230\353\217\231-\354\227\205\353\215\260\354\235\264\355\212\270/07-LangGraph-Manual-State-Update.ipynb" index 2a6db6e..9c0dcaa 100644 --- "a/PART05-\355\225\265\354\213\254-\352\270\260\353\212\245-\352\265\254\355\230\204\355\225\230\352\270\260/Ch15-\354\244\221\352\260\204-\353\213\250\352\263\204\354\235\230-\354\203\201\355\203\234-\354\210\230\353\217\231-\354\227\205\353\215\260\354\235\264\355\212\270/07-LangGraph-Manual-State-Update.ipynb" +++ "b/PART05-\355\225\265\354\213\254-\352\270\260\353\212\245-\352\265\254\355\230\204\355\225\230\352\270\260/Ch15-\354\244\221\352\260\204-\353\213\250\352\263\204\354\235\230-\354\203\201\355\203\234-\354\210\230\353\217\231-\354\227\205\353\215\260\354\235\264\355\212\270/07-LangGraph-Manual-State-Update.ipynb" @@ -112,8 +112,8 @@ "# 도구 목록 정의\n", "tools = [tool]\n", "\n", - "# LLM 초기화 (OpenAI 키 사용 시 gpt-5.4, gpt-5.4-mini 등으로 변경)\n", - "llm = init_chat_model(\"gpt-5.4\")\n", + "# LLM 초기화 (OpenAI 키 사용 시 gpt-5.6-terra, gpt-5.6-luna 등으로 변경)\n", + "llm = init_chat_model(\"gpt-5.6-terra\", reasoning_effort=\"none\")\n", "\n", "# 도구와 LLM 결합\n", "llm_with_tools = llm.bind_tools(tools, parallel_tool_calls=False)\n", @@ -836,7 +836,7 @@ "thread_id = generate_random_hash()\n", "print(f\"thread_id: {thread_id}\")\n", "\n", - "question = \"LangGraph 에 대해서 배워보고 싶습니다. 유용한 자료를 추천해 주세요!\"\n", + "question = \"LangGraph 에 대해서 배워보고 싶습니다. 웹 검색 도구로 최신 자료를 찾아서 추천해 주세요!\"\n", "\n", "# 초기 입력 상태를 정의\n", "input = State(messages=[(\"user\", question)])\n", diff --git "a/PART05-\355\225\265\354\213\254-\352\270\260\353\212\245-\352\265\254\355\230\204\355\225\230\352\270\260/Ch16-\354\203\201\355\203\234-\354\273\244\354\212\244\355\204\260\353\247\210\354\235\264\354\247\225/08-LangGraph-State-Customization.ipynb" "b/PART05-\355\225\265\354\213\254-\352\270\260\353\212\245-\352\265\254\355\230\204\355\225\230\352\270\260/Ch16-\354\203\201\355\203\234-\354\273\244\354\212\244\355\204\260\353\247\210\354\235\264\354\247\225/08-LangGraph-State-Customization.ipynb" index 25513fe..dd30165 100644 --- "a/PART05-\355\225\265\354\213\254-\352\270\260\353\212\245-\352\265\254\355\230\204\355\225\230\352\270\260/Ch16-\354\203\201\355\203\234-\354\273\244\354\212\244\355\204\260\353\247\210\354\235\264\354\247\225/08-LangGraph-State-Customization.ipynb" +++ "b/PART05-\355\225\265\354\213\254-\352\270\260\353\212\245-\352\265\254\355\230\204\355\225\230\352\270\260/Ch16-\354\203\201\355\203\234-\354\273\244\354\212\244\355\204\260\353\247\210\354\235\264\354\247\225/08-LangGraph-State-Customization.ipynb" @@ -180,8 +180,8 @@ "# 도구 목록 추가(HumanRequest 도구)\n", "tools = [tool, HumanRequest]\n", "\n", - "# LLM 초기화 (OpenAI 키 사용 시 gpt-5.4, gpt-5.4-mini 등으로 변경)\n", - "llm = init_chat_model(\"gpt-5.4\")\n", + "# LLM 초기화 (OpenAI 키 사용 시 gpt-5.6-terra, gpt-5.6-luna 등으로 변경)\n", + "llm = init_chat_model(\"gpt-5.6-terra\", reasoning_effort=\"none\")\n", "\n", "# 도구 바인딩\n", "llm_with_tools = llm.bind_tools(tools)\n", diff --git "a/PART05-\355\225\265\354\213\254-\352\270\260\353\212\245-\352\265\254\355\230\204\355\225\230\352\270\260/Ch17-ToolNode/10-LangGraph-ToolNode.ipynb" "b/PART05-\355\225\265\354\213\254-\352\270\260\353\212\245-\352\265\254\355\230\204\355\225\230\352\270\260/Ch17-ToolNode/10-LangGraph-ToolNode.ipynb" index d0ac9e0..0ffe8d2 100644 --- "a/PART05-\355\225\265\354\213\254-\352\270\260\353\212\245-\352\265\254\355\230\204\355\225\230\352\270\260/Ch17-ToolNode/10-LangGraph-ToolNode.ipynb" +++ "b/PART05-\355\225\265\354\213\254-\352\270\260\353\212\245-\352\265\254\355\230\204\355\225\230\352\270\260/Ch17-ToolNode/10-LangGraph-ToolNode.ipynb" @@ -307,8 +307,8 @@ "from langchain.chat_models import init_chat_model\n", "\n", "# LLM 모델 초기화 및 도구 바인딩\n", - "# OpenAI 키를 사용하는 경우 gpt-5.4, gpt-5.4-mini 등으로 변경하세요\n", - "model_with_tools = init_chat_model(\"gpt-5.4\").bind_tools(tools)" + "# OpenAI 키를 사용하는 경우 gpt-5.6-terra, gpt-5.6-luna 등으로 변경하세요\n", + "model_with_tools = init_chat_model(\"gpt-5.6-terra\", reasoning_effort=\"none\").bind_tools(tools)" ] }, { diff --git "a/PART05-\355\225\265\354\213\254-\352\270\260\353\212\245-\352\265\254\355\230\204\355\225\230\352\270\260/Ch21-LangGraph-\354\212\244\355\212\270\353\246\254\353\260\215-\353\252\250\353\223\234/03-LangGraph-Streaming.ipynb" "b/PART05-\355\225\265\354\213\254-\352\270\260\353\212\245-\352\265\254\355\230\204\355\225\230\352\270\260/Ch21-LangGraph-\354\212\244\355\212\270\353\246\254\353\260\215-\353\252\250\353\223\234/03-LangGraph-Streaming.ipynb" index bc1e4d2..1f0e818 100644 --- "a/PART05-\355\225\265\354\213\254-\352\270\260\353\212\245-\352\265\254\355\230\204\355\225\230\352\270\260/Ch21-LangGraph-\354\212\244\355\212\270\353\246\254\353\260\215-\353\252\250\353\223\234/03-LangGraph-Streaming.ipynb" +++ "b/PART05-\355\225\265\354\213\254-\352\270\260\353\212\245-\352\265\254\355\230\204\355\225\230\352\270\260/Ch21-LangGraph-\354\212\244\355\212\270\353\246\254\353\260\215-\353\252\250\353\223\234/03-LangGraph-Streaming.ipynb" @@ -127,8 +127,8 @@ " return f\"The weather in {city} is sunny!\"\n", "\n", "\n", - "# 다른 모델을 사용하려면 gpt-5.4-mini, claude-sonnet-5 등으로 변경 가능\n", - "model = init_chat_model(\"gpt-5.4\")\n", + "# 모델 등급: gpt-5.6-sol(high) / gpt-5.6-terra(medium) / gpt-5.6-luna(low)\n", + "model = init_chat_model(\"gpt-5.6-terra\", reasoning_effort=\"none\")\n", "agent = create_agent(model=model, tools=[get_weather])\n", "\n", "# 기본 스트리밍 (updates 모드)\n", @@ -1483,8 +1483,8 @@ " return f\"Processed {data_size} items successfully!\"\n", "\n", "\n", - "# 다른 모델을 사용하려면 gpt-5.4-mini, claude-sonnet-5 등으로 변경 가능\n", - "model = init_chat_model(\"gpt-5.4\")\n", + "# 모델 등급: gpt-5.6-sol(high) / gpt-5.6-terra(medium) / gpt-5.6-luna(low)\n", + "model = init_chat_model(\"gpt-5.6-terra\", reasoning_effort=\"none\")\n", "agent = create_agent(model=model, tools=[process_data])\n", "\n", "# 커스텀 스트리밍 모드로 진행 상황 추적\n", @@ -1600,8 +1600,8 @@ ], "source": [ "# 스트리밍 비활성화된 모델\n", - "# 다른 모델을 사용하려면 gpt-5.4-mini, claude-sonnet-5 등으로 변경 가능\n", - "non_streaming_model = init_chat_model(\"gpt-5.4\", disable_streaming=True)\n", + "# 모델 등급: gpt-5.6-sol(high) / gpt-5.6-terra(medium) / gpt-5.6-luna(low)\n", + "non_streaming_model = init_chat_model(\"gpt-5.6-terra\", reasoning_effort=\"none\", disable_streaming=True)\n", "\n", "agent = create_agent(model=non_streaming_model, tools=[get_weather])\n", "\n", @@ -1750,8 +1750,8 @@ " return f\"Analysis complete. {analysis_result}\"\n", "\n", "\n", - "# 다른 모델을 사용하려면 gpt-5.4-mini, claude-sonnet-5 등으로 변경 가능\n", - "model = init_chat_model(\"gpt-5.4\")\n", + "# 모델 등급: gpt-5.6-sol(high) / gpt-5.6-terra(medium) / gpt-5.6-luna(low)\n", + "model = init_chat_model(\"gpt-5.6-terra\", reasoning_effort=\"none\")\n", "agent = create_agent(model=model, tools=[analyze_data, get_summary])\n", "\n", "print(\"Starting data analysis...\\n\")\n", diff --git "a/PART05-\355\225\265\354\213\254-\352\270\260\353\212\245-\352\265\254\355\230\204\355\225\230\352\270\260/Ch21-LangGraph-\354\212\244\355\212\270\353\246\254\353\260\215-\353\252\250\353\223\234/05-LangGraph-Streaming-Outputs.ipynb" "b/PART05-\355\225\265\354\213\254-\352\270\260\353\212\245-\352\265\254\355\230\204\355\225\230\352\270\260/Ch21-LangGraph-\354\212\244\355\212\270\353\246\254\353\260\215-\353\252\250\353\223\234/05-LangGraph-Streaming-Outputs.ipynb" index 6a97904..5b16d07 100644 --- "a/PART05-\355\225\265\354\213\254-\352\270\260\353\212\245-\352\265\254\355\230\204\355\225\230\352\270\260/Ch21-LangGraph-\354\212\244\355\212\270\353\246\254\353\260\215-\353\252\250\353\223\234/05-LangGraph-Streaming-Outputs.ipynb" +++ "b/PART05-\355\225\265\354\213\254-\352\270\260\353\212\245-\352\265\254\355\230\204\355\225\230\352\270\260/Ch21-LangGraph-\354\212\244\355\212\270\353\246\254\353\260\215-\353\252\250\353\223\234/05-LangGraph-Streaming-Outputs.ipynb" @@ -119,8 +119,8 @@ "tools = [search_keyword]\n", "\n", "# LLM 초기화\n", - "# 다른 모델을 사용하려면 gpt-5.4-mini, claude-sonnet-5 등으로 변경하세요\n", - "llm = init_chat_model(\"gpt-5.4\")\n", + "# 모델 등급: gpt-5.6-sol(high) / gpt-5.6-terra(medium) / gpt-5.6-luna(low)\n", + "llm = init_chat_model(\"gpt-5.6-terra\", reasoning_effort=\"none\")\n", "\n", "# 도구와 LLM 결합\n", "llm_with_tools = llm.bind_tools(tools)\n", diff --git "a/PART05-\355\225\265\354\213\254-\352\270\260\353\212\245-\352\265\254\355\230\204\355\225\230\352\270\260/Ch21-LangGraph-\354\212\244\355\212\270\353\246\254\353\260\215-\353\252\250\353\223\234/15-LangGraph-Streaming-Steps.ipynb" "b/PART05-\355\225\265\354\213\254-\352\270\260\353\212\245-\352\265\254\355\230\204\355\225\230\352\270\260/Ch21-LangGraph-\354\212\244\355\212\270\353\246\254\353\260\215-\353\252\250\353\223\234/15-LangGraph-Streaming-Steps.ipynb" index 5698a6b..fb3b1ac 100644 --- "a/PART05-\355\225\265\354\213\254-\352\270\260\353\212\245-\352\265\254\355\230\204\355\225\230\352\270\260/Ch21-LangGraph-\354\212\244\355\212\270\353\246\254\353\260\215-\353\252\250\353\223\234/15-LangGraph-Streaming-Steps.ipynb" +++ "b/PART05-\355\225\265\354\213\254-\352\270\260\353\212\245-\352\265\254\355\230\204\355\225\230\352\270\260/Ch21-LangGraph-\354\212\244\355\212\270\353\246\254\353\260\215-\353\252\250\353\223\234/15-LangGraph-Streaming-Steps.ipynb" @@ -134,8 +134,8 @@ "# 도구 리스트 생성\n", "tools = [search_keyword]\n", "\n", - "# LLM 초기화 (OpenAI 키 사용 시 gpt-5.4, gpt-5.4-mini 등으로 변경 가능)\n", - "llm = init_chat_model(\"gpt-5.4\")\n", + "# LLM 초기화 (OpenAI 키 사용 시 gpt-5.6-terra, gpt-5.6-luna 등으로 변경 가능)\n", + "llm = init_chat_model(\"gpt-5.6-terra\", reasoning_effort=\"none\")\n", "\n", "# 도구와 LLM 결합\n", "llm_with_tools = llm.bind_tools(tools)\n", @@ -1935,8 +1935,8 @@ "# 도구 리스트 생성\n", "tools = [search_keyword]\n", "\n", - "# LLM 초기화 (OpenAI 키 사용 시 gpt-5.4, gpt-5.4-mini 등으로 변경 가능)\n", - "llm = init_chat_model(\"gpt-5.4\")\n", + "# LLM 초기화 (OpenAI 키 사용 시 gpt-5.6-terra, gpt-5.6-luna 등으로 변경 가능)\n", + "llm = init_chat_model(\"gpt-5.6-terra\", reasoning_effort=\"none\")\n", "\n", "# 도구와 LLM 결합 (tags 추가)\n", "llm_with_tools = llm.bind_tools(tools).with_config(tags=[\"WANT_TO_STREAM\"])\n", @@ -3797,8 +3797,8 @@ "# 도구 리스트 생성\n", "tools = [search_keyword]\n", "\n", - "# LLM 초기화 (OpenAI 키 사용 시 gpt-5.4, gpt-5.4-mini 등으로 변경 가능)\n", - "llm = init_chat_model(\"gpt-5.4\")\n", + "# LLM 초기화 (OpenAI 키 사용 시 gpt-5.6-terra, gpt-5.6-luna 등으로 변경 가능)\n", + "llm = init_chat_model(\"gpt-5.6-terra\", reasoning_effort=\"none\")\n", "\n", "# 도구와 LLM 결합 (tags 추가)\n", "llm_with_tools = llm.bind_tools(tools).with_config(tags=[\"WANT_TO_STREAM\"])\n", @@ -3823,8 +3823,8 @@ " - 200자 이내로 작성\n", " \"\"\"\n", " messages = state[\"messages\"] + [(\"human\", sns_prompt)]\n", - " # SNS 포스트용 LLM (OpenAI 키 사용 시 gpt-5.4, gpt-5.4-mini 등으로 변경 가능)\n", - " sns_llm = init_chat_model(\"gpt-5.4\").with_config(tags=[\"WANT_TO_STREAM2\"])\n", + " # SNS 포스트용 LLM (OpenAI 키 사용 시 gpt-5.6-terra, gpt-5.6-luna 등으로 변경 가능)\n", + " sns_llm = init_chat_model(\"gpt-5.6-terra\", reasoning_effort=\"none\").with_config(tags=[\"WANT_TO_STREAM2\"])\n", " return {\"messages\": [sns_llm.invoke(messages)]}\n", "\n", "\n", diff --git "a/PART05-\355\225\265\354\213\254-\352\270\260\353\212\245-\352\265\254\355\230\204\355\225\230\352\270\260/Ch22-Agent-Chat-UI-OSS/Agent-Chat-UI-OSS.ipynb" "b/PART05-\355\225\265\354\213\254-\352\270\260\353\212\245-\352\265\254\355\230\204\355\225\230\352\270\260/Ch22-Agent-Chat-UI-OSS/Agent-Chat-UI-OSS.ipynb" index ef8a973..28fd535 100644 --- "a/PART05-\355\225\265\354\213\254-\352\270\260\353\212\245-\352\265\254\355\230\204\355\225\230\352\270\260/Ch22-Agent-Chat-UI-OSS/Agent-Chat-UI-OSS.ipynb" +++ "b/PART05-\355\225\265\354\213\254-\352\270\260\353\212\245-\352\265\254\355\230\204\355\225\230\352\270\260/Ch22-Agent-Chat-UI-OSS/Agent-Chat-UI-OSS.ipynb" @@ -163,7 +163,7 @@ "load_dotenv(override=True)\n", "\n", "# 모델 초기화\n", - "model = init_chat_model(\"gpt-5.4\")\n", + "model = init_chat_model(\"gpt-5.6-terra\")\n", "\n", "# 도구 정의: Tavily 검색 도구\n", "tools = [TavilySearch(max_results=3)]\n", diff --git "a/PART05-\355\225\265\354\213\254-\352\270\260\353\212\245-\352\265\254\355\230\204\355\225\230\352\270\260/Ch22-Agent-Chat-UI-OSS/agent.py" "b/PART05-\355\225\265\354\213\254-\352\270\260\353\212\245-\352\265\254\355\230\204\355\225\230\352\270\260/Ch22-Agent-Chat-UI-OSS/agent.py" index 54d68ab..6b1aa93 100644 --- "a/PART05-\355\225\265\354\213\254-\352\270\260\353\212\245-\352\265\254\355\230\204\355\225\230\352\270\260/Ch22-Agent-Chat-UI-OSS/agent.py" +++ "b/PART05-\355\225\265\354\213\254-\352\270\260\353\212\245-\352\265\254\355\230\204\355\225\230\352\270\260/Ch22-Agent-Chat-UI-OSS/agent.py" @@ -6,7 +6,7 @@ load_dotenv(override=True) # 모델 초기화 -model = init_chat_model("gpt-5.4") +model = init_chat_model("gpt-5.6-terra", reasoning_effort="none") # 도구 정의: Tavily 검색 도구 tools = [TavilySearch(max_results=3)] diff --git a/README.md b/README.md index 0b5e7ff..1b10ae6 100644 --- a/README.md +++ b/README.md @@ -68,7 +68,7 @@ TAVILY_API_KEY= ### 4. 기본 모델 -실습 코드는 기본적으로 OpenAI `gpt-5.4` 를 사용합니다 (`init_chat_model("gpt-5.4")`). 다른 모델을 사용하려면 `gpt-5.4-mini`, `anthropic:claude-sonnet-5` 등으로 바꿔 실행할 수 있습니다. (Ollama 로컬 모델 예제는 `PART02/Ch02/03-QuickStart-LangGraph-Ollama.ipynb` 를 참고하세요.) +실습 코드는 기본적으로 OpenAI `gpt-5.6-terra` 를 사용합니다 (`init_chat_model("gpt-5.6-terra")`). 모델 등급은 `gpt-5.6-sol`(high) / `gpt-5.6-terra`(medium) / `gpt-5.6-luna`(low) 이며, 대부분의 실습은 medium 또는 low 등급을 사용합니다. gpt-5.6 계열은 Chat Completions API 에서 추론이 켜진 상태로 함수 도구를 쓸 수 없으므로, 실습 코드는 `reasoning_effort="none"` 으로 모델을 생성합니다 (자세한 설명은 `PART01/Ch01/01-LangGraph-Models.ipynb`). (Ollama 로컬 모델 예제는 `PART02/Ch02/03-QuickStart-LangGraph-Ollama.ipynb` 를 참고하세요.) ## 사용 라이브러리 버전 @@ -185,7 +185,7 @@ PART 01 → PART 02 → PART 03 → PART 04 → PART 05 → Appendix 순서로 - **Python**: 3.11 이상 (`.python-version` 참고) - **API Keys**: - - OpenAI API Key (기본 모델 `gpt-5.4`) + - OpenAI API Key (기본 모델 `gpt-5.6-terra`) - Anthropic API Key (Claude 모델 사용 시, 선택사항) - Tavily API Key (웹 검색 실습) - LangSmith API Key (추적, 선택사항) diff --git a/pyproject.toml b/pyproject.toml index b18b976..69f6513 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -41,7 +41,7 @@ dependencies = [ "psycopg2-binary>=2.9.12", "psycopg[binary,pool]>=3.3.5", # Document Processing - "arxiv>=4.0.1", + "arxiv>=2.4.1,<3.0", # langchain-community ArxivRetriever still calls Search.results(), removed in arxiv 4.x "pdfplumber>=0.11.10", "pymupdf>=1.28.2", # Development Tools diff --git a/uv.lock b/uv.lock index 97582b9..1a52d77 100644 --- a/uv.lock +++ b/uv.lock @@ -294,15 +294,15 @@ wheels = [ [[package]] name = "arxiv" -version = "4.0.1" +version = "2.4.1" source = { registry = "https://pypi.org/simple" } dependencies = [ - { name = "lxml" }, + { name = "feedparser" }, { name = "requests" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/41/2e/c6cd87cf0ffa1ae00cb23b1a0b56bd1e93ae91296f093d2c0c30b479ca11/arxiv-4.0.1.tar.gz", hash = "sha256:304e91a9f869fa4cc362a0a6f38ecb956eec11b83619465172ab24b9453e3d51", size = 198962, upload-time = "2026-07-31T23:42:17.815Z" } +sdist = { url = "https://files.pythonhosted.org/packages/24/6e/647dd134e66d3ea6ff8aba2a177a37c74245625cfc58184e3aff99c8d8ec/arxiv-2.4.1.tar.gz", hash = "sha256:691606c1069bcca8316fcb082f5d15e65f1f24a021b0b87f01b9fa56347f63c8", size = 74975, upload-time = "2026-03-04T03:05:33.991Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/c8/4a/b0b203c02e283e2312ed12c5ddb2d9f8ddec557f8f49f3810e9cc10591d4/arxiv-4.0.1-py3-none-any.whl", hash = "sha256:72a79d22a83fec14c3a23966791692e2400399c218ad4e5416ce84af817a9cc9", size = 13015, upload-time = "2026-07-31T23:42:16.591Z" }, + { url = "https://files.pythonhosted.org/packages/3d/6a/297380dc42fa25dff095feda66d46f7abba77ba54579d079071a2459e8d3/arxiv-2.4.1-py3-none-any.whl", hash = "sha256:060d678410ffc224ada01089f877b7676f250e37f96c140bad6c287afadb15d8", size = 12106, upload-time = "2026-03-04T03:05:33.029Z" }, ] [[package]] @@ -3162,7 +3162,7 @@ dependencies = [ [package.metadata] requires-dist = [ - { name = "arxiv", specifier = ">=4.0.1" }, + { name = "arxiv", specifier = ">=2.4.1,<3.0" }, { name = "deepagents", specifier = ">=0.7.13" }, { name = "faiss-cpu", specifier = ">=1.15.0" }, { name = "fastmcp", specifier = ">=4.0.3" }, @@ -5794,7 +5794,7 @@ wheels = [ [[package]] name = "requests" -version = "2.34.2" +version = "2.32.5" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "certifi" }, @@ -5802,9 +5802,9 @@ dependencies = [ { name = "idna" }, { name = "urllib3" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/ac/c3/e2a2b89f2d3e2179abd6d00ebd70bff6273f37fb3e0cc209f48b39d00cbf/requests-2.34.2.tar.gz", hash = "sha256:f288924cae4e29463698d6d60bc6a4da69c89185ad1e0bcc4104f584e960b9ed", size = 142856, upload-time = "2026-05-14T19:25:27.735Z" } +sdist = { url = "https://files.pythonhosted.org/packages/c9/74/b3ff8e6c8446842c3f5c837e9c3dfcfe2018ea6ecef224c710c85ef728f4/requests-2.32.5.tar.gz", hash = "sha256:dbba0bac56e100853db0ea71b82b4dfd5fe2bf6d3754a8893c3af500cec7d7cf", size = 134517, upload-time = "2025-08-18T20:46:02.573Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/a0/f4/c67b0b3f1b9245e8d266f0f112c500d50e5b4e83cb6f3b71b6528104182a/requests-2.34.2-py3-none-any.whl", hash = "sha256:2a0d60c172f83ac6ab31e4554906c0f3b3588d37b5cb939b1c061f4907e278e0", size = 73075, upload-time = "2026-05-14T19:25:26.443Z" }, + { url = "https://files.pythonhosted.org/packages/1e/db/4254e3eabe8020b458f1a747140d32277ec7a271daf1d235b70dc0b4e6e3/requests-2.32.5-py3-none-any.whl", hash = "sha256:2462f94637a34fd532264295e186976db0f5d453d1cdd31473c85a6a161affb6", size = 64738, upload-time = "2025-08-18T20:46:00.542Z" }, ] [[package]]