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
5 changes: 3 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ dev = [
"ruff>=0.13.0,<0.15.0",
]

langfuse = ["langfuse>=2.0.0,<3"]
otel = ["opentelemetry-exporter-otlp-proto-http>=1.30.0,<2.0.0"]

[tool.ruff]
Expand All @@ -53,7 +54,7 @@ include = ["src/**/*.py", "tests/**/*.py", "tests_integ/**/*.py"]
[tool.hatch.envs.hatch-test]
installer = "uv"
extra-args = ["-n", "auto", "-vv"]
features = ["otel"]
features = ["otel", "langfuse"]
dependencies = [
"pytest>=8.0.0,<10.0.0",
"pytest-cov>=7.0.0,<8.0.0",
Expand Down Expand Up @@ -91,7 +92,7 @@ prepare = [

[tool.hatch.envs.hatch-static-analysis]
installer = "uv"
features = ["otel"]
features = ["otel", "langfuse"]
dependencies = [
"mypy>=1.15.0,<2.0.0",
"ruff>=0.13.0,<0.15.0",
Expand Down
14 changes: 13 additions & 1 deletion src/strands_evals/providers/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from typing import Any

from .exceptions import (
ProviderError,
SessionNotFoundError,
Expand All @@ -9,9 +11,19 @@
)

__all__ = [
"LangfuseProvider",
"ProviderError",
"SessionNotFoundError",
"TraceNotFoundError",
"TraceProvider",
"TraceProviderError",
]
]


def __getattr__(name: str) -> Any:
"""Lazy-load providers that depend on optional packages."""
if name == "LangfuseProvider":
from .langfuse_provider import LangfuseProvider

return LangfuseProvider
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
8 changes: 0 additions & 8 deletions src/strands_evals/providers/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,14 @@
class TraceProviderError(Exception):
"""Base exception for trace provider errors."""

pass


class SessionNotFoundError(TraceProviderError):
"""No traces found for the given session ID."""

pass


class TraceNotFoundError(TraceProviderError):
"""Trace with the given ID not found."""

pass


class ProviderError(TraceProviderError):
"""Provider is unreachable or returned an error."""

pass
Loading