Repository navigation
Conversation
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>
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>
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
gpt-5.4togpt-6.2-sol.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 breaksopenai_integration.py. It now uses the Responses API: it unwrapsto_openai()'s tools, runs calls throughexecute_openai_tool_calls(), and loops (bounded at 5 turns) until the model answers. GPT-6.2 often calls a tool twice before answering.use_responses_api=Trueand Pydantic AI usesopenai-responses:, so the minimum supportedlangchain-openai(1.1.14) andpydantic-ai-slim(1.83.0) also take the Responses API. The LangChain examples printmessage.text, since.contentbecomes 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: cleanpytest: 879 passedsdk-conformancemock API with realgpt-6.2-solcalls (dummy StackOne key, so no live StackOne API)langchain-openai==1.1.14,pydantic-ai-slim==1.83.0,openai==2.32.0: exit 0Follow-up worth considering: a
to_openai_responses()/ Responses-shapedexecute_*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.4togpt-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 unwrapto_openai()'s tools into the Responses shape, run calls throughexecute_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 passuse_responses_api=True, and Pydantic AI uses theopenai-responses:prefix, so the minimum supported dependency versions also route through the Responses API; those examples printmessage.textinstead 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.