Skip to content

refactor: switch models to gpt-5.6 tiers with reasoning_effort=none - #63

Open
teddylee777 wants to merge 1 commit into
mainfrom
chore/update-langchain-1-4-langgraph-1-2
Open

refactor: switch models to gpt-5.6 tiers with reasoning_effort=none#63
teddylee777 wants to merge 1 commit into
mainfrom
chore/update-langchain-1-4-langgraph-1-2

Conversation

@teddylee777

Copy link
Copy Markdown
Member

Context Block

Key Value
Type refactor
Scope notebooks / helper modules / deps / README
Base main
Branch chore/update-langchain-1-4-langgraph-1-2
Files 54 changed (46 notebooks, 4 .py, pyproject.toml, uv.lock, README.md, 1 image)

Summary

  • WHAT: 모든 모델 실습을 OpenAI gpt-5.6 등급 모델로 교체. 기본 gpt-5.6-terra(medium), 소형 모델 슬롯 gpt-5.6-luna(low), gpt-5.6-sol(high)은 reasoning_effort 예제에만 사용.
  • WHY: 운영자 요청(high: sol / medium: terra / low: luna, 대부분 medium·low).
  • HOW: 모든 init_chat_model() / ChatOpenAI() 호출에 reasoning_effort="none" 추가. gpt-5.6 계열은 Chat Completions 에서 추론이 켜진 상태로 함수 도구를 쓸 수 없기 때문 (400 Function tools with reasoning_effort are not supported ... set reasoning_effort to 'none'). 문자열로 전달되던 모델(create_agent(model="..."), ModelFallbackMiddleware, SummarizationMiddleware)은 인스턴스로 변경.
  • IMPACT: 학습자는 OPENAI_API_KEY 만으로 전체 실습 실행 가능. response.content 는 여전히 문자열 (Responses API 미사용).
  • RISK: Low — 실제 API 로 49개 노트북을 headless 실행하여 검증함 (아래 Test Plan).

Changes

File Action Description Design Rationale
46 notebooks Modify gpt-5.4gpt-5.6-terra, gpt-5.4-minigpt-5.6-luna; 모든 모델 생성에 reasoning_effort="none" Chat Completions + 함수 도구 제약 회피, content 문자열 유지
PART01/Ch01/01-LangGraph-Models.ipynb Modify reasoning_effort="none" 배경 설명 노트 추가; reasoning 절을 gpt-5.6-sol 기준으로 갱신; 멀티모달 예제를 저장소 로컬 이미지(assets/finance-statement-sample.png, 신규)로 교체 기존 외부 이미지 URL 사망(SSL 오류)
PART01/Ch01/02-LangGraph-Messages.ipynb Modify 이미지 URL 예제를 저장소 raw 이미지로 교체 기존 URL 404
PART01/Ch01/01-QuickStart-LangGraph-Tutorial.ipynb Modify 타임트래블 체크포인트 선택을 state.next == ("tools",) 기준으로 메시지 수 == 6 은 모델의 병렬 도구 호출 수에 따라 달라짐
PART05/Ch15/07-LangGraph-Manual-State-Update.ipynb Modify 질문을 "웹 검색 도구로 … 찾아서" 로 명시 terra 가 도구 없이 직접 답변하여 이후 tool_calls 편집 셀이 실패
Appendix/**/rag/base.py, PART03/Ch10/server/rag/base.py, RAG 노트북 4개 Modify pull_prompt(..., dangerously_pull_public_prompt=True) langsmith ≥ 0.8 이 공개 프롬프트 pull 에 명시적 동의 요구
pyproject.toml, uv.lock Modify arxiv>=2.4.1,<3.0 고정 langchain-community ArxivRetriever 가 arxiv 4.x 에서 제거된 Search.results() 사용
README.md Modify 모델 등급 및 reasoning_effort="none" 안내 환경 설정 정확성

Test Plan

# Type Command / Check Expected Result Status
1 Live API sol/terra/luna invoke, create_agent+tool, ToolStrategy, auto response_format, stream, v3 stream_events, logprobs, 이미지 입력(URL/로컬) 모두 정상 응답 pass
2 Notebook exec jupyter nbconvert --execute 49개 노트북 (실제 API 키 사용) 오류 셀 없음 pass (아래 예외 제외)
3 Static nbformat.validate + 코드 셀 compile() 전체, ruff/py_compile 변경 .py 통과 pass
4 Lock uv lock / uv sync 해결 완료 pass

실행 예외 (코드 결함 아님): 의도된 오류 시연 셀(존재하지 않는 모델명, Pydantic 검증 오류), 외부 서비스 필요(Postgres, Ollama, Neo4j, MCP HTTP 서버, input()), 그리고 로컬 HTTP 프록시(HTTP_PROXY=127.0.0.1…)가 30초 이상 무응답 연결을 끊어 발생한 장문 non-streaming 호출 3건 — 프록시 우회 시 동일 요청 124초 후 정상 완료 확인.

Documentation Gate

  • omb:doc — 의도적 생략 (docs/ 없음, README.md 본 PR 에서 갱신).
  • omb:wiki — N/A.

Related Issues

Refs #61, #62

Checklist

  • Branch name follows naming convention.
  • Commit messages follow the conventional commit template.
  • Linter passes.
  • No secrets committed.
  • Documentation updated if needed.
  • No unrelated changes bundled.

## What Changed
- Default model is now gpt-5.6-terra (medium); small-model slots use
  gpt-5.6-luna (low); gpt-5.6-sol (high) only in the reasoning_effort demo
- Every init_chat_model()/ChatOpenAI() carries reasoning_effort="none";
  string models passed to create_agent / ModelFallbackMiddleware /
  SummarizationMiddleware are now model instances
- Models notebook: explanatory note on why reasoning is disabled;
  reasoning_effort section updated; multimodal demo uses a repo-local
  sample income-statement image instead of a dead external URL
- Messages notebook: image URL examples point at a repo-hosted image
- QuickStart time-travel: select the checkpoint by next == ("tools",)
  instead of an exact message count that varies by model
- Manual-state-update: question explicitly asks for a web search so the
  tool-call edit flow has a tool call to edit
- RAG helpers/notebooks: pull_prompt(..., dangerously_pull_public_prompt=True)
  as required by langsmith >= 0.8
- Pin arxiv < 3.0 (langchain-community ArxivRetriever uses the removed
  Search.results() API in arxiv 4.x)

## Root Cause
gpt-5.6 models reject function tools on the Chat Completions endpoint
unless reasoning is disabled (or the Responses API is used), and several
example inputs/URLs were model- or environment-dependent.

## Test Plan
- [x] Live API: sol/terra/luna invoke, tool calling, ToolStrategy and
      auto response_format, streaming, v3 stream_events, logprobs
- [x] 49 notebooks executed headlessly with nbconvert; all cells pass
      except intentional error demos, external services (Postgres,
      Ollama, MCP HTTP), an input() cell, and long non-streaming calls
      cut off at 30s by the local HTTP proxy (verified OK without proxy)
@teddylee777 teddylee777 added the enhancement New feature or request label Sep 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant