Skip to content

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

Merged
Mason Daugherty (mdrxy) merged 2 commits into
langchain-ai:masterfrom
HuzaifaChaudary:HuzaifaChaudary/groq/duplicate-method-docstring
Aug 27, 2026
Merged

Mason Daugherty (mdrxy) merged 2 commits into
langchain-ai:masterfrom
HuzaifaChaudary:HuzaifaChaudary/groq/duplicate-method-docstring

Conversation

@HuzaifaChaudary

Copy link
Copy Markdown
Contributor

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.

…ut` docstring

the docstring documented `method` twice. the second block was stale and listed
only `function_calling` and `json_mode` so it contradicted the first block which
also documents `json_schema`

kept the streaming warning from the stale block because it was the only line not
already covered above
Copilot AI lite review requested due to automatic review settings August 27, 2026 22:55
@github-actions github-actions Bot added fix For PRs that implement a fix groq `langchain-groq` package issues & PRs integration PR made that is related to a provider partner package integration size: XS < 50 LOC labels Aug 27, 2026
@github-actions

This comment has been minimized.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Removes a duplicate/stale method parameter block from ChatGroq.with_structured_output’s docstring in langchain-groq to fix broken/incorrect API reference rendering, and adds a regression test to prevent the duplication from reappearing.

Changes:

  • Delete the older duplicated method: docstring block that omitted json_schema.
  • Keep the json_mode limitation warning in the remaining docstring content.
  • Add a unit test asserting the docstring documents method: exactly once and still mentions json_schema.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
libs/partners/groq/langchain_groq/chat_models.py Removes the duplicate method docstring block and retains a json_mode warning in the remaining documentation.
libs/partners/groq/tests/unit_tests/test_chat_models.py Adds a regression unit test to ensure the docstring no longer duplicates method: and still references json_schema.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread libs/partners/groq/langchain_groq/chat_models.py Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Mason Daugherty <github@mdrxy.com>
@mdrxy Mason Daugherty (mdrxy) changed the title fix(groq): remove duplicate method block from with_structured_output docstring docs(groq): remove duplicate method block from with_structured_output docstring Aug 27, 2026
@github-actions github-actions Bot added documentation Improvements or additions to documentation and removed fix For PRs that implement a fix labels Aug 27, 2026

@mdrxy Mason Daugherty (mdrxy) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks

@mdrxy
Mason Daugherty (mdrxy) merged commit 67fa96f into langchain-ai:master Aug 27, 2026
53 checks passed
Huzaifa Iftikhar (HuzaifaChaudary) added a commit to HuzaifaChaudary/huzaifa-portfolio that referenced this pull request Aug 29, 2026
Two upstream PRs, both merged in Aug 2026:
- microsoft/playwright#42449 — UI Mode filter summary as a real button
- langchain-ai/langchain#39978 — stale duplicate block in Groq docstring

Reuses the existing .cols layout, reveal, and parallax language; new
rows are picked up by the generic [data-reveal]/[data-plx] queries.
Nav gains an Open Source link in third position so the mobile
nth-child(n+3) rule keeps hiding the same items as before.

Favicon set is cropped from the hero photo, circular-masked, with a
touch of unsharp so the face still reads at 32px:
favicon.ico (16/32/48), 16 and 32 PNGs, and a full-bleed
apple-touch-icon on the paper ground since iOS drops alpha.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QyQQvrZTAJ7tSpEUFMrm8r
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bypass-issue-check documentation Improvements or additions to documentation external groq `langchain-groq` package issues & PRs integration PR made that is related to a provider partner package integration new-contributor size: XS < 50 LOC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

groq: duplicate 'method:' argument definition in ChatGroq.with_structured_output docstring

3 participants