Skip to content

Add tutorial examples and fix dependency groups#174

Open
sanjeed5 wants to merge 7 commits intofederated-sdk-release-candidatefrom
complete-refactor-examples
Open

Add tutorial examples and fix dependency groups#174
sanjeed5 wants to merge 7 commits intofederated-sdk-release-candidatefrom
complete-refactor-examples

Conversation

@sanjeed5
Copy link
Contributor

@sanjeed5 sanjeed5 commented Jan 12, 2026

Summary

  • Fix pyproject.toml dependency groups that were referencing extras by name instead of actual PyPI packages (caused installation failures)
  • Add tutorial examples matching documentation:
    • examples/tutorials/getting_started.py
    • examples/tutorials/add_tracing_5min.py
    • examples/tutorials/enriching_traces.py
    • examples/tutorials/evaluation_basics.py
    • examples/query_traces.py

Test plan

  • All tutorial examples tested against live API
  • Dependency extras verified: .[all-openinference], .[openinference-llm-providers], .[all-traceloop], .[traceloop-llm-providers]

Note

Adds runnable examples aligned with docs and fixes packaging for optional integrations.

  • Adds examples/tutorials/getting_started.py, examples/tutorials/add_tracing_5min.py, examples/tutorials/enriching_traces.py, examples/tutorials/evaluation_basics.py, and examples/query_traces.py demonstrating tracer setup, enrichment, evaluation, and event querying
  • Updates pyproject.toml optional-dependencies:
    • Renames Google integration to openinference-instrumentation-google-genai and updates related extra name comments
    • Replaces references to extras with explicit package lists in all-openinference, openinference-llm-providers, all-traceloop, and traceloop-llm-providers to prevent installation failures
    • Keeps provider SDKs and versions aligned across OpenInference/Traceloop groups

Written by Cursor Bugbot for commit 229cd9a. This will update automatically on new commits. Configure here.

… 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.
@snyk-io
Copy link

snyk-io bot commented Jan 12, 2026

Snyk checks have passed. No issues have been found so far.

Status Scanner Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@github-actions
Copy link
Contributor

📚 Documentation Preview Built

Documentation preview is ready!

📦 Download Preview

Download documentation artifact

🔍 How to Review

  1. Download the artifact from the link above
  2. Extract the files
  3. Open index.html in your browser

✅ Validation Status

  • API validation: ✅ Passed
  • Build process: ✅ Successful
  • Import tests: ✅ All imports working

Preview generated for PR #174

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Additional Locations (1)

Fix in Cursor Fix in Web

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