Skip to content

feat: Update examples to use create_tracker() factory pattern#22

Merged
jsonbailey merged 3 commits intomainfrom
jb/aic-2207/update-examples
May 5, 2026
Merged

feat: Update examples to use create_tracker() factory pattern#22
jsonbailey merged 3 commits intomainfrom
jb/aic-2207/update-examples

Conversation

@jsonbailey
Copy link
Copy Markdown
Contributor

Summary

  • Updated 6 examples to call config.create_tracker() instead of accessing config.tracker directly, matching the new per-invocation tracker factory pattern from AIC-2207
  • Moved tracker creation after the enabled check in completion config examples, since create_tracker is None when the config is disabled
  • No changes needed for the 3 high-level API examples (chat_judge, chat_observability, direct_judge) as they don't access the tracker directly

Files changed

  • examples/openai_example.py
  • examples/bedrock_example.py
  • examples/gemini_example.py
  • examples/langchain_example.py
  • examples/langgraph_agent_example.py
  • examples/langgraph_multi_agent_example.py

Test plan

  • Run poetry run openai-example and verify metrics are tracked
  • Run poetry run chat-judge-example and verify end-to-end flow

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@jsonbailey jsonbailey force-pushed the jb/aic-2207/update-examples branch from 137cf62 to 9c79622 Compare May 5, 2026 14:50
@jsonbailey jsonbailey marked this pull request as ready for review May 5, 2026 15:16
@jsonbailey jsonbailey requested a review from a team as a code owner May 5, 2026 15:16
@jsonbailey jsonbailey merged commit 78fe661 into main May 5, 2026
3 checks passed
@jsonbailey jsonbailey deleted the jb/aic-2207/update-examples branch May 5, 2026 15:23
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.

2 participants