Skip to content

feat: add Langfuse mock for graceful degradation - #98

Open
benhurstephen wants to merge 1 commit into
redhat-data-and-ai:mainfrom
benhurstephen:feature/33-langfuse-mock
Open

feat: add Langfuse mock for graceful degradation#98
benhurstephen wants to merge 1 commit into
redhat-data-and-ai:mainfrom
benhurstephen:feature/33-langfuse-mock

Conversation

@benhurstephen

@benhurstephen benhurstephen commented Jul 6, 2026

Copy link
Copy Markdown

Issue #33

Summary

  • Add template_agent/utils/langfuse_mock.py with no-op Langfuse and CallbackHandler implementations
  • Auto-detect missing credentials and install mocks in template_agent/__init__.py before real SDK import
  • Add tests in tests/test_langfuse_mock.py

Test plan

  • pytest — 87 passed
  • App starts without LANGFUSE_* env vars
  • POST /v1/feedback returns 200 without Langfuse errors

Install no-op Langfuse modules when credentials are missing so tracing
and feedback work without SDK warnings or errors. Issue redhat-data-and-ai#33.
@benhurstephen
benhurstephen force-pushed the feature/33-langfuse-mock branch from a89ec85 to fd3b001 Compare July 6, 2026 11:14
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 91.17647% with 3 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
template_agent/utils/langfuse_mock.py 90.00% 3 Missing ⚠️

📢 Thoughts on this report? Let us know!

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