fix(openai): add missing tools param to ChatOpenAI with_structured_output (#34075)

This commit is contained in:
Mason Daugherty
2025-12-08 15:47:31 -05:00
committed by GitHub
parent b009ca4d23
commit dff229d018

View File

@@ -3018,6 +3018,7 @@ class ChatOpenAI(BaseChatOpenAI): # type: ignore[override]
method: Literal["function_calling", "json_mode", "json_schema"] = "json_schema",
include_raw: bool = False,
strict: bool | None = None,
tools: list | None = None,
**kwargs: Any,
) -> Runnable[LanguageModelInput, _DictOrPydantic]:
r"""Model wrapper that returns outputs formatted to match the given schema.
@@ -3411,7 +3412,12 @@ class ChatOpenAI(BaseChatOpenAI): # type: ignore[override]
""" # noqa: E501
return super().with_structured_output(
schema, method=method, include_raw=include_raw, strict=strict, **kwargs
schema,
method=method,
include_raw=include_raw,
strict=strict,
tools=tools,
**kwargs,
)