From da97013f96302a8c0e6a0e21957ae82f44158b05 Mon Sep 17 00:00:00 2001 From: ccurme Date: Tue, 17 Jun 2025 16:23:06 -0400 Subject: [PATCH] docs: update OpenAI integration page (#31646) model_kwargs is no longer needed for `truncation` and `reasoning`. --- docs/docs/integrations/chat/openai.ipynb | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/docs/docs/integrations/chat/openai.ipynb b/docs/docs/integrations/chat/openai.ipynb index aa905bcca1b..ad289c2ad39 100644 --- a/docs/docs/integrations/chat/openai.ipynb +++ b/docs/docs/integrations/chat/openai.ipynb @@ -830,7 +830,7 @@ "# Initialize model\n", "llm = ChatOpenAI(\n", " model=\"computer-use-preview\",\n", - " model_kwargs={\"truncation\": \"auto\"},\n", + " truncation=\"auto\",\n", ")\n", "\n", "# Bind computer-use tool\n", @@ -1359,7 +1359,7 @@ "\n", "Some OpenAI models will generate separate text content illustrating their reasoning process. See OpenAI's [reasoning documentation](https://platform.openai.com/docs/guides/reasoning?api-mode=responses) for details.\n", "\n", - "OpenAI can return a summary of the model's reasoning (although it doesn't expose the raw reasoning tokens). To configure `ChatOpenAI` to return this summary, specify the `reasoning` parameter:" + "OpenAI can return a summary of the model's reasoning (although it doesn't expose the raw reasoning tokens). To configure `ChatOpenAI` to return this summary, specify the `reasoning` parameter. `ChatOpenAI` will automatically route to the Responses API if this parameter is set." ] }, { @@ -1387,11 +1387,7 @@ " \"summary\": \"auto\", # 'detailed', 'auto', or None\n", "}\n", "\n", - "llm = ChatOpenAI(\n", - " model=\"o4-mini\",\n", - " use_responses_api=True,\n", - " model_kwargs={\"reasoning\": reasoning},\n", - ")\n", + "llm = ChatOpenAI(model=\"o4-mini\", reasoning=reasoning)\n", "response = llm.invoke(\"What is 3^3?\")\n", "\n", "# Output\n",