Skip to content

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

Draft
jsonbailey wants to merge 1 commit intomainfrom
jb/aic-2207/update-examples
Draft

feat: Update examples to use create_tracker() factory pattern#22
jsonbailey wants to merge 1 commit 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>
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