Skip to main content

Returns

Returns a Trace object.

Example

manual_trace = galtea.traces.create(
    inference_result_id=inference_result_id,
    name="manual_db_call",
    type=TraceType.TOOL,
    start_time="2023-01-01T12:00:00Z",
    end_time="2023-01-01T12:00:01Z",
)

Parameters

inference_result_id
string
required
The ID of the inference result this trace belongs to.
name
string
required
The name of the tool or function that was called.
type
string
TraceType value: SPAN, GENERATION, EVENT, AGENT, TOOL, CHAIN, RETRIEVER, EVALUATOR, EMBEDDING, GUARDRAIL. See Trace Types for details.
description
string
Human-readable description of what this operation does. Useful for documentation and debugging. Maximum size: 32KB.
input_data
any
The input data passed to the tool/function. Accepts any JSON-serializable value. Maximum size: 128KB.
output_data
any
The output data returned by the tool/function. Accepts any JSON-serializable value. Maximum size: 128KB.
error
string
Error message if the tool call failed.
latency_ms
float
The time in milliseconds the tool call took.
metadata
any
Additional metadata about the trace. Accepts any JSON-serializable value. Maximum size: 128KB.
start_time
string
ISO 8601 timestamp when the trace started.
end_time
string
ISO 8601 timestamp when the trace ended.