agentle.agents.step

Module for tracking execution steps in Agentle agents.

This module provides the Step class, which represents a single execution step in an agent’s reasoning process. Steps track the specific actions taken by an agent during its execution, particularly focusing on tool calls.

Steps are stored in the Context object’s ‘steps’ sequence and provide a detailed record of the agent’s decision-making and actions during execution. This is useful for debugging, logging, and understanding the agent’s reasoning path.

Example: ```python from agentle.agents.step import Step from agentle.generations.models.message_parts.tool_execution_suggestion import ToolExecutionSuggestion

# Create a tool execution suggestion tool_suggestion = ToolExecutionSuggestion(

id=”tool-call-1”, tool_name=”get_weather”, args={“location”: “London”}

)

# Create a step recording that tool call step = Step(tool_execution_suggestions=[tool_suggestion])

# Steps are typically stored in a Context object context.steps = list(context.steps) + [step] ```

Functions

Field()

!!! abstract "Usage Documentation"

Classes

Any(*args, **kwargs)

Special type indicating an unconstrained type.

BaseModel()

Alias for pydantic.BaseModel.

MutableMapping()

A MutableMapping is a generic container for associating key/value pairs.

Sequence()

All the operations on a read-only sequence.

Step(*[, step_id, step_type, timestamp, ...])

Represents a single execution step in an agent's reasoning process.

ToolExecutionResult(*[, type, ...])

Represents the result of a tool execution within a step.

ToolExecutionSuggestion(*[, type, id, args])

Represents a suggestion to execute a specific tool.

Usage(*[, prompt_tokens, completion_tokens])

Tracks and calculates token consumption in AI model interactions.

datetime(year, month, day[, hour[, minute[, ...)

The year, month and day arguments are required.