/** * Represents a timestamped event for a node */ export interface NodeStamp { /** The sequential step number in the agent execution */ step: number; /** Unix timestamp when this event occurred */ time: number; /** Unique identifier for this stamp */ identifier: string; } /** * Represents input/output content for LLM interactions */ export interface LLMContent { /** Role of the message sender (e.g., "user", "assistant", "system") */ role: string; /** The actual content of the message. * For tool calls, they can be a function call. * For tool responses, it can be json. * For LLM responses, it can be a string or a json object. */ content: any; } /** * Represents detailed information about an LLM interaction */ export interface LLMDetails { /** Name of the language model used */ model_name: string; /** Provider of the language model (e.g., "openai", "anthropic") */ model_provider: string; /** Array of input messages sent to the LLM */ input: LLMContent[]; /** Output message received from the LLM */ output: LLMContent; /** Number of tokens in the input (null if not available) */ input_tokens: number | null; /** Number of tokens in the output (null if not available) */ output_tokens: number | null; /** Total cost of the LLM interaction (null if not available) */ total_cost: number | null; /** System fingerprint for the model (null if not available) */ system_fingerprint: string | null; /** Total time taken for the node to execute in SECONDS. * Older agent runs (backwards compatible) won't have latency parameter * so we need to make it optional. */ latency?: number | null; } /** * Represents latency information for a node execution */ export interface NodeLatency { /** Total time taken for the node to execute in SECONDS */ total_time: number; } /** * Represents internal execution details for a node */ export interface NodeInternals { /** Optional array of LLM interaction details */ llm_details?: LLMDetails[]; /** Optional latency information for the node execution */ latency?: NodeLatency; } /** * Represents detailed information about a node */ export interface NodeDetails { /** Optional internal execution details */ internals?: NodeInternals; } /** * Represents a node in the agent execution flow * * This interface defines the structure for individual execution steps in an agent run. * Each node represents a discrete action or decision point in the agent's workflow, * with timing information, execution details, and optional LLM interaction data. * */ export interface AgentRunNode { /** Unique identifier for this node */ identifier: string; /** Type of node (e.g., "Tool", "Agent", "Coordinator") */ node_type: string; /** Optional human-readable name for this node */ name?: string; /** Timestamp information for when this node was executed */ stamp: NodeStamp; /** Detailed information about the node's execution */ details: NodeDetails; /** Reference to the parent node, or null if this is a root node */ parent: AgentRunNode | null; } /** * Represents a tool call with identifier, name, and arguments */ export interface ToolCall { /** Unique identifier for this tool call */ identifier: string; /** Name of the tool being called */ name: string; /** Arguments passed to the tool */ arguments: Record; } /** * Represents a tool response with identifier, name, and result */ export interface ToolResponse { /** Unique identifier for this tool response */ identifier: string; /** Name of the tool that generated this response */ name: string; /** The result of the tool call */ result: any; } /** * Union type for different content types that can be rendered */ export type Content = string | ToolCall[] | ToolResponse | any; //# sourceMappingURL=AgentRunNode.d.ts.map