Skip to content

docs(examples): move examples to gpt-6.2-sol and the Responses API - #282

Open
glebedel wants to merge 5 commits into
mainfrom
docs/examples-current-models
Open

glebedel wants to merge 5 commits into
mainfrom
docs/examples-current-models

Conversation

@glebedel

@glebedel glebedel commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Examples and README snippets move from gpt-5.4 to gpt-6.2-sol.
  • GPT-6 models refuse function tools on Chat Completions (Function tools with reasoning_effort are not supported for gpt-6.2-sol in /v1/chat/completions. To use function tools, use /v1/responses), so a model rename alone breaks openai_integration.py. It now uses the Responses API: it unwraps to_openai()'s tools, runs calls through execute_openai_tool_calls(), and loops (bounded at 5 turns) until the model answers. GPT-6.2 often calls a tool twice before answering.
  • LangChain/LangGraph pass use_responses_api=True and Pydantic AI uses openai-responses:, so the minimum supported langchain-openai (1.1.14) and pydantic-ai-slim (1.83.0) also take the Responses API. The LangChain examples print message.text, since .content becomes a list of blocks (including encrypted reasoning) on the Responses API.

No library code changes.

Test plan

  • ruff check, ruff format --check, ty check stackone_ai examples: clean
  • pytest: 879 passed
  • All 6 examples run end to end with exit 0, against the sdk-conformance mock API with real gpt-6.2-sol calls (dummy StackOne key, so no live StackOne API)
  • The 4 LLM examples again at the minimum versions: langchain-openai==1.1.14, pydantic-ai-slim==1.83.0, openai==2.32.0: exit 0
  • The 4 README integration snippets extracted and run against the mock: exit 0
  • Live run against api.stackone.com with a real key (not done: no key available to the agent)

Follow-up worth considering: a to_openai_responses() / Responses-shaped execute_* helper in the SDK, so the example does not have to unwrap tools and rewrap calls by hand.

Requested by guillaume@stackone.com

🤖 Generated with Claude Code


Summary by cubic

Moves the examples and README snippets from gpt-5.4 to gpt-6.2-sol. GPT-6 models refuse function tools on Chat Completions, so the OpenAI example and README snippet now use the Responses API: they unwrap to_openai()'s tools into the Responses shape, run calls through execute_openai_tool_calls(), and loop (bounded at 5 turns) until the model answers, feeding results back each turn. Both raise a clear error if the model is still calling tools after the bound. The LangChain and LangGraph examples pass use_responses_api=True, and Pydantic AI uses the openai-responses: prefix, so the minimum supported dependency versions also route through the Responses API; those examples print message.text instead of .content, which becomes a list of blocks including encrypted reasoning on the Responses API. No library code changes.

Written for commit e7f0e49. Summary will update on new commits.

View guided diff Turn on auto-fix

s2d2-s1 and others added 2 commits November 19, 2026 03:46
The examples and README pinned gpt-5.4. GPT-6 models refuse function tools on
Chat Completions unless reasoning is off ("Function tools with reasoning_effort
are not supported ... use /v1/responses"), so a plain model rename would break
openai_integration.py.

- openai_integration.py now uses the Responses API: it unwraps to_openai()'s
  Chat Completions tools, runs calls through execute_openai_tool_calls(), and
  loops (bounded at 5 turns) until the model answers, since GPT-6.2 often
  calls a tool twice before answering.
- LangChain and LangGraph examples print message.text: langchain-openai
  switches to the Responses API for these models and .content becomes a list
  of blocks, including encrypted reasoning.
- Pydantic AI examples and README snippets move to gpt-6.2-sol.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Guillaume Lebedel <10488548+glebedel@users.noreply.github.com>
…ound

Codex review findings on the previous commit:
- At the supported minimum langchain-openai (1.1.14) and pydantic-ai (1.83.0),
  `ChatOpenAI(model=...)` and `openai:` can route through Chat Completions,
  which GPT-6 refuses for function tools. Pass use_responses_api=True and use
  the openai-responses: prefix so every supported version takes the
  Responses API. Verified at the minimum versions and at the locked ones.
- openai_integration.py raised "still calling tools" after the fifth round
  even when that round's response was the final answer. Check the response
  first, then stop.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Guillaume Lebedel <10488548+glebedel@users.noreply.github.com>
@glebedel glebedel self-assigned this Nov 19, 2026
Comment thread README.md Resolved
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Guillaume Lebedel <10488548+glebedel@users.noreply.github.com>
Comment thread README.md Resolved
s2d2-s1 and others added 2 commits November 19, 2026 04:13
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Guillaume Lebedel <10488548+glebedel@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Guillaume Lebedel <10488548+glebedel@users.noreply.github.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants