Skip to content

Add LangSmith tracing sample#292

Draft
xumaple wants to merge 2 commits intomainfrom
maplexu/langsmith-sample
Draft

Add LangSmith tracing sample#292
xumaple wants to merge 2 commits intomainfrom
maplexu/langsmith-sample

Conversation

@xumaple
Copy link
Copy Markdown
Contributor

@xumaple xumaple commented Apr 17, 2026

Summary

  • Adds langsmith_tracing/ sample demonstrating temporalio.contrib.langsmith.LangSmithPlugin
  • basic/: one-shot LLM workflow (prompt → OpenAI activity → result)
  • chatbot/: conversational loop with save_note/read_note tools, signals, queries, and dynamic LangSmith trace names
  • Includes mocked tests, README, and langsmith-tracing dependency group
  • Declares langchain and langsmith-tracing as conflicting groups in [tool.uv] to avoid version conflicts

Test plan

  • poe format — passes
  • mypy on langsmith_tracing/ and tests/langsmith_tracing/ — passes
  • pytest tests/langsmith_tracing/ — basic test passes, chatbot tests skip (pending SDK plugin release)
  • Manual test: run worker + starter for both basic and chatbot examples

🤖 Generated with Claude Code

xumaple and others added 2 commits April 17, 2026 16:17
Demonstrates the LangSmithPlugin for automatic LangSmith tracing in
Temporal workflows. Includes two examples:
- basic/: one-shot LLM workflow (prompt → OpenAI → result)
- chatbot/: conversational loop with save_note/read_note tools,
  signals, queries, and dynamic trace names

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Add @Traceable with metadata, tags, and run_type variety to workflows
- Add client-side @Traceable on starters for end-to-end trace linking
- Add --temporal-runs flag to workers and starters for add_temporal_runs toggle
- Use run_type="llm" for OpenAI calls, "tool" for save_note, "chain" for orchestration
- Add trace tree diagrams to README showing both add_temporal_runs modes
- Add "Three Layers of Tracing" section to README (wrap_openai, @Traceable, Temporal plugin)
- Skip all tests when temporalio.contrib.langsmith is unavailable (pending SDK release)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.

1 participant