Add tutorial examples and fix dependency groups#174
Add tutorial examples and fix dependency groups#174sanjeed5 wants to merge 7 commits intofederated-sdk-release-candidatefrom
Conversation
… convenience groups pyproject.toml convenience groups (all-openinference, openinference-llm-providers, all-traceloop, traceloop-llm-providers) were referencing other extras by name instead of listing actual PyPI packages. This caused installation failures because pyproject.toml does not support referencing one extra from within another. Changes: - Replace all extra name references with actual package specifiers - Fix incorrect package name: openinference-instrumentation-google-generativeai -> openinference-instrumentation-google-genai (the correct PyPI package) - Add comments explaining why packages are listed directly - Maintain same user-facing behavior: users still use the same extra names Affected extras: - all-openinference (7 providers) - openinference-llm-providers (4 providers) - all-traceloop (6 providers) - traceloop-llm-providers (4 providers) - openinference-google-ai (package name fix) Fixes: "No matching distribution found for openinference-anthropic" error Tested: - uv pip install -e ".[all-openinference]" ✓ - uv pip install -e ".[openinference-llm-providers]" ✓ - uv pip install -e ".[all-traceloop]" ✓ - uv pip install -e ".[traceloop-llm-providers]" ✓ - All instrumentor imports working correctly
Add working example code for the getting-started tutorial that uses gpt-4o-mini.
Created examples/tutorials/add_tracing_5min.py combining all three patterns: - Simple chatbot (OpenAI) - Multi-step application (Anthropic) - Multiple providers (OpenAI + Anthropic) All examples tested and verified working with claude-haiku-4-5-20251001. Matches documentation in tutorials/add-tracing-5min.mdx.
Tests both enrichment patterns: - using_attributes for direct LLM span enrichment - @trace + enrich_span() for pipeline parent spans
Demonstrates intent classification experiment comparing vague vs structured prompts, with evaluators and programmatic run comparison.
Demonstrates: - Querying model events - Querying events in a session - Querying sessions - Multiple filters Verified working against live API.
…thon-sdk into complete-refactor
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
📚 Documentation Preview Built✅ Documentation preview is ready! 📦 Download PreviewDownload documentation artifact 🔍 How to Review
✅ Validation Status
Preview generated for PR #174 |
There was a problem hiding this comment.
This PR is being reviewed by Cursor Bugbot
Details
Your team is on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle for each member of your team.
To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.
| from openinference.instrumentation.openai import OpenAIInstrumentor | ||
| from openinference.instrumentation.anthropic import AnthropicInstrumentor | ||
|
|
||
| tracer = HoneyHiveTracer.init(source="docs") # Reads HH_API_KEY and HH_PROJECT from env |
There was a problem hiding this comment.
Environment variables loaded after tracer reads them
High Severity
HoneyHiveTracer.init(source="docs") on line 14 attempts to read HH_API_KEY and HH_PROJECT from environment variables, but load_dotenv() isn't called until line 23. For users storing credentials in .env files (a common pattern), the tracer initialization will fail because the environment variables haven't been loaded yet. All other tutorial files correctly call load_dotenv() before tracer initialization.
Summary
examples/tutorials/getting_started.pyexamples/tutorials/add_tracing_5min.pyexamples/tutorials/enriching_traces.pyexamples/tutorials/evaluation_basics.pyexamples/query_traces.pyTest plan
.[all-openinference],.[openinference-llm-providers],.[all-traceloop],.[traceloop-llm-providers]Note
Adds runnable examples aligned with docs and fixes packaging for optional integrations.
examples/tutorials/getting_started.py,examples/tutorials/add_tracing_5min.py,examples/tutorials/enriching_traces.py,examples/tutorials/evaluation_basics.py, andexamples/query_traces.pydemonstrating tracer setup, enrichment, evaluation, and event queryingpyproject.tomloptional-dependencies:openinference-instrumentation-google-genaiand updates related extra name commentsall-openinference,openinference-llm-providers,all-traceloop, andtraceloop-llm-providersto prevent installation failuresWritten by Cursor Bugbot for commit 229cd9a. This will update automatically on new commits. Configure here.