Our Python SDK got smarter. We developed a Typscript SDK too. We are updating our SDK code blocks. Python SDKhere.Typscript SDKhere.
Description
Patronus AI APITrace insights

Search Trace Insights

POST
/v1/trace-insight/search
/v1/trace-insight/search

The Authorization access token

Authorization

X-API-KEY<token>

In: header

Request Body

application/jsonRequired

project_idProject Id

appApp

experiment_idExperiment Id

redis_job_idRedis Job Id

trace_idTrace Id

start_timeStart Time

end_timeEnd Time

error_typesError Types

limitLimit

Default: 1000Maximum: 1000

offsetOffset

Default: 0Minimum: 0
curl -X POST "https://api.patronus.ai/v1/trace-insight/search" \
  -H "X-API-KEY: <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "project_id": "string",
    "app": "string",
    "experiment_id": 0,
    "redis_job_id": "string",
    "trace_id": "string",
    "start_time": "2019-08-24T14:15:22Z",
    "end_time": "2019-08-24T14:15:22Z",
    "error_types": [
      "string"
    ],
    "limit": 1000,
    "offset": 0
  }'

Successful Response

{
  "trace_insights": [
    {
      "trace_id": "string",
      "project_id": "string",
      "app": "string",
      "experiment_id": "string",
      "job_id": "453bd7d7-5355-4d6d-a38e-d9e7eb218c3f",
      "processing_status": "pending",
      "error_message": "string",
      "insights": {
        "input_analysis": "string",
        "output_analysis": {
          "span_error_rate": "string",
          "overall_evaluation_analysis": "string",
          "performance_metrics": {
            "aggregate_scores": {
              "overall_score": "string",
              "security_score": "string",
              "reliability_score": "string",
              "plan_optimality_score": "string",
              "instruction_adherence_score": "string"
            }
          },
          "error_classification": [
            {
              "type": "string",
              "spans": [
                "string"
              ],
              "impact_level": "LOW",
              "impact_details": "string",
              "evidence": "string",
              "description": "string",
              "immediate_fix": "string",
              "explanation": "string",
              "suggested_prompt_fix": "string"
            }
          ]
        }
      },
      "created_at": "2019-08-24T14:15:22Z"
    }
  ]
}