Skip to main content
POST
/
api
/
parea
/
v1
/
experiment
/
{experiment_uuid}
/
trace_logs
p = Parea(api_key="PAREA_API_KEY")  # replace with your API key

trace_logs = p.get_experiment_trace_logs(
    "experiment_uuid",  # replace with experiment UUID
    TraceLogFilters(
        filter_field='is_correct',
        filter_operator=FilterOperator.EQUALS,
        filter_value="1.0"
    )
)
[
  {
    "trace_id": "<string>",
    "start_timestamp": "<string>",
    "configuration": {},
    "inputs": {},
    "output": "<string>",
    "target": "<string>",
    "latency": 0,
    "time_to_first_token": 123,
    "input_tokens": 0,
    "output_tokens": 0,
    "total_tokens": 0,
    "cost": 0,
    "parent_trace_id": "<string>",
    "root_trace_id": "<string>",
    "project_name": "<string>",
    "status": "<string>",
    "error": "<string>",
    "output_for_eval_metrics": "<string>",
    "evaluation_metric_names": [
      "<string>"
    ],
    "scores": [
      {
        "name": "<string>",
        "score": 123,
        "evaluation_metric_id": 123,
        "reason": "<string>"
      }
    ],
    "feedback_score": 123,
    "apply_eval_frac": 1,
    "log_sample_rate": 1,
    "deployment_id": "<string>",
    "cache_hit": false,
    "trace_name": "<string>",
    "children": [
      "<string>"
    ],
    "children_ids": [
      123
    ],
    "end_timestamp": "<string>",
    "end_user_identifier": "<string>",
    "session_id": "<string>",
    "metadata": {},
    "tags": [
      "<string>"
    ],
    "experiment_uuid": "<string>",
    "images": [
      {
        "url": "<string>",
        "caption": "<string>"
      }
    ],
    "comments": [
      {
        "trace_id": "<string>",
        "comment": "<string>",
        "id": "<string>",
        "user_id": "<string>",
        "created_at": "<string>",
        "user_email_address": "<string>"
      }
    ],
    "annotations": {},
    "depth": 0,
    "execution_order": 0,
    "evaluation_metric_ids": [
      123
    ],
    "fill_children": false,
    "project_uuid": "<string>",
    "organization_id": "<string>",
    "children_logs": "<array>"
  }
]
p = Parea(api_key="PAREA_API_KEY")  # replace with your API key

trace_logs = p.get_experiment_trace_logs(
    "experiment_uuid",  # replace with experiment UUID
    TraceLogFilters(
        filter_field='is_correct',
        filter_operator=FilterOperator.EQUALS,
        filter_value="1.0"
    )
)

Authorizations

x-user-id
string
header
required

Path Parameters

experiment_uuid
string
required

Body

application/json
filter_field
string | null

Field to filter on. If you want to filter by a score, you need to follow this format: 'score:{score_name}'. If you want to filter by annotation, you need to follow this format: 'annotation:{annotation_type}:{annotation_id}'.

filter_key
string | null

Filter by key when filtering on a map

filter_operator
enum<string> | null

Filter operator

Available options:
equals,
not_equals,
like,
greater_than_or_equal,
less_than_or_equal,
greater_than,
less_than,
is_null,
exists,
in,
between
filter_value
string | null

Filter value

Response

Successful Response

trace_id
string
required

UUID of the trace log. Ex: e3267953-a16f-47f5-b37e-622dbb29d730

start_timestamp
string
required

Start timestamp

configuration
InputsSchema · object

If this log was a LLM call, this will contain the configuration used for the call.

inputs
Inputs · object

Key-value pair inputs of this trace. Note, there is a special field to capture messages in LLM calls. You can still use it in the case of LLM calls to track the key-value pairs for prompt templates.

output
string | null

Response of this step/log/function. If response isn’t a string, it needs to be serialized to a string.

target
string | null

The target or “gold standard” response for the inputs of this log.

latency
number | null
default:0

Latency of this log in seconds.

time_to_first_token
number | null

If this was a LLM call, this will contain the time taken to generate the first token.

input_tokens
integer | null
default:0

If this was a LLM call, this will contain the number of tokens in the input.

output_tokens
integer | null
default:0

If this was a LLM call, this will contain the number of tokens in the output.

total_tokens
integer | null
default:0

If this was a LLM call, this will contain the total number of tokens in the input and output.

cost
number | null
default:0

If this was a LLM call, this will contain the cost of the call.

parent_trace_id
string | null

If given, current trace will be a child of this trace. If current child is not a child, parent_trace_id should be equal to trace_id

root_trace_id
string | null

This is the UUID of the root trace/span of this trace. If current trace is the root trace, root_trace_id must be equal to trace_id

project_name
string | null

Name of the project with which the trace/log should be associated with. Must be provided if project_uuid is not provided

status
string | null

If the trace was a success or error

error
string | null

If status=error, this should contain any additional information such as the stacktrace

output_for_eval_metrics
string | null

If provided, will be used as output for any specified evaluation metric.

evaluation_metric_names
string[] | null

Names of evaluation metrics deployed on Parea which should be applied to this log.

scores
EvaluationScoreSchema · object[] | null

Any scores/eval results associated with this log.

feedback_score
number | null

Any captured (user) feedback on this log

apply_eval_frac
number | null
default:1

If specified, evals given with evaluation_metric_names will be applied to this log with this fraction.

log_sample_rate
number | null
default:1

If specified, this log and its entire associated trace will logged with this probability. Must be between 0 and 1 (incl.). Defaults to 1.0 (i.e., keeping all logs)

Required range: 0 <= x <= 1
deployment_id
string | null

Optionally, provide the ID of the used deployed prompt in this log.

cache_hit
boolean
default:false

If the cache was hit for this log.

trace_name
string | null

The name of this span.

children
string[] | null

UUIDs of any children.

children_ids
integer[] | null

IDs of any children. Will be automatically populated.

end_timestamp
string | null

End timestamp of span.

end_user_identifier
string | null

Unique identifier for a end-user.

session_id
string | null

Unique identifier for a session. Can you be used to associated multiple logs in e.g. chat applications.

metadata
Metadata · object

Any additional key-value pairs which provide context or are useful for filtering.

tags
string[] | null

List of tags which provide additional context or are useful for filtering.

experiment_uuid
string | null

If given, will be used to associate this log with an experiment.

images
TraceLogImage · object[] | null

Any images associated with trace.

comments
TraceLogCommentSchema · object[] | null

Any comments on log which were collected on Parea frontend.

annotations
Annotations · object

Any annotations on log which were collected on Parea frontend. It maps annoation criterion ID to a dictionary mapping user_id (Parea user ID) to annotation.

depth
integer
default:0

Depth/level of nestedness of span in overall trace. Root-level trace is 0 and it always increments by 1.

execution_order
integer
default:0

The execution number of span in trace. It starts with 0 and increments by 1 with every span.

evaluation_metric_ids
integer[] | null

Deprecated

fill_children
boolean
default:false

Deprecated

project_uuid
string | null

UUID of project with which this log is associated. Will be automatically filled-in by SDKs

organization_id
string | null

Organization ID associated with Parea API key. Will be automatically determined from API key

children_logs
Children Logs · array

Children logs