feat(langchain-paid-agent-py): Sprint 1 — LangSmith observability bridge#53
Merged
Merged
Conversation
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>
Merged
7 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Wires the existing LangChain tutorial to the new LangSmith observability bridge shipping in
payments-py1.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 Sprint 0 agent + buyer.Files changed
langchain-paid-agent-py/pyproject.tomlpayments-pydep bumped to^1.8.0with both extras ([langchain, langsmith]); tutorial version1.0.0→1.1.0.langchain-paid-agent-py/.env.exampleObservability (optional)block with the LANGSMITH_* vars (TRACING,API_KEY,PROJECT) plus the regionalLANGSMITH_ENDPOINTfallback table for GCP EU / APAC / AWS US accounts.langchain-paid-agent-py/README.md## Observability with LangSmith (optional)section (~48 lines) covering install, enable, re-run, what to look for in the trace tree, and the activepayment_tokenredaction privacy note.How it works
A reader who already followed the Sprint 0 quickstart just needs to:
poetry install(picks up the new[langsmith]extra).envpoetry run buyerThe trace tree then shows two dedicated child spans under the tool:
Each carries
nvm.*metadata:nvm.plan_ids,nvm.scheme,nvm.payer,nvm.payment_token(abbreviated),nvm.credits_redeemed,nvm.tx_hash,nvm.balance.after,nvm.network,nvm.verify.duration_ms,nvm.settle.duration_ms.The failed discovery probe (first invocation without a token) also produces an
nvm:verifyspan — marked failed but carrying the static plan / scheme / network attrs, so it's filterable in the LangSmith UI rather than an opaque LangChain crash.Status
Draft because the underlying
payments-py 1.8.0is not yet on PyPI — it's in nevermined-io/payments-py#198 (also draft). Once that PR is reviewed, merged, and tagged via theprepare-release.ymlworkflow, this can be marked ready for review.Pairs with
payments_py.langsmithmodule + decorator hooks)Implements nevermined-io/nvm-monorepo#1705 (Sprint 1 tutorial deliverable).
Test plan
origin/main— no stray files from other branches (web-search-paid-api-ts/left untracked, not staged)src/agent.py,src/buyer.py,src/__init__.pynot modified.env.examplesyntactically valid (commented lines only)payments-py 1.8.0ships:poetry installin a fresh clone resolves cleanlypayments-py 1.8.0ships:poetry run buyerwithLANGSMITH_TRACING=trueproduces the expected trace tree withnvm:verify+nvm:settlementspans🤖 Generated with Claude Code