docs(langchain): document LangSmith observability bridge (Sprint 1)#185
Conversation
Adds a "Trace payments in LangSmith" section to the integration guide and a matching "Observability with LangSmith" subsection to the agent-facing skill reference. Both cover: - Installing the new payments-py[langsmith] extra - Enabling tracing via LANGSMITH_TRACING + LANGSMITH_API_KEY env vars - Regional LANGSMITH_ENDPOINT override for non-US accounts - The trace tree shape (nvm:verify + nvm:settlement child spans under the tool) and the nvm.* attribute set on each - The "failed discovery probe" path producing an nvm:verify span with static metadata (so probes are filterable, not opaque crashes) - Active payment_token redaction from the parent tool span's metadata to keep the full x402 access token out of nvm:* spans - LANGSMITH_HIDE_INPUTS=true as the blanket workaround for non- configurable channels The Mintlify-served module reference page (docs/api-reference/python/langchain-module.mdx) is intentionally NOT edited — it auto-updates from payments-py/docs/api/12-langchain-integration.md on the next v*.*.* tag via publish-mintlify-docs.yml. Implements nevermined-io/nvm-monorepo#1705 (Sprint 1 docs deliverable). Pairs with nevermined-io/payments-py#198 (SDK side). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
There was a problem hiding this comment.
Pull request overview
Adds Sprint 1 documentation for LangSmith observability/tracing in the LangChain + Nevermined payments integration, covering how @requires_payment emits nvm:verify / nvm:settlement spans with nvm.* metadata and how token redaction works.
Changes:
- Added a new “Trace payments in LangSmith (Python)” subsection to the LangChain integration guide with install, env config, span tree, and redaction guidance.
- Added a mirrored “Observability with LangSmith” subsection to the Nevermined Payments skill reference for LangChain.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| docs/integrate/add-to-your-agent/langchain.mdx | Adds end-user docs for enabling LangSmith tracing and interpreting Nevermined payment spans in LangChain/LangGraph. |
| skills/nevermined-payments/references/langchain-integration.md | Adds a condensed reference version of the LangSmith observability guidance for the skill documentation surface. |
|
|
||
| If a span failure ever occurs during metadata building or attachment, observability is silently dropped — the payment flow itself is never interrupted. Settlement receipts persist via `last_settlement()` regardless of whether the span emit succeeded. | ||
|
|
||
| For the full module reference (function signatures, manual usage from non-LangChain code paths), see the [Python LangChain module reference](/docs/api-reference/python/langchain-module#observability-with-langsmith). |
|
Re: Copilot's finding on the The anchor is correct for the post-release state but doesn't exist in
So this PR is intentionally draft until step 3 completes. If |
…dge (#53) Wires the tutorial to the new LangSmith observability bridge shipped in payments-py 1.8.0 (Sprint 1 of the LangChain partnership epic). Zero code changes in src/ — the bridge is fully zero-config opt-in via env vars on top of the existing Sprint 0 agent + buyer. Changes: - pyproject.toml: payments-py dep bumped to ^1.8.0 with both extras ([langchain, langsmith]); tutorial version 1.0.0 -> 1.1.0. - .env.example: new "Observability (optional)" block with LANGSMITH_* vars (TRACING, API_KEY, PROJECT) and the regional LANGSMITH_ENDPOINT fallback table for GCP EU / APAC / AWS US accounts. - README.md: new "Observability with LangSmith (optional)" section (~48 lines) covering install / enable / re-run / what to expect in the trace tree, plus the active payment_token redaction privacy note. Pairs with: - nevermined-io/payments-py#198 (SDK side, draft) - nevermined-io/docs#185 (Mintlify docs, draft) Implements nevermined-io/nvm-monorepo#1705 (Sprint 1 tutorial deliverable). Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Summary
Adds Sprint 1 LangSmith observability coverage to two hand-maintained docs surfaces. Pairs with nevermined-io/payments-py#198 (SDK side, still draft) and implements the docs deliverable for nvm-monorepo#1705.
Files changed
docs/integrate/add-to-your-agent/langchain.mdx### Trace payments in LangSmith (Python)section nested under "Approach 1: Tool Decorator / Wrapper", between "Reading the settlement receipt" and "Dynamic Credits". ~51 lines.skills/nevermined-payments/references/langchain-integration.md## Observability with LangSmithsubsection between "Reading the settlement receipt" and "Decorator Configuration". Distilled mirror of the integration-guide section. ~18 lines.What each section covers
payments-py[langsmith]optional extraLANGSMITH_TRACING=true+LANGSMITH_API_KEYenv varsLANGSMITH_ENDPOINToverride for non-US accounts (GCP EU / APAC / AWS US)nvm:verifyandnvm:settlementas flat sibling spans under the toolnvm.*attribute set on each span (nvm.plan_ids,nvm.scheme,nvm.payer,nvm.credits_redeemed,nvm.tx_hash, etc.)nvm:verifyspan with static metadata even when nopayment_tokenis set — so probes are filterable, not opaque LangChain crashespayment_tokenfrom the parent tool span's metadata, keeping the full x402 access token out ofnvm:*spans (LangChain auto-captures fromconfigurable— we strip before opening any child span)LANGSMITH_HIDE_INPUTS=trueas the blanket workaround for non-configurable token channelsWhat's intentionally NOT edited
docs/api-reference/python/langchain-module.mdx— auto-generated frompayments-py/docs/api/12-langchain-integration.mdviapublish-mintlify-docs.ymlon eachv*.*.*tag. Will update automatically when payments-py 1.8.0 ships.docs.jsonnav — already references both langchain pages from Sprint 0 (docs(langchain): add tutorial reference + Python LangChain module reference #178 + docs: Update Python SDK Documentation (v1.7.0) #179).Status
This is a draft because the underlying SDK changes are still in draft on payments-py#198. Once that PR is reviewed, merged, and a v1.8.0 tag goes out, mark this PR ready for review — the documented features will then exist on PyPI.
Test plan
/docs/api-reference/python/langchain-module#observability-with-langsmithresolves once the SDK reference auto-publishes on next tag)mintlify dev) renders both sections cleanly — flag at review time if any callout / code-fence formatting is offmintlify broken-linkspasses (the link to the module-reference anchor will resolve only after payments-py releases — flag if blocking)🤖 Generated with Claude Code