|
|
|
@ -9,10 +9,12 @@ from uuid import UUID
|
|
|
|
|
from langsmith.schemas import RunBase as BaseRunV2
|
|
|
|
|
from langsmith.schemas import RunTypeEnum as RunTypeEnumDep
|
|
|
|
|
|
|
|
|
|
from langchain_core._api import deprecated
|
|
|
|
|
from langchain_core.outputs import LLMResult
|
|
|
|
|
from langchain_core.pydantic_v1 import BaseModel, Field, root_validator
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@deprecated("0.1.0", alternative="Use string instead.", removal="0.2.0")
|
|
|
|
|
def RunTypeEnum() -> Type[RunTypeEnumDep]:
|
|
|
|
|
"""RunTypeEnum."""
|
|
|
|
|
warnings.warn(
|
|
|
|
@ -23,6 +25,7 @@ def RunTypeEnum() -> Type[RunTypeEnumDep]:
|
|
|
|
|
return RunTypeEnumDep
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@deprecated("0.1.0", removal="0.2.0")
|
|
|
|
|
class TracerSessionV1Base(BaseModel):
|
|
|
|
|
"""Base class for TracerSessionV1."""
|
|
|
|
|
|
|
|
|
@ -31,28 +34,33 @@ class TracerSessionV1Base(BaseModel):
|
|
|
|
|
extra: Optional[Dict[str, Any]] = None
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@deprecated("0.1.0", removal="0.2.0")
|
|
|
|
|
class TracerSessionV1Create(TracerSessionV1Base):
|
|
|
|
|
"""Create class for TracerSessionV1."""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@deprecated("0.1.0", removal="0.2.0")
|
|
|
|
|
class TracerSessionV1(TracerSessionV1Base):
|
|
|
|
|
"""TracerSessionV1 schema."""
|
|
|
|
|
|
|
|
|
|
id: int
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@deprecated("0.1.0", removal="0.2.0")
|
|
|
|
|
class TracerSessionBase(TracerSessionV1Base):
|
|
|
|
|
"""Base class for TracerSession."""
|
|
|
|
|
|
|
|
|
|
tenant_id: UUID
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@deprecated("0.1.0", removal="0.2.0")
|
|
|
|
|
class TracerSession(TracerSessionBase):
|
|
|
|
|
"""TracerSessionV1 schema for the V2 API."""
|
|
|
|
|
|
|
|
|
|
id: UUID
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@deprecated("0.1.0", alternative="Run", removal="0.2.0")
|
|
|
|
|
class BaseRun(BaseModel):
|
|
|
|
|
"""Base class for Run."""
|
|
|
|
|
|
|
|
|
@ -68,6 +76,7 @@ class BaseRun(BaseModel):
|
|
|
|
|
error: Optional[str] = None
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@deprecated("0.1.0", alternative="Run", removal="0.2.0")
|
|
|
|
|
class LLMRun(BaseRun):
|
|
|
|
|
"""Class for LLMRun."""
|
|
|
|
|
|
|
|
|
@ -75,6 +84,7 @@ class LLMRun(BaseRun):
|
|
|
|
|
response: Optional[LLMResult] = None
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@deprecated("0.1.0", alternative="Run", removal="0.2.0")
|
|
|
|
|
class ChainRun(BaseRun):
|
|
|
|
|
"""Class for ChainRun."""
|
|
|
|
|
|
|
|
|
@ -85,6 +95,7 @@ class ChainRun(BaseRun):
|
|
|
|
|
child_tool_runs: List[ToolRun] = Field(default_factory=list)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@deprecated("0.1.0", alternative="Run", removal="0.2.0")
|
|
|
|
|
class ToolRun(BaseRun):
|
|
|
|
|
"""Class for ToolRun."""
|
|
|
|
|
|
|
|
|
|