ractogateway.pipelines.agent._models
Models for AgentPipeline.
- class ractogateway.pipelines.agent._models.StopReason(*values)[source]
-
Why the agent loop terminated.
- FINISHED = 'finished'
- MAX_STEPS = 'max_steps'
- ERROR = 'error'
- CIRCUIT_BREAK = 'circuit_break'
- class ractogateway.pipelines.agent._models.AgentUsage(**data)[source]
Bases:
BaseModelToken and step accounting across the full agent run.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- total_input_tokens: int
Cumulative input tokens across all LLM calls.
- total_output_tokens: int
Cumulative output tokens across all LLM calls.
- steps_taken: int
Number of reasoning+action steps executed.
- tools_called: int
Number of non-finish tool invocations.
- property total_tokens: int
Sum of all input and output tokens.
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class ractogateway.pipelines.agent._models.AgentStep(**data)[source]
Bases:
BaseModelOne reasoning + action step in the ReAct loop.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- step_num: int
1-based position in the execution sequence.
- tool_name: str
Name of the tool that was invoked.
- observation: str
The tool’s return value (truncated to 4000 chars when long).
- duration_ms: float
Wall-clock time for tool execution in milliseconds.
- is_finish: bool
True when this step invoked the finish() termination tool.
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class ractogateway.pipelines.agent._models.AgentResult(**data)[source]
Bases:
BaseModelFull output of an
AgentPipelinerun.Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- goal: str
The original user goal / task string.
- stop_reason: StopReason
Why the loop terminated.
- usage: AgentUsage
Token and step counts.
- parsed_output: Any
Validated Pydantic model instance when
response_formatwas passed torun(). Not included in JSON serialisation; callresult.parsed_output.model_dump()manually.
- get_tool_calls()[source]
Return (tool_name, tool_input) for every non-finish step.
- to_json(path=None, *, indent=2)[source]
Serialise to JSON. Returns string when path is
None.
- exception ractogateway.pipelines.agent._models.AgentRateLimitExceededError[source]
Bases:
RuntimeErrorRaised when the rate limiter blocks an agent run.