from agenttrace.contracts import Run, Span, SpanType, build_ingest_payload
from agenttrace.langchain import AgentTraceCallbackHandler
from agenttrace.trace import RunTraceContext, trace


def __getattr__(name: str):
    if name == "AgentTraceCrewAIHandler":
        from agenttrace.crewai import AgentTraceCrewAIHandler

        return AgentTraceCrewAIHandler
    if name == "AgentTraceLlamaIndexHandler":
        from agenttrace.llamaindex import AgentTraceLlamaIndexHandler

        return AgentTraceLlamaIndexHandler
    raise AttributeError(f"module 'agenttrace' has no attribute {name!r}")


__all__ = [
    "AgentTraceCallbackHandler",
    "AgentTraceCrewAIHandler",
    "AgentTraceLlamaIndexHandler",
    "Run",
    "RunTraceContext",
    "Span",
    "SpanType",
    "build_ingest_payload",
    "trace",
]
