{"openapi":"3.1.0","info":{"title":"haiven-ragas","description":"RAGAS evaluation service for haiven-knowledge RAG pipeline (ContextPrecision + Faithfulness)","version":"1.2.0"},"paths":{"/health":{"get":{"summary":"Health","description":"Liveness probe.","operationId":"health_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Health Health Get"}}}}}}},"/evaluate":{"post":{"summary":"Evaluate Endpoint","description":"Start an async RAGAS evaluation job (ContextPrecision + Faithfulness).\n\nReturns HTTP 202 immediately with a job_id.  Poll ``GET /evaluate/{job_id}``\nto track progress.  Only one evaluation job may run at a time — a 409 is\nreturned if a job is already in progress.\n\nCurrently only the ``golden`` dataset is supported.","operationId":"evaluate_endpoint_evaluate_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvaluateRequest"}}},"required":true},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobStartResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/evaluate/{job_id}":{"get":{"summary":"Evaluate Status","description":"Return the current status of an evaluation job.","operationId":"evaluate_status_evaluate__job_id__get","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobStatusResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/evaluate/{job_id}/cancel":{"post":{"summary":"Evaluate Cancel","description":"Request cancellation of a running evaluation job.","operationId":"evaluate_cancel_evaluate__job_id__cancel_post","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobCancelResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/results/latest":{"get":{"summary":"Results Latest","description":"Return the most recent evaluation result JSON file.\n\nScans ``settings.results_path`` for ``*.json`` files and returns the\ncontents of the newest one by filename (ISO timestamp prefix sorts\nlexicographically).","operationId":"results_latest_results_latest_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Results Latest Results Latest Get"}}}}}}}},"components":{"schemas":{"EvaluateRequest":{"properties":{"dataset":{"type":"string","title":"Dataset","default":"golden"},"label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Label"}},"type":"object","title":"EvaluateRequest"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"JobCancelResponse":{"properties":{"job_id":{"type":"string","title":"Job Id"},"status":{"type":"string","title":"Status"},"message":{"type":"string","title":"Message"}},"type":"object","required":["job_id","status","message"],"title":"JobCancelResponse"},"JobStartResponse":{"properties":{"job_id":{"type":"string","title":"Job Id"},"status":{"type":"string","title":"Status"},"message":{"type":"string","title":"Message"}},"type":"object","required":["job_id","status","message"],"title":"JobStartResponse"},"JobStatusResponse":{"properties":{"job_id":{"type":"string","title":"Job Id"},"status":{"type":"string","title":"Status"},"phase":{"type":"string","title":"Phase"},"progress":{"anyOf":[{"$ref":"#/components/schemas/ProgressInfo"},{"type":"null"}]},"result":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Result"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"},"created_at":{"type":"string","title":"Created At"},"completed_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Completed At"}},"type":"object","required":["job_id","status","phase","created_at"],"title":"JobStatusResponse"},"ProgressInfo":{"properties":{"current":{"type":"integer","title":"Current"},"total":{"type":"integer","title":"Total"},"percent":{"type":"number","title":"Percent"}},"type":"object","required":["current","total","percent"],"title":"ProgressInfo"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}}}