Skip to content

Step

evaldeck.trace.Step

Bases: BaseModel

A single step in an agent's execution trace.

Steps can represent LLM calls, tool calls, reasoning steps, or human input.

model_post_init

model_post_init(__context)

Generate ID if not provided.

Source code in src/evaldeck/trace.py
def model_post_init(self, __context: Any) -> None:
    """Generate ID if not provided."""
    if not self.id:
        import uuid

        self.id = str(uuid.uuid4())[:8]

llm_call classmethod

llm_call(model, input, output, tokens=None, **kwargs)

Create an LLM call step.

Source code in src/evaldeck/trace.py
@classmethod
def llm_call(
    cls,
    model: str,
    input: str,
    output: str,
    tokens: TokenUsage | None = None,
    **kwargs: Any,
) -> Step:
    """Create an LLM call step."""
    return cls(
        type=StepType.LLM_CALL,
        model=model,
        input=input,
        output=output,
        tokens=tokens,
        **kwargs,
    )

tool_call classmethod

tool_call(tool_name, tool_args=None, tool_result=None, **kwargs)

Create a tool call step.

Source code in src/evaldeck/trace.py
@classmethod
def tool_call(
    cls,
    tool_name: str,
    tool_args: dict[str, Any] | None = None,
    tool_result: Any = None,
    **kwargs: Any,
) -> Step:
    """Create a tool call step."""
    return cls(
        type=StepType.TOOL_CALL,
        tool_name=tool_name,
        tool_args=tool_args or {},
        tool_result=tool_result,
        **kwargs,
    )

reasoning classmethod

reasoning(text, **kwargs)

Create a reasoning step.

Source code in src/evaldeck/trace.py
@classmethod
def reasoning(cls, text: str, **kwargs: Any) -> Step:
    """Create a reasoning step."""
    return cls(
        type=StepType.REASONING,
        reasoning_text=text,
        **kwargs,
    )