Skip to main content

Returns

Returns a Trace object.

Example

trace = galtea.traces.create(
    session_id="YOUR_SESSION_ID",
    name="fetch_user_data",
    node_type="TOOL",
    input_data={"user_id": "user_123"},
    output_data={"name": "John Doe", "email": "[email protected]"},
    latency_ms=150.5
)

Parameters

session_id
string
required
The ID of the session this trace belongs to.
name
string
required
The name of the tool or function that was called.
inference_result_id
string
The ID of the inference result to associate this trace with.
node_type
string
The type of node. Options: TOOL, CHAIN, RETRIEVER, LLM, CUSTOM. See Node Types for details.
input_data
dict
The input data passed to the tool/function.
output_data
dict
The output data returned by the tool/function.
error
string
Error message if the tool call failed.
latency_ms
float
The time in milliseconds the tool call took.
metadata
dict
Additional metadata about the trace.
start_time
string
ISO 8601 timestamp when the trace started.
end_time
string
ISO 8601 timestamp when the trace ended.