Skip to content

Add LangChain integration page#3

Open
nishithatanukunuri wants to merge 2 commits into
mainfrom
langchain-integration
Open

Add LangChain integration page#3
nishithatanukunuri wants to merge 2 commits into
mainfrom
langchain-integration

Conversation

@nishithatanukunuri
Copy link
Copy Markdown

@nishithatanukunuri nishithatanukunuri commented Jun 5, 2026

Summary

Documents the langchain-zerogpu package (ZGA-447) at /integrations/langchain, following the integration-doc skill structure.

  • New integrations/langchain.mdx covering all 11 LangChain tools and ZeroGPUToolkit: per-tool model IDs (taken from the package source), argument tables, runnable examples, response shapes, patterns/recipes, an at-a-glance reference table, and 11 troubleshooting entries derived from the package's error mapping.
  • Install (pip install langchain-zerogpu) and auth (ZEROGPU_API_KEY / ZEROGPU_PROJECT_ID) instructions.
  • LangChain card moved out of "Coming Soon" into "Editor & Agent Integrations" on integrations/index.mdx.
  • integrations/langchain registered in docs.json nav.

Note: the LangChain docs provider page (ZGA-448) is not live yet (404), so the page links GitHub + PyPI (both verified) and LangChain's tools-concept page; the provider-page link can be added once ZGA-448 ships.

Testing

  • node scripts/normalize-dashes.mjs: clean
  • mint validate: build validation passed
  • External links verified: GitHub repo and PyPI return 200

Summary by CodeRabbit

  • Documentation
    • Added a comprehensive LangChain integration guide with quickstart, setup, usage patterns, tool reference, and troubleshooting.
    • Updated the integrations overview to show LangChain as available (removed it from the "Coming Soon" section).

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jun 5, 2026

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: f41be39a-0c33-418d-ac82-bcf72f291928

📥 Commits

Reviewing files that changed from the base of the PR and between 0f9f9e3 and 249b70e.

📒 Files selected for processing (1)
  • integrations/langchain.mdx
💤 Files with no reviewable changes (1)
  • integrations/langchain.mdx

📝 Walkthrough

Walkthrough

Adds a new LangChain integration docs page and integrates it into site navigation; provides a quickstart, documents eleven LangChain tools plus a toolkit with examples, covers async usage and patterns, and includes a tools reference and troubleshooting guidance.

Changes

LangChain Integration Documentation

Layer / File(s) Summary
Navigation configuration
docs.json, integrations/index.mdx
Add integrations/langchain route to Integrations navigation and add a LangChain card on the integrations landing page.
Guide introduction and quickstart
integrations/langchain.mdx (lines 1–65)
Page frontmatter, intro, video placeholder, prerequisites and API key/project setup, installation instructions, and a first example using ZeroGPUClassifyZeroShotTool with sample JSON output.
Tool catalog documentation
integrations/langchain.mdx (lines 66–444)
Document eleven LangChain BaseTool equivalents (Chat, ChatThinking, Summarize, ClassifyIAB, ClassifyIABEnriched, ClassifyZeroShot, ClassifyStructured, ExtractEntities, ExtractPII, RedactPII, ExtractJSON) and ZeroGPUToolkit, each with tool details, usage snippets, and sample outputs.
Usage patterns and reference
integrations/langchain.mdx (lines 445–529)
Async ainvoke usage, recommended patterns (sanitization, cheap pre-classification, structured extraction, confidence thresholds), consolidated tools reference table, troubleshooting entries, and conclusion with navigation cards.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐇
I hopped through docs to plant a seed,
A LangChain page for every need,
Tools lined up like carrots in a row,
Quickstart ready — now off you go,
Happy hacking, light and fleet!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Add LangChain integration page' accurately reflects the primary change: adding a new LangChain integration documentation page. It is concise, clear, and directly related to the main changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch langchain-integration

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@integrations/langchain.mdx`:
- Around line 113-133: Add a short example output block after the
ZeroGPUChatThinkingTool example to show the "reasoning trace plus answer"
format; update the section for ZeroGPUChatThinkingTool (referencing the class
name ZeroGPUChatThinkingTool and its invoke usage) by inserting a text output
block illustrating a reasoning trace wrapped in a marker (e.g.,
<thinking>...</thinking>) followed by the final answer, matching the style used
in other tool sections so readers see both intermediate steps and the final
response.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 14771cbd-74d8-4298-b112-749e9934584c

📥 Commits

Reviewing files that changed from the base of the PR and between c84518d and 0f9f9e3.

📒 Files selected for processing (3)
  • docs.json
  • integrations/index.mdx
  • integrations/langchain.mdx

Comment on lines +113 to +133
### `ZeroGPUChatThinkingTool`

Same input shape as `ZeroGPUChatTool`, but the model returns a visible step-by-step reasoning trace followed by its answer. Use it for short logic, math, or word problems where you want the small model's intermediate reasoning.

- **Tool name:** `zerogpu_chat_thinking`
- **Model:** `LFM2.5-1.2B-Thinking`
- **Returns:** `str` (reasoning trace plus answer)

| Argument | Required | Default | Description |
| --- | --- | --- | --- |
| `text` | yes | - | The user message to respond to. |
| `system` | no | `None` | Optional system prompt that steers the reply. |

```python
from langchain_zerogpu import ZeroGPUChatThinkingTool

tool = ZeroGPUChatThinkingTool()
print(tool.invoke({
"text": "If a train leaves at 3 PM going 60 mph, when does it cover 150 miles?"
}))
```
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot Jun 5, 2026

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Add example output for consistency.

All other tool sections include an example output block showing what the tool returns, but this section is missing one. Adding an example output would help users understand what the "reasoning trace plus answer" looks like in practice.

📝 Example output to add

After line 132, consider adding an output block similar to:

 print(tool.invoke({
     "text": "If a train leaves at 3 PM going 60 mph, when does it cover 150 miles?"
 }))

+text +<thinking> +Distance = 150 miles, Speed = 60 mph +Time = Distance / Speed = 150 / 60 = 2.5 hours +Starting at 3 PM, adding 2.5 hours gives us 5:30 PM +</thinking> + +The train will cover 150 miles at 5:30 PM. +


</details>

<details>
<summary>🤖 Prompt for AI Agents</summary>

Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @integrations/langchain.mdx around lines 113 - 133, Add a short example
output block after the ZeroGPUChatThinkingTool example to show the "reasoning
trace plus answer" format; update the section for ZeroGPUChatThinkingTool
(referencing the class name ZeroGPUChatThinkingTool and its invoke usage) by
inserting a text output block illustrating a reasoning trace wrapped in a marker
(e.g., ...) followed by the final answer, matching the
style used in other tool sections so readers see both intermediate steps and the
final response.


</details>

<!-- fingerprinting:phantom:triton:puma -->

<!-- This is an auto-generated reply by CodeRabbit -->

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.

@nishithatanukunuri Please fix this

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Seems like the humans are having a chat. I'll hop back into my burrow for now. If you need me again, just tag @coderabbitai in a new comment, and I'll come hopping out!

Comment on lines +113 to +133
### `ZeroGPUChatThinkingTool`

Same input shape as `ZeroGPUChatTool`, but the model returns a visible step-by-step reasoning trace followed by its answer. Use it for short logic, math, or word problems where you want the small model's intermediate reasoning.

- **Tool name:** `zerogpu_chat_thinking`
- **Model:** `LFM2.5-1.2B-Thinking`
- **Returns:** `str` (reasoning trace plus answer)

| Argument | Required | Default | Description |
| --- | --- | --- | --- |
| `text` | yes | - | The user message to respond to. |
| `system` | no | `None` | Optional system prompt that steers the reply. |

```python
from langchain_zerogpu import ZeroGPUChatThinkingTool

tool = ZeroGPUChatThinkingTool()
print(tool.invoke({
"text": "If a train leaves at 3 PM going 60 mph, when does it cover 150 miles?"
}))
```
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.

@nishithatanukunuri Please fix this


agent.invoke({
"messages": [
{"role": "user", "content": "Redact the PII in: 'Call Jane at 555-0100.'"}
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.

Give a better example and include output text too.

Every tool implements the async path, so the same inputs work with `ainvoke` inside LangGraph nodes or any asyncio application:

```python
result = await tool.ainvoke({"text": "...", "labels": ["a", "b"]})
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.

Use better example for async usage. Summarization should be good enough

## Overview

This guide walks through [`langchain-zerogpu`](https://github.com/zerogpu/langchain-zerogpu), the official package that exposes ZeroGPU's task models as first-class LangChain `BaseTool` subclasses. You'll install the package from [PyPI](https://pypi.org/project/langchain-zerogpu/), authenticate with your API key and project ID, invoke your first tool, and then work through all eleven tools - chat, summarization, classification, entity and JSON extraction, and PII handling - plus the `ZeroGPUToolkit` that binds the whole set to an agent in one line. By the end, any LangChain agent (including `create_agent` and LangGraph graphs) can hand its repeatable NLP work to ZeroGPU instead of spending frontier-model tokens.

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.

Add a cookbook section and point the users to cookbook saying a real time example is also available and ask them to check it out. Also update SKILL.md file.

If cookbook doesn't exist it tells cookbook coming soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants