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

GL
8h ago
+95-53

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.