github latitude-dev/latitude-llm typescript-sdk-6.0.0-alpha.1
TypeScript SDK v6.0.0-alpha.1

pre-release5 hours ago

Breaking Changes

  • CreateAnnotationBody no longer accepts the flat messageIndex / partIndex / startOffset / endOffset fields at the top level. The nested anchor object is now the only supported shape:

    - client.annotations.create("project-slug", {
    -   value: 1, passed: true, feedback: "…",
    -   trace: { by: "id", id: "…" },
    -   messageIndex: 2,
    -   partIndex: 0,
    -   startOffset: 10,
    -   endOffset: 25,
    - })
    + client.annotations.create("project-slug", {
    +   value: 1, passed: true, feedback: "…",
    +   trace: { by: "id", id: "…" },
    +   anchor: { messageIndex: 2, partIndex: 0, startOffset: 10, endOffset: 25 },
    + })
  • CreateAnnotationBody no longer accepts sessionId or spanId. Both fields are now auto-resolved server-side from the target trace: the session is lifted off the trace, and the span is pinned to the trace's last LLM completion. Callers that were passing either field should remove them — the resolved values are returned on the response. (Internal use cases keep accepting concrete values; only the public API was simplified.)

  • CreateAnnotationBody no longer accepts annotatorId. API keys are organization-scoped, not user-scoped, so there is no real Latitude user behind an API request. Annotations created via the public API persist with annotatorId = null to avoid letting any token holder attribute work to any teammate. Callers that were passing this field should remove it.

  • client.annotations.create no longer accepts id or draft in the body. The public annotations API is creation-only and always publishes immediately:

    • id is gone — every submission creates a new annotation; client-supplied ids are no longer accepted. Editing an existing annotation is not exposed through the public API.
    • draft is gone — every API-submitted annotation is written with draftedAt = null and emits ScoreCreated with status: "published". Draft state is reserved for the managed UI's editing flow.
    - await client.annotations.create("my-project", {
    -   value: 1, passed: true, feedback: "…",
    -   trace: { by: "id", id: "…" },
    -   draft: false,
    - })
    + await client.annotations.create("my-project", {
    +   value: 1, passed: true, feedback: "…",
    +   trace: { by: "id", id: "…" },
    +   // `id` and `draft` are no longer accepted.
    + })
  • CreateScoreBody (custom and _evaluation variants) no longer accepts traceId, sessionId, or spanId. Trace association is now done via a required trace field — the same TraceRef discriminated union used by CreateAnnotationBody ({ by: "id", id } for an exact trace id, or { by: "filters", filters } to resolve a single trace from attribute filters). sessionId is lifted from the trace and spanId is pinned to the trace's last LLM completion server-side:

    - client.scores.create("project-slug", {
    -   sourceId: "my-eval",
    -   traceId: "0123456789abcdef0123456789abcdef",
    -   sessionId: "session-123",
    -   spanId: "aaaaaaaaaaaaaaaa",
    -   value: 0.87, passed: true, feedback: "…",
    - })
    + client.scores.create("project-slug", {
    +   sourceId: "my-eval",
    +   trace: { by: "id", id: "0123456789abcdef0123456789abcdef" },
    +   value: 0.87, passed: true, feedback: "…",
    + })

Don't miss a new latitude-llm release

NewReleases is sending notifications on new releases.