@arizeai/phoenix-client
Version:
A client for the Phoenix API
22 lines • 870 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.toSpanAnnotationData = toSpanAnnotationData;
/**
* Convert a SpanAnnotation to the API format
*/
function toSpanAnnotationData(annotation) {
var _a, _b, _c, _d, _e;
return {
span_id: annotation.spanId,
name: annotation.name,
annotator_kind: (_a = annotation.annotatorKind) !== null && _a !== void 0 ? _a : "HUMAN",
result: {
label: (_b = annotation.label) !== null && _b !== void 0 ? _b : null,
score: (_c = annotation.score) !== null && _c !== void 0 ? _c : null,
explanation: null,
},
metadata: (_d = annotation.metadata) !== null && _d !== void 0 ? _d : null,
identifier: (_e = annotation.identifier) !== null && _e !== void 0 ? _e : "",
};
}
//# sourceMappingURL=types.js.map