UNPKG

@arizeai/phoenix-client

Version:

A client for the Phoenix API

44 lines 1.53 kB
import { paths } from "../__generated__/api/v1"; import { Annotation } from "../types/annotations"; type SpanAnnotationData = paths["/v1/span_annotations"]["post"]["requestBody"]["content"]["application/json"]["data"][0]; type SpanDocumentAnnotationData = paths["/v1/document_annotations"]["post"]["requestBody"]["content"]["application/json"]["data"][0]; /** * Parameters for a single span annotation */ export interface SpanAnnotation extends Annotation { /** * The OpenTelemetry Span ID (hex format without 0x prefix) */ spanId: string; /** * The kind of annotator used for the annotation * Can be "HUMAN", "LLM", or "CODE" * @default "HUMAN" */ annotatorKind?: SpanAnnotationData["annotator_kind"]; } /** * Parameters for a single document annotation */ export interface DocumentAnnotation extends SpanAnnotation { /** * The 0-based index of the document within the span */ documentPosition: number; /** * The kind of annotator used for the annotation * Can be "HUMAN", "LLM", or "CODE" * @default "HUMAN" */ annotatorKind?: SpanDocumentAnnotationData["annotator_kind"]; } /** * Convert a SpanAnnotation to the API format */ export declare function toSpanAnnotationData(annotation: SpanAnnotation): SpanAnnotationData; /** * Convert a DocumentAnnotation to the API format */ export declare function toDocumentAnnotationData(annotation: DocumentAnnotation): SpanDocumentAnnotationData; export {}; //# sourceMappingURL=types.d.ts.map