Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions langfuse/__init__.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
""".. include:: ../README.md"""

from ._client import client as _client_module
from ._client.attributes import LangfuseOtelSpanAttributes
from ._client.get_client import get_client
from ._client import client as _client
from ._client.observe import observe
from ._client.span import LangfuseEvent, LangfuseGeneration, LangfuseSpan

Langfuse = _client.Langfuse
Langfuse = _client_module.Langfuse

__all__ = [
"Langfuse",
Expand Down
6 changes: 4 additions & 2 deletions langfuse/_client/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,14 +187,16 @@ def __init__(

self._tracing_enabled = (
tracing_enabled
and os.environ.get(LANGFUSE_TRACING_ENABLED, "True") != "False"
and os.environ.get(LANGFUSE_TRACING_ENABLED, "true").lower() != "false"
)
if not self._tracing_enabled:
langfuse_logger.info(
"Configuration: Langfuse tracing is explicitly disabled. No data will be sent to the Langfuse API."
)

debug = debug if debug else (os.getenv(LANGFUSE_DEBUG, "False") == "True")
debug = (
debug if debug else (os.getenv(LANGFUSE_DEBUG, "false").lower() == "true")
)
if debug:
logging.basicConfig(
format="%(asctime)s - %(name)s - %(levelname)s - %(message)s"
Expand Down
3 changes: 2 additions & 1 deletion tests/test_otel.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ def mock_init(self, **kwargs):
)

monkeypatch.setattr(
"langfuse._client.span_processor.LangfuseSpanProcessor.__init__", mock_init
"langfuse._client.span_processor.LangfuseSpanProcessor.__init__",
mock_init,
)

@pytest.fixture
Expand Down