Types¶
The frozen result types returned by the agentic loop: AgenticResult (the full
outcome of an analyze() call), Turn (one model exchange), ToolCall (a
requested tool invocation), and ToolResult (its outcome). All are immutable.
types ¶
Core types for GAZE.
Provides dataclasses for tool calls, results, conversation turns, and agentic analysis results.
All data types use frozen=True and immutable containers (tuples,
MappingProxyType) so that instances are safe to share across async
tasks and cannot be accidentally mutated after construction.
ToolCall
dataclass
¶
Represents a tool call request from the model.
Attributes:
| Name | Type | Description |
|---|---|---|
id |
str
|
Unique identifier for this tool call |
name |
str
|
Name of the tool to execute |
arguments |
Mapping[str, Any] | str
|
JSON object or JSON string containing tool arguments |
Source code in src/gaze/types.py
ToolResult
dataclass
¶
Result of executing a tool.
Attributes:
| Name | Type | Description |
|---|---|---|
tool_name |
str
|
Name of the tool that was executed |
description |
str
|
Human-readable description of what happened |
error |
str | None
|
Error message if execution failed, None if successful |
image_base64 |
str | None
|
Base64-encoded image data if tool produced an image |
image_mime_type |
str | None
|
MIME type of the image (e.g., 'image/png') |
metadata |
Mapping[str, Any]
|
Additional tool-specific metadata |
Source code in src/gaze/types.py
formatted_results
property
¶
Optional formatted result string stored in metadata.
Turn
dataclass
¶
Represents a single turn in the agentic conversation.
Attributes:
| Name | Type | Description |
|---|---|---|
role |
TurnRole
|
Message role - must be 'user', 'assistant', or 'tool_result' |
content |
str
|
Text content of the turn |
tool_calls |
tuple[ToolCall, ...]
|
Tool calls made in this turn (assistant only) |
tool_results |
tuple[ToolResult, ...]
|
Tool results (tool_result only) |
image_base64 |
str | None
|
Optional image data for this turn |
Source code in src/gaze/types.py
RunConfig
dataclass
¶
Captures the configuration that produced an AgenticResult.
Stored on AgenticResult.run_config to enable reproducibility
without relying on side-band summary files.
Attributes:
| Name | Type | Description |
|---|---|---|
model_name |
str
|
Model identifier used for generation. |
temperature |
float
|
Sampling temperature (0.0 = greedy). |
seed |
int | None
|
API seed parameter, or None if not set. |
max_tokens |
int
|
Max completion tokens per turn. |
max_turns |
int
|
Maximum agentic turns allowed. |
Source code in src/gaze/types.py
AgenticResult
dataclass
¶
Result of an agentic analysis session.
Attributes:
| Name | Type | Description |
|---|---|---|
final_response |
Mapping[str, Any]
|
Complete JSON response from the model |
turns |
tuple[Turn, ...]
|
All conversation turns in the analysis |
total_tokens |
int
|
Total tokens consumed across all turns |
confidence |
float
|
Overall confidence in the analysis (0.0-1.0) |
run_config |
RunConfig | None
|
Configuration that produced this result (for reproducibility) |
Source code in src/gaze/types.py
get_tools_used ¶
Get set of unique tool names used in the analysis.