SIGN IN SIGN UP

docs(groq): remove duplicate `method` block from `with_structured_output` docstring (#39978)

Closes #39977

---

Anyone reading the `ChatGroq.with_structured_output` reference sees the
`method` argument documented twice, and the two blocks disagree with
each other.

The first block is the current one. It lists three options and matches
how the sibling `langchain-openai` package documents the same argument.
The second block is older. It says the argument is `'function_calling'`
or `'json_mode'`, which stopped being true when `'json_schema'` support
was added. A reader who stops at the second block will not know
`'json_schema'` exists, and the duplicate key also breaks API reference
rendering.

This removes the stale block. The one thing it said that the surviving
block did not was the warning that `'json_mode'` does not support
streaming responses or stop sequences, so that warning moves up rather
than being dropped. Everything else in it was already covered above.

No behaviour changes, docstring only.

The added unit test asserts `method` appears once and that `json_schema`
is still described. It fails on the current `master` and passes with
this change.

---

Disclaimer: this contribution was prepared with the assistance of an AI
agent. I reviewed the change, verified the reproduction from the issue
against `master`, and ran the package unit tests and `ruff` locally
before opening it.

---------

Signed-off-by: Mason Daugherty <github@mdrxy.com>
Co-authored-by: Mason Daugherty <github@mdrxy.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
H
Huzaifa Iftikhar committed
67fa96ffadf6659b25d8d8dc2010875c88a6ac39
Parent: 885e858
Committed by GitHub <noreply@github.com> on 8/27/2026, 11:00:42 PM