Add LangChain integration page#3
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
💤 Files with no reviewable changes (1)
📝 WalkthroughWalkthroughAdds 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. ChangesLangChain Integration Documentation
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
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
📒 Files selected for processing (3)
docs.jsonintegrations/index.mdxintegrations/langchain.mdx
| ### `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?" | ||
| })) | ||
| ``` |
There was a problem hiding this comment.
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 -->
There was a problem hiding this comment.
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!
| ### `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?" | ||
| })) | ||
| ``` |
|
|
||
| agent.invoke({ | ||
| "messages": [ | ||
| {"role": "user", "content": "Redact the PII in: 'Call Jane at 555-0100.'"} |
There was a problem hiding this comment.
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"]}) |
There was a problem hiding this comment.
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. | ||
|
|
There was a problem hiding this comment.
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.
Summary
Documents the
langchain-zerogpupackage (ZGA-447) at/integrations/langchain, following the integration-doc skill structure.integrations/langchain.mdxcovering all 11 LangChain tools andZeroGPUToolkit: 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.pip install langchain-zerogpu) and auth (ZEROGPU_API_KEY/ZEROGPU_PROJECT_ID) instructions.integrations/index.mdx.integrations/langchainregistered indocs.jsonnav.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: cleanmint validate: build validation passedSummary by CodeRabbit