Skip to content

Commit 5748d69

Browse files
committed
Enhance observability decorator to validate Langfuse credentials before execution
1 parent 4c6a07b commit 5748d69

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

backend/app/core/langfuse/langfuse.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,9 @@ def decorator(func: Callable) -> Callable:
132132
@wraps(func)
133133
def wrapper(completion_config: CompletionConfig, query: QueryParams, **kwargs):
134134
# Skip observability if no credentials provided
135-
if not credentials:
135+
if not credentials or not all(
136+
key in credentials for key in ["public_key", "secret_key", "host"]
137+
):
136138
logger.info("[Langfuse] No credentials - skipping observability")
137139
return func(completion_config, query, **kwargs)
138140

0 commit comments

Comments
 (0)