From 78dbaff255f3c827f306844605b10e3c51a02523 Mon Sep 17 00:00:00 2001 From: Max Deichmann Date: Mon, 20 Jan 2025 22:11:28 +0100 Subject: [PATCH 01/13] feat: update prompts and invalidate cache --- .../langfuse-integration-node.spec.ts | 20 + .../openapi-spec/openapi-server.yaml | 1381 +++++++++-------- langfuse-core/src/index.ts | 16 + langfuse-core/src/openapi/server.ts | 97 +- langfuse-core/src/prompts/promptCache.ts | 8 + langfuse-core/src/types.ts | 3 + 6 files changed, 867 insertions(+), 658 deletions(-) diff --git a/integration-test/langfuse-integration-node.spec.ts b/integration-test/langfuse-integration-node.spec.ts index f8103931..d65c0597 100644 --- a/integration-test/langfuse-integration-node.spec.ts +++ b/integration-test/langfuse-integration-node.spec.ts @@ -432,6 +432,26 @@ describe("Langfuse Node.js", () => { version: expect.any(Number), }); }); + + it("update a prompt", async () => { + const promptName = "test-prompt" + Math.random().toString(36); + await langfuse.createPrompt({ + name: promptName, + prompt: "This is a prompt with a {{variable}}", + isActive: true, + labels: ["john"], + }); + + const updatedPrompt = await langfuse.updatePrompt({ + name: promptName, + version: 1, + newLabels: ["john", "doe"], + }); + + const prompt = await langfuse.getPrompt(promptName); + expect(prompt.labels).toEqual(expect.arrayContaining(["john", "doe"])); + expect(updatedPrompt.labels).toEqual(expect.arrayContaining(["john", "doe"])); + }); }); it("link prompt to generation", async () => { diff --git a/langfuse-core/openapi-spec/openapi-server.yaml b/langfuse-core/openapi-spec/openapi-server.yaml index 9e40794a..fbbf2e80 100644 --- a/langfuse-core/openapi-spec/openapi-server.yaml +++ b/langfuse-core/openapi-spec/openapi-server.yaml @@ -1,7 +1,7 @@ openapi: 3.0.1 info: title: langfuse - version: '' + version: "" description: >- ## Authentication @@ -34,34 +34,34 @@ paths: - Comments parameters: [] responses: - '200': - description: '' + "200": + description: "" content: application/json: schema: - $ref: '#/components/schemas/CreateCommentResponse' - '400': - description: '' + $ref: "#/components/schemas/CreateCommentResponse" + "400": + description: "" content: application/json: schema: {} - '401': - description: '' + "401": + description: "" content: application/json: schema: {} - '403': - description: '' + "403": + description: "" content: application/json: schema: {} - '404': - description: '' + "404": + description: "" content: application/json: schema: {} - '405': - description: '' + "405": + description: "" content: application/json: schema: {} @@ -72,7 +72,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/CreateCommentRequest' + $ref: "#/components/schemas/CreateCommentRequest" get: description: Get all comments operationId: comments_get @@ -121,34 +121,34 @@ paths: type: string nullable: true responses: - '200': - description: '' + "200": + description: "" content: application/json: schema: - $ref: '#/components/schemas/GetCommentsResponse' - '400': - description: '' + $ref: "#/components/schemas/GetCommentsResponse" + "400": + description: "" content: application/json: schema: {} - '401': - description: '' + "401": + description: "" content: application/json: schema: {} - '403': - description: '' + "403": + description: "" content: application/json: schema: {} - '404': - description: '' + "404": + description: "" content: application/json: schema: {} - '405': - description: '' + "405": + description: "" content: application/json: schema: {} @@ -168,34 +168,34 @@ paths: schema: type: string responses: - '200': - description: '' + "200": + description: "" content: application/json: schema: - $ref: '#/components/schemas/Comment' - '400': - description: '' + $ref: "#/components/schemas/Comment" + "400": + description: "" content: application/json: schema: {} - '401': - description: '' + "401": + description: "" content: application/json: schema: {} - '403': - description: '' + "403": + description: "" content: application/json: schema: {} - '404': - description: '' + "404": + description: "" content: application/json: schema: {} - '405': - description: '' + "405": + description: "" content: application/json: schema: {} @@ -209,34 +209,34 @@ paths: - DatasetItems parameters: [] responses: - '200': - description: '' + "200": + description: "" content: application/json: schema: - $ref: '#/components/schemas/DatasetItem' - '400': - description: '' + $ref: "#/components/schemas/DatasetItem" + "400": + description: "" content: application/json: schema: {} - '401': - description: '' + "401": + description: "" content: application/json: schema: {} - '403': - description: '' + "403": + description: "" content: application/json: schema: {} - '404': - description: '' + "404": + description: "" content: application/json: schema: {} - '405': - description: '' + "405": + description: "" content: application/json: schema: {} @@ -247,7 +247,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/CreateDatasetItemRequest' + $ref: "#/components/schemas/CreateDatasetItemRequest" get: description: Get dataset items operationId: datasetItems_list @@ -287,34 +287,34 @@ paths: type: integer nullable: true responses: - '200': - description: '' + "200": + description: "" content: application/json: schema: - $ref: '#/components/schemas/PaginatedDatasetItems' - '400': - description: '' + $ref: "#/components/schemas/PaginatedDatasetItems" + "400": + description: "" content: application/json: schema: {} - '401': - description: '' + "401": + description: "" content: application/json: schema: {} - '403': - description: '' + "403": + description: "" content: application/json: schema: {} - '404': - description: '' + "404": + description: "" content: application/json: schema: {} - '405': - description: '' + "405": + description: "" content: application/json: schema: {} @@ -333,34 +333,34 @@ paths: schema: type: string responses: - '200': - description: '' + "200": + description: "" content: application/json: schema: - $ref: '#/components/schemas/DatasetItem' - '400': - description: '' + $ref: "#/components/schemas/DatasetItem" + "400": + description: "" content: application/json: schema: {} - '401': - description: '' + "401": + description: "" content: application/json: schema: {} - '403': - description: '' + "403": + description: "" content: application/json: schema: {} - '404': - description: '' + "404": + description: "" content: application/json: schema: {} - '405': - description: '' + "405": + description: "" content: application/json: schema: {} @@ -374,34 +374,34 @@ paths: - DatasetRunItems parameters: [] responses: - '200': - description: '' + "200": + description: "" content: application/json: schema: - $ref: '#/components/schemas/DatasetRunItem' - '400': - description: '' + $ref: "#/components/schemas/DatasetRunItem" + "400": + description: "" content: application/json: schema: {} - '401': - description: '' + "401": + description: "" content: application/json: schema: {} - '403': - description: '' + "403": + description: "" content: application/json: schema: {} - '404': - description: '' + "404": + description: "" content: application/json: schema: {} - '405': - description: '' + "405": + description: "" content: application/json: schema: {} @@ -412,7 +412,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/CreateDatasetRunItemRequest' + $ref: "#/components/schemas/CreateDatasetRunItemRequest" /api/public/v2/datasets: get: description: Get all datasets @@ -435,34 +435,34 @@ paths: type: integer nullable: true responses: - '200': - description: '' + "200": + description: "" content: application/json: schema: - $ref: '#/components/schemas/PaginatedDatasets' - '400': - description: '' + $ref: "#/components/schemas/PaginatedDatasets" + "400": + description: "" content: application/json: schema: {} - '401': - description: '' + "401": + description: "" content: application/json: schema: {} - '403': - description: '' + "403": + description: "" content: application/json: schema: {} - '404': - description: '' + "404": + description: "" content: application/json: schema: {} - '405': - description: '' + "405": + description: "" content: application/json: schema: {} @@ -475,34 +475,34 @@ paths: - Datasets parameters: [] responses: - '200': - description: '' + "200": + description: "" content: application/json: schema: - $ref: '#/components/schemas/Dataset' - '400': - description: '' + $ref: "#/components/schemas/Dataset" + "400": + description: "" content: application/json: schema: {} - '401': - description: '' + "401": + description: "" content: application/json: schema: {} - '403': - description: '' + "403": + description: "" content: application/json: schema: {} - '404': - description: '' + "404": + description: "" content: application/json: schema: {} - '405': - description: '' + "405": + description: "" content: application/json: schema: {} @@ -513,7 +513,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/CreateDatasetRequest' + $ref: "#/components/schemas/CreateDatasetRequest" /api/public/v2/datasets/{datasetName}: get: description: Get a dataset @@ -527,34 +527,34 @@ paths: schema: type: string responses: - '200': - description: '' + "200": + description: "" content: application/json: schema: - $ref: '#/components/schemas/Dataset' - '400': - description: '' + $ref: "#/components/schemas/Dataset" + "400": + description: "" content: application/json: schema: {} - '401': - description: '' + "401": + description: "" content: application/json: schema: {} - '403': - description: '' + "403": + description: "" content: application/json: schema: {} - '404': - description: '' + "404": + description: "" content: application/json: schema: {} - '405': - description: '' + "405": + description: "" content: application/json: schema: {} @@ -578,34 +578,34 @@ paths: schema: type: string responses: - '200': - description: '' + "200": + description: "" content: application/json: schema: - $ref: '#/components/schemas/DatasetRunWithItems' - '400': - description: '' + $ref: "#/components/schemas/DatasetRunWithItems" + "400": + description: "" content: application/json: schema: {} - '401': - description: '' + "401": + description: "" content: application/json: schema: {} - '403': - description: '' + "403": + description: "" content: application/json: schema: {} - '404': - description: '' + "404": + description: "" content: application/json: schema: {} - '405': - description: '' + "405": + description: "" content: application/json: schema: {} @@ -638,34 +638,34 @@ paths: type: integer nullable: true responses: - '200': - description: '' + "200": + description: "" content: application/json: schema: - $ref: '#/components/schemas/PaginatedDatasetRuns' - '400': - description: '' + $ref: "#/components/schemas/PaginatedDatasetRuns" + "400": + description: "" content: application/json: schema: {} - '401': - description: '' + "401": + description: "" content: application/json: schema: {} - '403': - description: '' + "403": + description: "" content: application/json: schema: {} - '404': - description: '' + "404": + description: "" content: application/json: schema: {} - '405': - description: '' + "405": + description: "" content: application/json: schema: {} @@ -679,39 +679,39 @@ paths: - Health parameters: [] responses: - '200': - description: '' + "200": + description: "" content: application/json: schema: - $ref: '#/components/schemas/HealthResponse' - '400': - description: '' + $ref: "#/components/schemas/HealthResponse" + "400": + description: "" content: application/json: schema: {} - '401': - description: '' + "401": + description: "" content: application/json: schema: {} - '403': - description: '' + "403": + description: "" content: application/json: schema: {} - '404': - description: '' + "404": + description: "" content: application/json: schema: {} - '405': - description: '' + "405": + description: "" content: application/json: schema: {} - '503': - description: '' + "503": + description: "" /api/public/ingestion: post: description: >- @@ -723,6 +723,9 @@ paths: Notes: + - Introduction to data model: + https://langfuse.com/docs/tracing-data-model + - Batch sizes are limited to 3.5 MB in total. You need to adjust the number of events per batch accordingly. @@ -734,34 +737,34 @@ paths: - Ingestion parameters: [] responses: - '200': - description: '' + "200": + description: "" content: application/json: schema: - $ref: '#/components/schemas/IngestionResponse' - '400': - description: '' + $ref: "#/components/schemas/IngestionResponse" + "400": + description: "" content: application/json: schema: {} - '401': - description: '' + "401": + description: "" content: application/json: schema: {} - '403': - description: '' + "403": + description: "" content: application/json: schema: {} - '404': - description: '' + "404": + description: "" content: application/json: schema: {} - '405': - description: '' + "405": + description: "" content: application/json: schema: {} @@ -777,7 +780,7 @@ paths: batch: type: array items: - $ref: '#/components/schemas/IngestionEvent' + $ref: "#/components/schemas/IngestionEvent" description: >- Batch of tracing events to be ingested. Discriminated by attribute `type`. @@ -802,34 +805,34 @@ paths: schema: type: string responses: - '200': - description: '' + "200": + description: "" content: application/json: schema: - $ref: '#/components/schemas/GetMediaResponse' - '400': - description: '' + $ref: "#/components/schemas/GetMediaResponse" + "400": + description: "" content: application/json: schema: {} - '401': - description: '' + "401": + description: "" content: application/json: schema: {} - '403': - description: '' + "403": + description: "" content: application/json: schema: {} - '404': - description: '' + "404": + description: "" content: application/json: schema: {} - '405': - description: '' + "405": + description: "" content: application/json: schema: {} @@ -848,30 +851,30 @@ paths: schema: type: string responses: - '204': - description: '' - '400': - description: '' + "204": + description: "" + "400": + description: "" content: application/json: schema: {} - '401': - description: '' + "401": + description: "" content: application/json: schema: {} - '403': - description: '' + "403": + description: "" content: application/json: schema: {} - '404': - description: '' + "404": + description: "" content: application/json: schema: {} - '405': - description: '' + "405": + description: "" content: application/json: schema: {} @@ -882,7 +885,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/PatchMediaBody' + $ref: "#/components/schemas/PatchMediaBody" /api/public/media: post: description: Get a presigned upload URL for a media record @@ -891,34 +894,34 @@ paths: - Media parameters: [] responses: - '200': - description: '' + "200": + description: "" content: application/json: schema: - $ref: '#/components/schemas/GetMediaUploadUrlResponse' - '400': - description: '' + $ref: "#/components/schemas/GetMediaUploadUrlResponse" + "400": + description: "" content: application/json: schema: {} - '401': - description: '' + "401": + description: "" content: application/json: schema: {} - '403': - description: '' + "403": + description: "" content: application/json: schema: {} - '404': - description: '' + "404": + description: "" content: application/json: schema: {} - '405': - description: '' + "405": + description: "" content: application/json: schema: {} @@ -929,7 +932,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/GetMediaUploadUrlRequest' + $ref: "#/components/schemas/GetMediaUploadUrlRequest" /api/public/metrics/daily: get: description: Get daily metrics of the Langfuse project @@ -995,34 +998,34 @@ paths: format: date-time nullable: true responses: - '200': - description: '' + "200": + description: "" content: application/json: schema: - $ref: '#/components/schemas/DailyMetrics' - '400': - description: '' + $ref: "#/components/schemas/DailyMetrics" + "400": + description: "" content: application/json: schema: {} - '401': - description: '' + "401": + description: "" content: application/json: schema: {} - '403': - description: '' + "403": + description: "" content: application/json: schema: {} - '404': - description: '' + "404": + description: "" content: application/json: schema: {} - '405': - description: '' + "405": + description: "" content: application/json: schema: {} @@ -1036,34 +1039,34 @@ paths: - Models parameters: [] responses: - '200': - description: '' + "200": + description: "" content: application/json: schema: - $ref: '#/components/schemas/Model' - '400': - description: '' + $ref: "#/components/schemas/Model" + "400": + description: "" content: application/json: schema: {} - '401': - description: '' + "401": + description: "" content: application/json: schema: {} - '403': - description: '' + "403": + description: "" content: application/json: schema: {} - '404': - description: '' + "404": + description: "" content: application/json: schema: {} - '405': - description: '' + "405": + description: "" content: application/json: schema: {} @@ -1074,7 +1077,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/CreateModelRequest' + $ref: "#/components/schemas/CreateModelRequest" get: description: Get all models operationId: models_list @@ -1096,34 +1099,34 @@ paths: type: integer nullable: true responses: - '200': - description: '' + "200": + description: "" content: application/json: schema: - $ref: '#/components/schemas/PaginatedModels' - '400': - description: '' + $ref: "#/components/schemas/PaginatedModels" + "400": + description: "" content: application/json: schema: {} - '401': - description: '' + "401": + description: "" content: application/json: schema: {} - '403': - description: '' + "403": + description: "" content: application/json: schema: {} - '404': - description: '' + "404": + description: "" content: application/json: schema: {} - '405': - description: '' + "405": + description: "" content: application/json: schema: {} @@ -1142,34 +1145,34 @@ paths: schema: type: string responses: - '200': - description: '' + "200": + description: "" content: application/json: schema: - $ref: '#/components/schemas/Model' - '400': - description: '' + $ref: "#/components/schemas/Model" + "400": + description: "" content: application/json: schema: {} - '401': - description: '' + "401": + description: "" content: application/json: schema: {} - '403': - description: '' + "403": + description: "" content: application/json: schema: {} - '404': - description: '' + "404": + description: "" content: application/json: schema: {} - '405': - description: '' + "405": + description: "" content: application/json: schema: {} @@ -1190,30 +1193,30 @@ paths: schema: type: string responses: - '204': - description: '' - '400': - description: '' + "204": + description: "" + "400": + description: "" content: application/json: schema: {} - '401': - description: '' + "401": + description: "" content: application/json: schema: {} - '403': - description: '' + "403": + description: "" content: application/json: schema: {} - '404': - description: '' + "404": + description: "" content: application/json: schema: {} - '405': - description: '' + "405": + description: "" content: application/json: schema: {} @@ -1235,34 +1238,34 @@ paths: schema: type: string responses: - '200': - description: '' + "200": + description: "" content: application/json: schema: - $ref: '#/components/schemas/ObservationsView' - '400': - description: '' + $ref: "#/components/schemas/ObservationsView" + "400": + description: "" content: application/json: schema: {} - '401': - description: '' + "401": + description: "" content: application/json: schema: {} - '403': - description: '' + "403": + description: "" content: application/json: schema: {} - '404': - description: '' + "404": + description: "" content: application/json: schema: {} - '405': - description: '' + "405": + description: "" content: application/json: schema: {} @@ -1349,34 +1352,34 @@ paths: type: string nullable: true responses: - '200': - description: '' + "200": + description: "" content: application/json: schema: - $ref: '#/components/schemas/ObservationsViews' - '400': - description: '' + $ref: "#/components/schemas/ObservationsViews" + "400": + description: "" content: application/json: schema: {} - '401': - description: '' + "401": + description: "" content: application/json: schema: {} - '403': - description: '' + "403": + description: "" content: application/json: schema: {} - '404': - description: '' + "404": + description: "" content: application/json: schema: {} - '405': - description: '' + "405": + description: "" content: application/json: schema: {} @@ -1390,39 +1393,109 @@ paths: - Projects parameters: [] responses: - '200': - description: '' + "200": + description: "" content: application/json: schema: - $ref: '#/components/schemas/Projects' - '400': - description: '' + $ref: "#/components/schemas/Projects" + "400": + description: "" content: application/json: schema: {} - '401': - description: '' + "401": + description: "" content: application/json: schema: {} - '403': - description: '' + "403": + description: "" content: application/json: schema: {} - '404': - description: '' + "404": + description: "" content: application/json: schema: {} - '405': - description: '' + "405": + description: "" content: application/json: schema: {} security: - BasicAuth: [] + /api/public/v2/prompts/{promptName}/version/{version}: + patch: + description: Update labels for a specific prompt version + operationId: promptVersion_update + tags: + - PromptVersion + parameters: + - name: promptName + in: path + description: The name of the prompt + required: true + schema: + type: string + - name: version + in: path + description: Version of the prompt to update + required: true + schema: + type: integer + responses: + "200": + description: "" + content: + application/json: + schema: + $ref: "#/components/schemas/Prompt" + "400": + description: "" + content: + application/json: + schema: {} + "401": + description: "" + content: + application/json: + schema: {} + "403": + description: "" + content: + application/json: + schema: {} + "404": + description: "" + content: + application/json: + schema: {} + "405": + description: "" + content: + application/json: + schema: {} + security: + - BasicAuth: [] + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + newLabels: + type: array + items: + type: string + description: >- + New labels for the prompt version. Labels are unique across + versions. The "latest" label is reserved and managed by + Langfuse. + required: + - newLabels /api/public/v2/prompts/{promptName}: get: description: Get a prompt @@ -1453,34 +1526,34 @@ paths: type: string nullable: true responses: - '200': - description: '' + "200": + description: "" content: application/json: schema: - $ref: '#/components/schemas/Prompt' - '400': - description: '' + $ref: "#/components/schemas/Prompt" + "400": + description: "" content: application/json: schema: {} - '401': - description: '' + "401": + description: "" content: application/json: schema: {} - '403': - description: '' + "403": + description: "" content: application/json: schema: {} - '404': - description: '' + "404": + description: "" content: application/json: schema: {} - '405': - description: '' + "405": + description: "" content: application/json: schema: {} @@ -1546,34 +1619,34 @@ paths: format: date-time nullable: true responses: - '200': - description: '' + "200": + description: "" content: application/json: schema: - $ref: '#/components/schemas/PromptMetaListResponse' - '400': - description: '' + $ref: "#/components/schemas/PromptMetaListResponse" + "400": + description: "" content: application/json: schema: {} - '401': - description: '' + "401": + description: "" content: application/json: schema: {} - '403': - description: '' + "403": + description: "" content: application/json: schema: {} - '404': - description: '' + "404": + description: "" content: application/json: schema: {} - '405': - description: '' + "405": + description: "" content: application/json: schema: {} @@ -1586,34 +1659,34 @@ paths: - Prompts parameters: [] responses: - '200': - description: '' + "200": + description: "" content: application/json: schema: - $ref: '#/components/schemas/Prompt' - '400': - description: '' + $ref: "#/components/schemas/Prompt" + "400": + description: "" content: application/json: schema: {} - '401': - description: '' + "401": + description: "" content: application/json: schema: {} - '403': - description: '' + "403": + description: "" content: application/json: schema: {} - '404': - description: '' + "404": + description: "" content: application/json: schema: {} - '405': - description: '' + "405": + description: "" content: application/json: schema: {} @@ -1624,7 +1697,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/CreatePromptRequest' + $ref: "#/components/schemas/CreatePromptRequest" /api/public/score-configs: post: description: >- @@ -1635,34 +1708,34 @@ paths: - ScoreConfigs parameters: [] responses: - '200': - description: '' + "200": + description: "" content: application/json: schema: - $ref: '#/components/schemas/ScoreConfig' - '400': - description: '' + $ref: "#/components/schemas/ScoreConfig" + "400": + description: "" content: application/json: schema: {} - '401': - description: '' + "401": + description: "" content: application/json: schema: {} - '403': - description: '' + "403": + description: "" content: application/json: schema: {} - '404': - description: '' + "404": + description: "" content: application/json: schema: {} - '405': - description: '' + "405": + description: "" content: application/json: schema: {} @@ -1673,7 +1746,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/CreateScoreConfigRequest' + $ref: "#/components/schemas/CreateScoreConfigRequest" get: description: Get all score configs operationId: scoreConfigs_get @@ -1697,34 +1770,34 @@ paths: type: integer nullable: true responses: - '200': - description: '' + "200": + description: "" content: application/json: schema: - $ref: '#/components/schemas/ScoreConfigs' - '400': - description: '' + $ref: "#/components/schemas/ScoreConfigs" + "400": + description: "" content: application/json: schema: {} - '401': - description: '' + "401": + description: "" content: application/json: schema: {} - '403': - description: '' + "403": + description: "" content: application/json: schema: {} - '404': - description: '' + "404": + description: "" content: application/json: schema: {} - '405': - description: '' + "405": + description: "" content: application/json: schema: {} @@ -1744,34 +1817,34 @@ paths: schema: type: string responses: - '200': - description: '' + "200": + description: "" content: application/json: schema: - $ref: '#/components/schemas/ScoreConfig' - '400': - description: '' + $ref: "#/components/schemas/ScoreConfig" + "400": + description: "" content: application/json: schema: {} - '401': - description: '' + "401": + description: "" content: application/json: schema: {} - '403': - description: '' + "403": + description: "" content: application/json: schema: {} - '404': - description: '' + "404": + description: "" content: application/json: schema: {} - '405': - description: '' + "405": + description: "" content: application/json: schema: {} @@ -1785,34 +1858,34 @@ paths: - Score parameters: [] responses: - '200': - description: '' + "200": + description: "" content: application/json: schema: - $ref: '#/components/schemas/CreateScoreResponse' - '400': - description: '' + $ref: "#/components/schemas/CreateScoreResponse" + "400": + description: "" content: application/json: schema: {} - '401': - description: '' + "401": + description: "" content: application/json: schema: {} - '403': - description: '' + "403": + description: "" content: application/json: schema: {} - '404': - description: '' + "404": + description: "" content: application/json: schema: {} - '405': - description: '' + "405": + description: "" content: application/json: schema: {} @@ -1823,7 +1896,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/CreateScoreRequest' + $ref: "#/components/schemas/CreateScoreRequest" get: description: Get a list of scores operationId: score_get @@ -1885,7 +1958,7 @@ paths: description: Retrieve only scores from a specific source. required: false schema: - $ref: '#/components/schemas/ScoreSource' + $ref: "#/components/schemas/ScoreSource" nullable: true - name: operator in: query @@ -1928,7 +2001,7 @@ paths: description: Retrieve only scores with a specific dataType. required: false schema: - $ref: '#/components/schemas/ScoreDataType' + $ref: "#/components/schemas/ScoreDataType" nullable: true - name: traceTags in: query @@ -1942,34 +2015,34 @@ paths: type: string nullable: true responses: - '200': - description: '' + "200": + description: "" content: application/json: schema: - $ref: '#/components/schemas/GetScoresResponse' - '400': - description: '' + $ref: "#/components/schemas/GetScoresResponse" + "400": + description: "" content: application/json: schema: {} - '401': - description: '' + "401": + description: "" content: application/json: schema: {} - '403': - description: '' + "403": + description: "" content: application/json: schema: {} - '404': - description: '' + "404": + description: "" content: application/json: schema: {} - '405': - description: '' + "405": + description: "" content: application/json: schema: {} @@ -1989,34 +2062,34 @@ paths: schema: type: string responses: - '200': - description: '' + "200": + description: "" content: application/json: schema: - $ref: '#/components/schemas/Score' - '400': - description: '' + $ref: "#/components/schemas/Score" + "400": + description: "" content: application/json: schema: {} - '401': - description: '' + "401": + description: "" content: application/json: schema: {} - '403': - description: '' + "403": + description: "" content: application/json: schema: {} - '404': - description: '' + "404": + description: "" content: application/json: schema: {} - '405': - description: '' + "405": + description: "" content: application/json: schema: {} @@ -2035,30 +2108,30 @@ paths: schema: type: string responses: - '204': - description: '' - '400': - description: '' + "204": + description: "" + "400": + description: "" content: application/json: schema: {} - '401': - description: '' + "401": + description: "" content: application/json: schema: {} - '403': - description: '' + "403": + description: "" content: application/json: schema: {} - '404': - description: '' + "404": + description: "" content: application/json: schema: {} - '405': - description: '' + "405": + description: "" content: application/json: schema: {} @@ -2108,34 +2181,34 @@ paths: format: date-time nullable: true responses: - '200': - description: '' + "200": + description: "" content: application/json: schema: - $ref: '#/components/schemas/PaginatedSessions' - '400': - description: '' + $ref: "#/components/schemas/PaginatedSessions" + "400": + description: "" content: application/json: schema: {} - '401': - description: '' + "401": + description: "" content: application/json: schema: {} - '403': - description: '' + "403": + description: "" content: application/json: schema: {} - '404': - description: '' + "404": + description: "" content: application/json: schema: {} - '405': - description: '' + "405": + description: "" content: application/json: schema: {} @@ -2158,34 +2231,34 @@ paths: schema: type: string responses: - '200': - description: '' + "200": + description: "" content: application/json: schema: - $ref: '#/components/schemas/SessionWithTraces' - '400': - description: '' + $ref: "#/components/schemas/SessionWithTraces" + "400": + description: "" content: application/json: schema: {} - '401': - description: '' + "401": + description: "" content: application/json: schema: {} - '403': - description: '' + "403": + description: "" content: application/json: schema: {} - '404': - description: '' + "404": + description: "" content: application/json: schema: {} - '405': - description: '' + "405": + description: "" content: application/json: schema: {} @@ -2205,34 +2278,34 @@ paths: schema: type: string responses: - '200': - description: '' + "200": + description: "" content: application/json: schema: - $ref: '#/components/schemas/TraceWithFullDetails' - '400': - description: '' + $ref: "#/components/schemas/TraceWithFullDetails" + "400": + description: "" content: application/json: schema: {} - '401': - description: '' + "401": + description: "" content: application/json: schema: {} - '403': - description: '' + "403": + description: "" content: application/json: schema: {} - '404': - description: '' + "404": + description: "" content: application/json: schema: {} - '405': - description: '' + "405": + description: "" content: application/json: schema: {} @@ -2333,34 +2406,34 @@ paths: type: string nullable: true responses: - '200': - description: '' + "200": + description: "" content: application/json: schema: - $ref: '#/components/schemas/Traces' - '400': - description: '' + $ref: "#/components/schemas/Traces" + "400": + description: "" content: application/json: schema: {} - '401': - description: '' + "401": + description: "" content: application/json: schema: {} - '403': - description: '' + "403": + description: "" content: application/json: schema: {} - '404': - description: '' + "404": + description: "" content: application/json: schema: {} - '405': - description: '' + "405": + description: "" content: application/json: schema: {} @@ -2415,9 +2488,9 @@ components: data: type: array items: - $ref: '#/components/schemas/Comment' + $ref: "#/components/schemas/Comment" meta: - $ref: '#/components/schemas/utilsMetaResponse' + $ref: "#/components/schemas/utilsMetaResponse" required: - data - meta @@ -2508,7 +2581,7 @@ components: - observations - scores allOf: - - $ref: '#/components/schemas/Trace' + - $ref: "#/components/schemas/Trace" TraceWithFullDetails: title: TraceWithFullDetails type: object @@ -2527,12 +2600,12 @@ components: observations: type: array items: - $ref: '#/components/schemas/ObservationsView' + $ref: "#/components/schemas/ObservationsView" description: List of observations scores: type: array items: - $ref: '#/components/schemas/Score' + $ref: "#/components/schemas/Score" description: List of scores required: - htmlPath @@ -2541,7 +2614,7 @@ components: - observations - scores allOf: - - $ref: '#/components/schemas/Trace' + - $ref: "#/components/schemas/Trace" Session: title: Session type: object @@ -2564,11 +2637,11 @@ components: traces: type: array items: - $ref: '#/components/schemas/Trace' + $ref: "#/components/schemas/Trace" required: - traces allOf: - - $ref: '#/components/schemas/Session' + - $ref: "#/components/schemas/Session" Observation: title: Observation type: object @@ -2608,7 +2681,7 @@ components: modelParameters: type: object additionalProperties: - $ref: '#/components/schemas/MapValue' + $ref: "#/components/schemas/MapValue" nullable: true description: The parameters of the model used for the observation input: @@ -2625,13 +2698,13 @@ components: nullable: true description: The output data of the observation usage: - $ref: '#/components/schemas/Usage' + $ref: "#/components/schemas/Usage" nullable: true description: >- (Deprecated. Use usageDetails and costDetails instead.) The usage data of the observation level: - $ref: '#/components/schemas/ObservationLevel' + $ref: "#/components/schemas/ObservationLevel" description: The level of the observation statusMessage: type: string @@ -2732,7 +2805,7 @@ components: nullable: true description: The time to the first token in seconds allOf: - - $ref: '#/components/schemas/Observation' + - $ref: "#/components/schemas/Observation" Usage: title: Usage type: object @@ -2753,7 +2826,7 @@ components: nullable: true description: Defaults to input+output if not set unit: - $ref: '#/components/schemas/ModelUsageUnit' + $ref: "#/components/schemas/ModelUsageUnit" nullable: true inputCost: type: number @@ -2788,7 +2861,7 @@ components: projectId: type: string dataType: - $ref: '#/components/schemas/ScoreDataType' + $ref: "#/components/schemas/ScoreDataType" isArchived: type: boolean description: Whether the score config is archived. Defaults to false @@ -2809,7 +2882,7 @@ components: categories: type: array items: - $ref: '#/components/schemas/ConfigCategory' + $ref: "#/components/schemas/ConfigCategory" nullable: true description: Configures custom categories for categorical scores description: @@ -2846,7 +2919,7 @@ components: name: type: string source: - $ref: '#/components/schemas/ScoreSource' + $ref: "#/components/schemas/ScoreSource" observationId: type: string nullable: true @@ -2897,7 +2970,7 @@ components: required: - value allOf: - - $ref: '#/components/schemas/BaseScore' + - $ref: "#/components/schemas/BaseScore" BooleanScore: title: BooleanScore type: object @@ -2917,7 +2990,7 @@ components: - value - stringValue allOf: - - $ref: '#/components/schemas/BaseScore' + - $ref: "#/components/schemas/BaseScore" CategoricalScore: title: CategoricalScore type: object @@ -2937,7 +3010,7 @@ components: required: - stringValue allOf: - - $ref: '#/components/schemas/BaseScore' + - $ref: "#/components/schemas/BaseScore" Score: title: Score oneOf: @@ -2949,7 +3022,7 @@ components: type: string enum: - NUMERIC - - $ref: '#/components/schemas/NumericScore' + - $ref: "#/components/schemas/NumericScore" required: - dataType - type: object @@ -2960,7 +3033,7 @@ components: type: string enum: - CATEGORICAL - - $ref: '#/components/schemas/CategoricalScore' + - $ref: "#/components/schemas/CategoricalScore" required: - dataType - type: object @@ -2971,7 +3044,7 @@ components: type: string enum: - BOOLEAN - - $ref: '#/components/schemas/BooleanScore' + - $ref: "#/components/schemas/BooleanScore" required: - dataType CreateScoreValue: @@ -2998,7 +3071,7 @@ components: type: string format: date-time objectType: - $ref: '#/components/schemas/CommentObjectType' + $ref: "#/components/schemas/CommentObjectType" objectId: type: string content: @@ -3048,7 +3121,7 @@ components: id: type: string status: - $ref: '#/components/schemas/DatasetStatus' + $ref: "#/components/schemas/DatasetStatus" input: nullable: true expectedOutput: @@ -3154,11 +3227,11 @@ components: datasetRunItems: type: array items: - $ref: '#/components/schemas/DatasetRunItem' + $ref: "#/components/schemas/DatasetRunItem" required: - datasetRunItems allOf: - - $ref: '#/components/schemas/DatasetRun' + - $ref: "#/components/schemas/DatasetRun" Model: title: Model type: object @@ -3183,11 +3256,12 @@ components: to exact match, use `(?i)^modelname$` startDate: type: string - format: date + format: date-time nullable: true description: Apply only to generations which are newer than this ISO date. unit: - $ref: '#/components/schemas/ModelUsageUnit' + $ref: "#/components/schemas/ModelUsageUnit" + nullable: true description: Unit used by this model. inputPrice: type: number @@ -3223,7 +3297,6 @@ components: - id - modelName - matchPattern - - unit - isLangfuseManaged ModelUsageUnit: title: ModelUsageUnit @@ -3310,7 +3383,7 @@ components: Dataset items are upserted on their id. Id needs to be unique (project-level) and cannot be reused across datasets. status: - $ref: '#/components/schemas/DatasetStatus' + $ref: "#/components/schemas/DatasetStatus" nullable: true description: Defaults to ACTIVE for newly created items required: @@ -3322,9 +3395,9 @@ components: data: type: array items: - $ref: '#/components/schemas/DatasetItem' + $ref: "#/components/schemas/DatasetItem" meta: - $ref: '#/components/schemas/utilsMetaResponse' + $ref: "#/components/schemas/utilsMetaResponse" required: - data - meta @@ -3362,9 +3435,9 @@ components: data: type: array items: - $ref: '#/components/schemas/Dataset' + $ref: "#/components/schemas/Dataset" meta: - $ref: '#/components/schemas/utilsMetaResponse' + $ref: "#/components/schemas/utilsMetaResponse" required: - data - meta @@ -3388,9 +3461,9 @@ components: data: type: array items: - $ref: '#/components/schemas/DatasetRun' + $ref: "#/components/schemas/DatasetRun" meta: - $ref: '#/components/schemas/utilsMetaResponse' + $ref: "#/components/schemas/utilsMetaResponse" required: - data - meta @@ -3419,7 +3492,7 @@ components: type: string enum: - trace-create - - $ref: '#/components/schemas/TraceEvent' + - $ref: "#/components/schemas/TraceEvent" required: - type - type: object @@ -3430,7 +3503,7 @@ components: type: string enum: - score-create - - $ref: '#/components/schemas/ScoreEvent' + - $ref: "#/components/schemas/ScoreEvent" required: - type - type: object @@ -3441,7 +3514,7 @@ components: type: string enum: - span-create - - $ref: '#/components/schemas/CreateSpanEvent' + - $ref: "#/components/schemas/CreateSpanEvent" required: - type - type: object @@ -3452,7 +3525,7 @@ components: type: string enum: - span-update - - $ref: '#/components/schemas/UpdateSpanEvent' + - $ref: "#/components/schemas/UpdateSpanEvent" required: - type - type: object @@ -3463,7 +3536,7 @@ components: type: string enum: - generation-create - - $ref: '#/components/schemas/CreateGenerationEvent' + - $ref: "#/components/schemas/CreateGenerationEvent" required: - type - type: object @@ -3474,7 +3547,7 @@ components: type: string enum: - generation-update - - $ref: '#/components/schemas/UpdateGenerationEvent' + - $ref: "#/components/schemas/UpdateGenerationEvent" required: - type - type: object @@ -3485,7 +3558,7 @@ components: type: string enum: - event-create - - $ref: '#/components/schemas/CreateEventEvent' + - $ref: "#/components/schemas/CreateEventEvent" required: - type - type: object @@ -3496,7 +3569,7 @@ components: type: string enum: - sdk-log - - $ref: '#/components/schemas/SDKLogEvent' + - $ref: "#/components/schemas/SDKLogEvent" required: - type - type: object @@ -3507,7 +3580,7 @@ components: type: string enum: - observation-create - - $ref: '#/components/schemas/CreateObservationEvent' + - $ref: "#/components/schemas/CreateObservationEvent" required: - type - type: object @@ -3518,7 +3591,7 @@ components: type: string enum: - observation-update - - $ref: '#/components/schemas/UpdateObservationEvent' + - $ref: "#/components/schemas/UpdateObservationEvent" required: - type ObservationType: @@ -3531,8 +3604,8 @@ components: IngestionUsage: title: IngestionUsage oneOf: - - $ref: '#/components/schemas/Usage' - - $ref: '#/components/schemas/OpenAIUsage' + - $ref: "#/components/schemas/Usage" + - $ref: "#/components/schemas/OpenAIUsage" OpenAIUsage: title: OpenAIUsage type: object @@ -3568,7 +3641,7 @@ components: output: nullable: true level: - $ref: '#/components/schemas/ObservationLevel' + $ref: "#/components/schemas/ObservationLevel" nullable: true statusMessage: type: string @@ -3587,7 +3660,7 @@ components: type: string nullable: true allOf: - - $ref: '#/components/schemas/OptionalObservationBody' + - $ref: "#/components/schemas/OptionalObservationBody" UpdateEventBody: title: UpdateEventBody type: object @@ -3597,7 +3670,7 @@ components: required: - id allOf: - - $ref: '#/components/schemas/OptionalObservationBody' + - $ref: "#/components/schemas/OptionalObservationBody" CreateSpanBody: title: CreateSpanBody type: object @@ -3607,7 +3680,7 @@ components: format: date-time nullable: true allOf: - - $ref: '#/components/schemas/CreateEventBody' + - $ref: "#/components/schemas/CreateEventBody" UpdateSpanBody: title: UpdateSpanBody type: object @@ -3617,7 +3690,7 @@ components: format: date-time nullable: true allOf: - - $ref: '#/components/schemas/UpdateEventBody' + - $ref: "#/components/schemas/UpdateEventBody" CreateGenerationBody: title: CreateGenerationBody type: object @@ -3632,13 +3705,13 @@ components: modelParameters: type: object additionalProperties: - $ref: '#/components/schemas/MapValue' + $ref: "#/components/schemas/MapValue" nullable: true usage: - $ref: '#/components/schemas/IngestionUsage' + $ref: "#/components/schemas/IngestionUsage" nullable: true usageDetails: - $ref: '#/components/schemas/UsageDetails' + $ref: "#/components/schemas/UsageDetails" nullable: true costDetails: type: object @@ -3653,7 +3726,7 @@ components: type: integer nullable: true allOf: - - $ref: '#/components/schemas/CreateSpanBody' + - $ref: "#/components/schemas/CreateSpanBody" UpdateGenerationBody: title: UpdateGenerationBody type: object @@ -3668,16 +3741,16 @@ components: modelParameters: type: object additionalProperties: - $ref: '#/components/schemas/MapValue' + $ref: "#/components/schemas/MapValue" nullable: true usage: - $ref: '#/components/schemas/IngestionUsage' + $ref: "#/components/schemas/IngestionUsage" nullable: true promptName: type: string nullable: true usageDetails: - $ref: '#/components/schemas/UsageDetails' + $ref: "#/components/schemas/UsageDetails" nullable: true costDetails: type: object @@ -3689,7 +3762,7 @@ components: type: integer nullable: true allOf: - - $ref: '#/components/schemas/UpdateSpanBody' + - $ref: "#/components/schemas/UpdateSpanBody" ObservationBody: title: ObservationBody type: object @@ -3701,7 +3774,7 @@ components: type: string nullable: true type: - $ref: '#/components/schemas/ObservationType' + $ref: "#/components/schemas/ObservationType" name: type: string nullable: true @@ -3723,7 +3796,7 @@ components: modelParameters: type: object additionalProperties: - $ref: '#/components/schemas/MapValue' + $ref: "#/components/schemas/MapValue" nullable: true input: nullable: true @@ -3735,10 +3808,10 @@ components: output: nullable: true usage: - $ref: '#/components/schemas/Usage' + $ref: "#/components/schemas/Usage" nullable: true level: - $ref: '#/components/schemas/ObservationLevel' + $ref: "#/components/schemas/ObservationLevel" nullable: true statusMessage: type: string @@ -3810,7 +3883,7 @@ components: type: string example: novelty value: - $ref: '#/components/schemas/CreateScoreValue' + $ref: "#/components/schemas/CreateScoreValue" description: >- The value of the score. Must be passed as string for categorical scores, and numeric for boolean and numeric scores. Boolean score @@ -3822,7 +3895,7 @@ components: type: string nullable: true dataType: - $ref: '#/components/schemas/ScoreDataType' + $ref: "#/components/schemas/ScoreDataType" nullable: true description: >- When set, must match the score value's type. If not set, will be @@ -3865,101 +3938,101 @@ components: type: object properties: body: - $ref: '#/components/schemas/TraceBody' + $ref: "#/components/schemas/TraceBody" required: - body allOf: - - $ref: '#/components/schemas/BaseEvent' + - $ref: "#/components/schemas/BaseEvent" CreateObservationEvent: title: CreateObservationEvent type: object properties: body: - $ref: '#/components/schemas/ObservationBody' + $ref: "#/components/schemas/ObservationBody" required: - body allOf: - - $ref: '#/components/schemas/BaseEvent' + - $ref: "#/components/schemas/BaseEvent" UpdateObservationEvent: title: UpdateObservationEvent type: object properties: body: - $ref: '#/components/schemas/ObservationBody' + $ref: "#/components/schemas/ObservationBody" required: - body allOf: - - $ref: '#/components/schemas/BaseEvent' + - $ref: "#/components/schemas/BaseEvent" ScoreEvent: title: ScoreEvent type: object properties: body: - $ref: '#/components/schemas/ScoreBody' + $ref: "#/components/schemas/ScoreBody" required: - body allOf: - - $ref: '#/components/schemas/BaseEvent' + - $ref: "#/components/schemas/BaseEvent" SDKLogEvent: title: SDKLogEvent type: object properties: body: - $ref: '#/components/schemas/SDKLogBody' + $ref: "#/components/schemas/SDKLogBody" required: - body allOf: - - $ref: '#/components/schemas/BaseEvent' + - $ref: "#/components/schemas/BaseEvent" CreateGenerationEvent: title: CreateGenerationEvent type: object properties: body: - $ref: '#/components/schemas/CreateGenerationBody' + $ref: "#/components/schemas/CreateGenerationBody" required: - body allOf: - - $ref: '#/components/schemas/BaseEvent' + - $ref: "#/components/schemas/BaseEvent" UpdateGenerationEvent: title: UpdateGenerationEvent type: object properties: body: - $ref: '#/components/schemas/UpdateGenerationBody' + $ref: "#/components/schemas/UpdateGenerationBody" required: - body allOf: - - $ref: '#/components/schemas/BaseEvent' + - $ref: "#/components/schemas/BaseEvent" CreateSpanEvent: title: CreateSpanEvent type: object properties: body: - $ref: '#/components/schemas/CreateSpanBody' + $ref: "#/components/schemas/CreateSpanBody" required: - body allOf: - - $ref: '#/components/schemas/BaseEvent' + - $ref: "#/components/schemas/BaseEvent" UpdateSpanEvent: title: UpdateSpanEvent type: object properties: body: - $ref: '#/components/schemas/UpdateSpanBody' + $ref: "#/components/schemas/UpdateSpanBody" required: - body allOf: - - $ref: '#/components/schemas/BaseEvent' + - $ref: "#/components/schemas/BaseEvent" CreateEventEvent: title: CreateEventEvent type: object properties: body: - $ref: '#/components/schemas/CreateEventBody' + $ref: "#/components/schemas/CreateEventBody" required: - body allOf: - - $ref: '#/components/schemas/BaseEvent' + - $ref: "#/components/schemas/BaseEvent" IngestionSuccess: title: IngestionSuccess type: object @@ -3994,11 +4067,11 @@ components: successes: type: array items: - $ref: '#/components/schemas/IngestionSuccess' + $ref: "#/components/schemas/IngestionSuccess" errors: type: array items: - $ref: '#/components/schemas/IngestionError' + $ref: "#/components/schemas/IngestionError" required: - successes - errors @@ -4032,7 +4105,7 @@ components: - type: object additionalProperties: type: integer - - $ref: '#/components/schemas/OpenAIUsageSchema' + - $ref: "#/components/schemas/OpenAIUsageSchema" GetMediaResponse: title: GetMediaResponse type: object @@ -4099,7 +4172,7 @@ components: The observation ID associated with the media record. If the media record is associated directly with a trace, this will be null. contentType: - $ref: '#/components/schemas/MediaContentType' + $ref: "#/components/schemas/MediaContentType" contentLength: type: integer description: The size of the media record in bytes @@ -4173,10 +4246,10 @@ components: data: type: array items: - $ref: '#/components/schemas/DailyMetricsDetails' + $ref: "#/components/schemas/DailyMetricsDetails" description: A list of daily metrics, only days with ingested data are included. meta: - $ref: '#/components/schemas/utilsMetaResponse' + $ref: "#/components/schemas/utilsMetaResponse" required: - data - meta @@ -4198,7 +4271,7 @@ components: usage: type: array items: - $ref: '#/components/schemas/UsageByModel' + $ref: "#/components/schemas/UsageByModel" required: - date - countTraces @@ -4246,9 +4319,9 @@ components: data: type: array items: - $ref: '#/components/schemas/Model' + $ref: "#/components/schemas/Model" meta: - $ref: '#/components/schemas/utilsMetaResponse' + $ref: "#/components/schemas/utilsMetaResponse" required: - data - meta @@ -4275,7 +4348,8 @@ components: nullable: true description: Apply only to generations which are newer than this ISO date. unit: - $ref: '#/components/schemas/ModelUsageUnit' + $ref: "#/components/schemas/ModelUsageUnit" + nullable: true description: Unit used by this model. inputPrice: type: number @@ -4308,7 +4382,6 @@ components: required: - modelName - matchPattern - - unit Observations: title: Observations type: object @@ -4316,9 +4389,9 @@ components: data: type: array items: - $ref: '#/components/schemas/Observation' + $ref: "#/components/schemas/Observation" meta: - $ref: '#/components/schemas/utilsMetaResponse' + $ref: "#/components/schemas/utilsMetaResponse" required: - data - meta @@ -4329,9 +4402,9 @@ components: data: type: array items: - $ref: '#/components/schemas/ObservationsView' + $ref: "#/components/schemas/ObservationsView" meta: - $ref: '#/components/schemas/utilsMetaResponse' + $ref: "#/components/schemas/utilsMetaResponse" required: - data - meta @@ -4342,7 +4415,7 @@ components: data: type: array items: - $ref: '#/components/schemas/Project' + $ref: "#/components/schemas/Project" required: - data Project: @@ -4363,9 +4436,9 @@ components: data: type: array items: - $ref: '#/components/schemas/PromptMeta' + $ref: "#/components/schemas/PromptMeta" meta: - $ref: '#/components/schemas/utilsMetaResponse' + $ref: "#/components/schemas/utilsMetaResponse" required: - data - meta @@ -4412,7 +4485,7 @@ components: type: string enum: - chat - - $ref: '#/components/schemas/CreateChatPromptRequest' + - $ref: "#/components/schemas/CreateChatPromptRequest" required: - type - type: object @@ -4423,7 +4496,7 @@ components: type: string enum: - text - - $ref: '#/components/schemas/CreateTextPromptRequest' + - $ref: "#/components/schemas/CreateTextPromptRequest" required: - type CreateChatPromptRequest: @@ -4435,7 +4508,7 @@ components: prompt: type: array items: - $ref: '#/components/schemas/ChatMessage' + $ref: "#/components/schemas/ChatMessage" config: nullable: true labels: @@ -4489,7 +4562,7 @@ components: type: string enum: - chat - - $ref: '#/components/schemas/ChatPrompt' + - $ref: "#/components/schemas/ChatPrompt" required: - type - type: object @@ -4500,7 +4573,7 @@ components: type: string enum: - text - - $ref: '#/components/schemas/TextPrompt' + - $ref: "#/components/schemas/TextPrompt" required: - type BasePrompt: @@ -4550,7 +4623,7 @@ components: required: - prompt allOf: - - $ref: '#/components/schemas/BasePrompt' + - $ref: "#/components/schemas/BasePrompt" ChatPrompt: title: ChatPrompt type: object @@ -4558,11 +4631,11 @@ components: prompt: type: array items: - $ref: '#/components/schemas/ChatMessage' + $ref: "#/components/schemas/ChatMessage" required: - prompt allOf: - - $ref: '#/components/schemas/BasePrompt' + - $ref: "#/components/schemas/BasePrompt" ScoreConfigs: title: ScoreConfigs type: object @@ -4570,9 +4643,9 @@ components: data: type: array items: - $ref: '#/components/schemas/ScoreConfig' + $ref: "#/components/schemas/ScoreConfig" meta: - $ref: '#/components/schemas/utilsMetaResponse' + $ref: "#/components/schemas/utilsMetaResponse" required: - data - meta @@ -4583,11 +4656,11 @@ components: name: type: string dataType: - $ref: '#/components/schemas/ScoreDataType' + $ref: "#/components/schemas/ScoreDataType" categories: type: array items: - $ref: '#/components/schemas/ConfigCategory' + $ref: "#/components/schemas/ConfigCategory" nullable: true description: >- Configure custom categories for categorical scores. Pass a list of @@ -4631,7 +4704,7 @@ components: type: string example: novelty value: - $ref: '#/components/schemas/CreateScoreValue' + $ref: "#/components/schemas/CreateScoreValue" description: >- The value of the score. Must be passed as string for categorical scores, and numeric for boolean and numeric scores. Boolean score @@ -4643,7 +4716,7 @@ components: type: string nullable: true dataType: - $ref: '#/components/schemas/ScoreDataType' + $ref: "#/components/schemas/ScoreDataType" nullable: true description: >- The data type of the score. When passing a configId this field is @@ -4688,31 +4761,31 @@ components: type: object properties: trace: - $ref: '#/components/schemas/GetScoresResponseTraceData' + $ref: "#/components/schemas/GetScoresResponseTraceData" required: - trace allOf: - - $ref: '#/components/schemas/NumericScore' + - $ref: "#/components/schemas/NumericScore" GetScoresResponseDataCategorical: title: GetScoresResponseDataCategorical type: object properties: trace: - $ref: '#/components/schemas/GetScoresResponseTraceData' + $ref: "#/components/schemas/GetScoresResponseTraceData" required: - trace allOf: - - $ref: '#/components/schemas/CategoricalScore' + - $ref: "#/components/schemas/CategoricalScore" GetScoresResponseDataBoolean: title: GetScoresResponseDataBoolean type: object properties: trace: - $ref: '#/components/schemas/GetScoresResponseTraceData' + $ref: "#/components/schemas/GetScoresResponseTraceData" required: - trace allOf: - - $ref: '#/components/schemas/BooleanScore' + - $ref: "#/components/schemas/BooleanScore" GetScoresResponseData: title: GetScoresResponseData oneOf: @@ -4724,7 +4797,7 @@ components: type: string enum: - NUMERIC - - $ref: '#/components/schemas/GetScoresResponseDataNumeric' + - $ref: "#/components/schemas/GetScoresResponseDataNumeric" required: - dataType - type: object @@ -4735,7 +4808,7 @@ components: type: string enum: - CATEGORICAL - - $ref: '#/components/schemas/GetScoresResponseDataCategorical' + - $ref: "#/components/schemas/GetScoresResponseDataCategorical" required: - dataType - type: object @@ -4746,7 +4819,7 @@ components: type: string enum: - BOOLEAN - - $ref: '#/components/schemas/GetScoresResponseDataBoolean' + - $ref: "#/components/schemas/GetScoresResponseDataBoolean" required: - dataType GetScoresResponse: @@ -4756,9 +4829,9 @@ components: data: type: array items: - $ref: '#/components/schemas/GetScoresResponseData' + $ref: "#/components/schemas/GetScoresResponseData" meta: - $ref: '#/components/schemas/utilsMetaResponse' + $ref: "#/components/schemas/utilsMetaResponse" required: - data - meta @@ -4769,9 +4842,9 @@ components: data: type: array items: - $ref: '#/components/schemas/Session' + $ref: "#/components/schemas/Session" meta: - $ref: '#/components/schemas/utilsMetaResponse' + $ref: "#/components/schemas/utilsMetaResponse" required: - data - meta @@ -4782,9 +4855,9 @@ components: data: type: array items: - $ref: '#/components/schemas/TraceWithDetails' + $ref: "#/components/schemas/TraceWithDetails" meta: - $ref: '#/components/schemas/utilsMetaResponse' + $ref: "#/components/schemas/utilsMetaResponse" required: - data - meta diff --git a/langfuse-core/src/index.ts b/langfuse-core/src/index.ts index 53a7dea0..eed116e1 100644 --- a/langfuse-core/src/index.ts +++ b/langfuse-core/src/index.ts @@ -56,6 +56,7 @@ import { type UpdateLangfuseGenerationBody, type UpdateLangfuseSpanBody, type GetMediaResponse, + UpdatePromptBody, } from "./types"; import { LangfuseMedia, type LangfuseMediaResolveMediaReferencesParams } from "./media/LangfuseMedia"; import { @@ -527,6 +528,15 @@ abstract class LangfuseCoreStateless { ); } + async updatePromptStateless( + body: UpdatePromptBody & { name: string; version: number } + ): Promise { + return this.fetchAndLogErrors( + `${this.baseUrl}/api/public/v2/prompts/${encodeURIComponent(body.name)}/versions/${encodeURIComponent(body.version)}`, + this._getFetchOptions({ method: "PUT", body: JSON.stringify(body) }) + ); + } + async getPromptStateless( name: string, version?: number, @@ -1382,6 +1392,12 @@ export abstract class LangfuseCore extends LangfuseCoreStateless { return new TextPromptClient(promptResponse); } + async updatePrompt(body: { name: string; version: number; newLabels: string[] }): Promise { + const newPrompt = await this.updatePromptStateless(body); + this._promptCache.invalidate(body.name); + return newPrompt; + } + async getPrompt( name: string, version?: number, diff --git a/langfuse-core/src/openapi/server.ts b/langfuse-core/src/openapi/server.ts index 2fbc6996..78cb8737 100644 --- a/langfuse-core/src/openapi/server.ts +++ b/langfuse-core/src/openapi/server.ts @@ -190,6 +190,7 @@ export interface paths { * * Notes: * + * - Introduction to data model: https://langfuse.com/docs/tracing-data-model * - Batch sizes are limited to 3.5 MB in total. You need to adjust the number of events per batch accordingly. * - The API does not return a 4xx status code for input errors. Instead, it responds with a 207 status code, which includes a list of the encountered errors. */ post: operations["ingestion_batch"]; @@ -338,6 +339,23 @@ export interface paths { patch?: never; trace?: never; }; + "/api/public/v2/prompts/{promptName}/version/{version}": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + /** @description Update labels for a specific prompt version */ + patch: operations["promptVersion_update"]; + trace?: never; + }; "/api/public/v2/prompts/{promptName}": { parameters: { query?: never; @@ -949,12 +967,12 @@ export interface components { /** @description Regex pattern which matches this model definition to generation.model. Useful in case of fine-tuned models. If you want to exact match, use `(?i)^modelname$` */ matchPattern: string; /** - * Format: date + * Format: date-time * @description Apply only to generations which are newer than this ISO date. */ startDate?: string | null; /** @description Unit used by this model. */ - unit: components["schemas"]["ModelUsageUnit"]; + unit?: components["schemas"]["ModelUsageUnit"]; /** * Format: double * @description Price (USD) per input unit @@ -988,7 +1006,7 @@ export interface components { */ ObservationLevel: "DEBUG" | "DEFAULT" | "WARNING" | "ERROR"; /** MapValue */ - MapValue: (string | null) | (number | null) | (boolean | null) | (string[] | null) | undefined; + MapValue: (string | null) | (number | null) | (boolean | null) | (string[] | null); /** * CommentObjectType * @enum {string} @@ -1477,7 +1495,7 @@ export interface components { */ startDate?: string | null; /** @description Unit used by this model. */ - unit: components["schemas"]["ModelUsageUnit"]; + unit?: components["schemas"]["ModelUsageUnit"]; /** * Format: double * @description Price (USD) per input unit @@ -3317,6 +3335,77 @@ export interface operations { }; }; }; + promptVersion_update: { + parameters: { + query?: never; + header?: never; + path: { + /** @description The name of the prompt */ + promptName: string; + /** @description Version of the prompt to update */ + version: number; + }; + cookie?: never; + }; + requestBody: { + content: { + "application/json": { + /** @description New labels for the prompt version. Labels are unique across versions. The "latest" label is reserved and managed by Langfuse. */ + newLabels: string[]; + }; + }; + }; + responses: { + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Prompt"]; + }; + }; + 400: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": unknown; + }; + }; + 401: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": unknown; + }; + }; + 403: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": unknown; + }; + }; + 404: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": unknown; + }; + }; + 405: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": unknown; + }; + }; + }; + }; prompts_get: { parameters: { query?: { diff --git a/langfuse-core/src/prompts/promptCache.ts b/langfuse-core/src/prompts/promptCache.ts index 69cc2f37..729a40a7 100644 --- a/langfuse-core/src/prompts/promptCache.ts +++ b/langfuse-core/src/prompts/promptCache.ts @@ -50,4 +50,12 @@ export class LangfusePromptCache { public isRefreshing(key: string): boolean { return this._refreshingKeys.has(key); } + + public invalidate(promptName: string): void { + for (const key of this._cache.keys()) { + if (key.startsWith(promptName)) { + this._cache.delete(key); + } + } + } } diff --git a/langfuse-core/src/types.ts b/langfuse-core/src/types.ts index 9545145e..a56b3e34 100644 --- a/langfuse-core/src/types.ts +++ b/langfuse-core/src/types.ts @@ -161,6 +161,9 @@ export type GetLangfuseDatasetRunsResponse = FixTypes< export type CreateLangfusePromptBody = FixTypes< paths["/api/public/v2/prompts"]["post"]["requestBody"]["content"]["application/json"] >; +export type UpdatePromptBody = FixTypes< + paths["/api/public/v2/prompts/{promptName}/version/{version}"]["patch"]["requestBody"]["content"]["application/json"] +>; export type CreateLangfusePromptResponse = paths["/api/public/v2/prompts"]["post"]["responses"]["200"]["content"]["application/json"]; From 3a350969869b0af53dae4b448257a2a4bfbacf1d Mon Sep 17 00:00:00 2001 From: Max Deichmann Date: Mon, 20 Jan 2025 22:12:45 +0100 Subject: [PATCH 02/13] feat: update prompts and invalidate cache --- integration-test/langfuse-integration-node.spec.ts | 2 +- langfuse-core/src/index.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/integration-test/langfuse-integration-node.spec.ts b/integration-test/langfuse-integration-node.spec.ts index d65c0597..b649494d 100644 --- a/integration-test/langfuse-integration-node.spec.ts +++ b/integration-test/langfuse-integration-node.spec.ts @@ -433,7 +433,7 @@ describe("Langfuse Node.js", () => { }); }); - it("update a prompt", async () => { + it.only("update a prompt", async () => { const promptName = "test-prompt" + Math.random().toString(36); await langfuse.createPrompt({ name: promptName, diff --git a/langfuse-core/src/index.ts b/langfuse-core/src/index.ts index eed116e1..d1ddd6c0 100644 --- a/langfuse-core/src/index.ts +++ b/langfuse-core/src/index.ts @@ -533,7 +533,7 @@ abstract class LangfuseCoreStateless { ): Promise { return this.fetchAndLogErrors( `${this.baseUrl}/api/public/v2/prompts/${encodeURIComponent(body.name)}/versions/${encodeURIComponent(body.version)}`, - this._getFetchOptions({ method: "PUT", body: JSON.stringify(body) }) + this._getFetchOptions({ method: "PATCH", body: JSON.stringify(body) }) ); } From cd3fb2bbbd2516f479540707f53fd653ff3e49a4 Mon Sep 17 00:00:00 2001 From: Max Deichmann Date: Mon, 20 Jan 2025 22:19:09 +0100 Subject: [PATCH 03/13] feat: update prompts and invalidate cache --- langfuse-core/src/openapi/server.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/langfuse-core/src/openapi/server.ts b/langfuse-core/src/openapi/server.ts index 78cb8737..be5bb338 100644 --- a/langfuse-core/src/openapi/server.ts +++ b/langfuse-core/src/openapi/server.ts @@ -972,7 +972,7 @@ export interface components { */ startDate?: string | null; /** @description Unit used by this model. */ - unit?: components["schemas"]["ModelUsageUnit"]; + unit: components["schemas"]["ModelUsageUnit"]; /** * Format: double * @description Price (USD) per input unit @@ -1006,7 +1006,7 @@ export interface components { */ ObservationLevel: "DEBUG" | "DEFAULT" | "WARNING" | "ERROR"; /** MapValue */ - MapValue: (string | null) | (number | null) | (boolean | null) | (string[] | null); + MapValue: (string | null) | (number | null) | (boolean | null) | (string[] | null) | undefined; /** * CommentObjectType * @enum {string} @@ -1495,7 +1495,7 @@ export interface components { */ startDate?: string | null; /** @description Unit used by this model. */ - unit?: components["schemas"]["ModelUsageUnit"]; + unit: components["schemas"]["ModelUsageUnit"]; /** * Format: double * @description Price (USD) per input unit From e03ee358b287d09ec297e6127dde1f0a50d00c4b Mon Sep 17 00:00:00 2001 From: Max Deichmann Date: Mon, 20 Jan 2025 22:20:08 +0100 Subject: [PATCH 04/13] feat: update prompts and invalidate cache --- langfuse-core/src/openapi/server.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/langfuse-core/src/openapi/server.ts b/langfuse-core/src/openapi/server.ts index be5bb338..78cb8737 100644 --- a/langfuse-core/src/openapi/server.ts +++ b/langfuse-core/src/openapi/server.ts @@ -972,7 +972,7 @@ export interface components { */ startDate?: string | null; /** @description Unit used by this model. */ - unit: components["schemas"]["ModelUsageUnit"]; + unit?: components["schemas"]["ModelUsageUnit"]; /** * Format: double * @description Price (USD) per input unit @@ -1006,7 +1006,7 @@ export interface components { */ ObservationLevel: "DEBUG" | "DEFAULT" | "WARNING" | "ERROR"; /** MapValue */ - MapValue: (string | null) | (number | null) | (boolean | null) | (string[] | null) | undefined; + MapValue: (string | null) | (number | null) | (boolean | null) | (string[] | null); /** * CommentObjectType * @enum {string} @@ -1495,7 +1495,7 @@ export interface components { */ startDate?: string | null; /** @description Unit used by this model. */ - unit: components["schemas"]["ModelUsageUnit"]; + unit?: components["schemas"]["ModelUsageUnit"]; /** * Format: double * @description Price (USD) per input unit From 3faa622e101431893fbc084b8d6917259342c716 Mon Sep 17 00:00:00 2001 From: Max Deichmann Date: Mon, 20 Jan 2025 22:21:16 +0100 Subject: [PATCH 05/13] feat: update prompts and invalidate cache --- langfuse-core/src/openapi/server.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/langfuse-core/src/openapi/server.ts b/langfuse-core/src/openapi/server.ts index 78cb8737..be5bb338 100644 --- a/langfuse-core/src/openapi/server.ts +++ b/langfuse-core/src/openapi/server.ts @@ -972,7 +972,7 @@ export interface components { */ startDate?: string | null; /** @description Unit used by this model. */ - unit?: components["schemas"]["ModelUsageUnit"]; + unit: components["schemas"]["ModelUsageUnit"]; /** * Format: double * @description Price (USD) per input unit @@ -1006,7 +1006,7 @@ export interface components { */ ObservationLevel: "DEBUG" | "DEFAULT" | "WARNING" | "ERROR"; /** MapValue */ - MapValue: (string | null) | (number | null) | (boolean | null) | (string[] | null); + MapValue: (string | null) | (number | null) | (boolean | null) | (string[] | null) | undefined; /** * CommentObjectType * @enum {string} @@ -1495,7 +1495,7 @@ export interface components { */ startDate?: string | null; /** @description Unit used by this model. */ - unit?: components["schemas"]["ModelUsageUnit"]; + unit: components["schemas"]["ModelUsageUnit"]; /** * Format: double * @description Price (USD) per input unit From 5622d7ca524b4ed2bc7c1cc36e09e5b63faa3359 Mon Sep 17 00:00:00 2001 From: Max Deichmann Date: Mon, 20 Jan 2025 22:24:55 +0100 Subject: [PATCH 06/13] feat: update prompts and invalidate cache --- langfuse-core/openapi-spec/openapi-server.yaml | 3 --- langfuse-core/src/openapi/server.ts | 6 +++--- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/langfuse-core/openapi-spec/openapi-server.yaml b/langfuse-core/openapi-spec/openapi-server.yaml index fbbf2e80..8492bf7c 100644 --- a/langfuse-core/openapi-spec/openapi-server.yaml +++ b/langfuse-core/openapi-spec/openapi-server.yaml @@ -2827,7 +2827,6 @@ components: description: Defaults to input+output if not set unit: $ref: "#/components/schemas/ModelUsageUnit" - nullable: true inputCost: type: number format: double @@ -3261,7 +3260,6 @@ components: description: Apply only to generations which are newer than this ISO date. unit: $ref: "#/components/schemas/ModelUsageUnit" - nullable: true description: Unit used by this model. inputPrice: type: number @@ -4349,7 +4347,6 @@ components: description: Apply only to generations which are newer than this ISO date. unit: $ref: "#/components/schemas/ModelUsageUnit" - nullable: true description: Unit used by this model. inputPrice: type: number diff --git a/langfuse-core/src/openapi/server.ts b/langfuse-core/src/openapi/server.ts index be5bb338..78cb8737 100644 --- a/langfuse-core/src/openapi/server.ts +++ b/langfuse-core/src/openapi/server.ts @@ -972,7 +972,7 @@ export interface components { */ startDate?: string | null; /** @description Unit used by this model. */ - unit: components["schemas"]["ModelUsageUnit"]; + unit?: components["schemas"]["ModelUsageUnit"]; /** * Format: double * @description Price (USD) per input unit @@ -1006,7 +1006,7 @@ export interface components { */ ObservationLevel: "DEBUG" | "DEFAULT" | "WARNING" | "ERROR"; /** MapValue */ - MapValue: (string | null) | (number | null) | (boolean | null) | (string[] | null) | undefined; + MapValue: (string | null) | (number | null) | (boolean | null) | (string[] | null); /** * CommentObjectType * @enum {string} @@ -1495,7 +1495,7 @@ export interface components { */ startDate?: string | null; /** @description Unit used by this model. */ - unit: components["schemas"]["ModelUsageUnit"]; + unit?: components["schemas"]["ModelUsageUnit"]; /** * Format: double * @description Price (USD) per input unit From 509d54767bbb3aafefb5737b6f2865fb0c05957b Mon Sep 17 00:00:00 2001 From: Max Deichmann Date: Mon, 20 Jan 2025 22:26:58 +0100 Subject: [PATCH 07/13] feat: update prompts and invalidate cache --- langfuse-core/openapi-spec/openapi-server.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/langfuse-core/openapi-spec/openapi-server.yaml b/langfuse-core/openapi-spec/openapi-server.yaml index 8492bf7c..b9816d49 100644 --- a/langfuse-core/openapi-spec/openapi-server.yaml +++ b/langfuse-core/openapi-spec/openapi-server.yaml @@ -1492,7 +1492,7 @@ paths: type: string description: >- New labels for the prompt version. Labels are unique across - versions. The "latest" label is reserved and managed by + versions. The 'latest' label is reserved and managed by Langfuse. required: - newLabels @@ -1519,7 +1519,7 @@ paths: - name: label in: query description: >- - Label of the prompt to be retrieved. Defaults to "production" if no + Label of the prompt to be retrieved. Defaults to 'production' if no label or version is set. required: false schema: @@ -2978,13 +2978,13 @@ components: type: number format: double description: >- - The numeric value of the score. Equals 1 for "True" and 0 for - "False" + The numeric value of the score. Equals 1 for 'True' and 0 for + 'False' stringValue: type: string description: >- The string representation of the score value. Is inferred from the - numeric value and equals "True" or "False" + numeric value and equals 'True' or 'False' required: - value - stringValue From 512a35e04230d97971a9955a75b4ce651f6b1944 Mon Sep 17 00:00:00 2001 From: Max Deichmann Date: Mon, 20 Jan 2025 22:28:12 +0100 Subject: [PATCH 08/13] feat: update prompts and invalidate cache --- .../openapi-spec/openapi-server.yaml | 1328 ++++++++--------- 1 file changed, 664 insertions(+), 664 deletions(-) diff --git a/langfuse-core/openapi-spec/openapi-server.yaml b/langfuse-core/openapi-spec/openapi-server.yaml index b9816d49..43f31947 100644 --- a/langfuse-core/openapi-spec/openapi-server.yaml +++ b/langfuse-core/openapi-spec/openapi-server.yaml @@ -1,7 +1,7 @@ openapi: 3.0.1 info: title: langfuse - version: "" + version: '' description: >- ## Authentication @@ -34,34 +34,34 @@ paths: - Comments parameters: [] responses: - "200": - description: "" + '200': + description: '' content: application/json: schema: - $ref: "#/components/schemas/CreateCommentResponse" - "400": - description: "" + $ref: '#/components/schemas/CreateCommentResponse' + '400': + description: '' content: application/json: schema: {} - "401": - description: "" + '401': + description: '' content: application/json: schema: {} - "403": - description: "" + '403': + description: '' content: application/json: schema: {} - "404": - description: "" + '404': + description: '' content: application/json: schema: {} - "405": - description: "" + '405': + description: '' content: application/json: schema: {} @@ -72,7 +72,7 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/CreateCommentRequest" + $ref: '#/components/schemas/CreateCommentRequest' get: description: Get all comments operationId: comments_get @@ -121,34 +121,34 @@ paths: type: string nullable: true responses: - "200": - description: "" + '200': + description: '' content: application/json: schema: - $ref: "#/components/schemas/GetCommentsResponse" - "400": - description: "" + $ref: '#/components/schemas/GetCommentsResponse' + '400': + description: '' content: application/json: schema: {} - "401": - description: "" + '401': + description: '' content: application/json: schema: {} - "403": - description: "" + '403': + description: '' content: application/json: schema: {} - "404": - description: "" + '404': + description: '' content: application/json: schema: {} - "405": - description: "" + '405': + description: '' content: application/json: schema: {} @@ -168,34 +168,34 @@ paths: schema: type: string responses: - "200": - description: "" + '200': + description: '' content: application/json: schema: - $ref: "#/components/schemas/Comment" - "400": - description: "" + $ref: '#/components/schemas/Comment' + '400': + description: '' content: application/json: schema: {} - "401": - description: "" + '401': + description: '' content: application/json: schema: {} - "403": - description: "" + '403': + description: '' content: application/json: schema: {} - "404": - description: "" + '404': + description: '' content: application/json: schema: {} - "405": - description: "" + '405': + description: '' content: application/json: schema: {} @@ -209,34 +209,34 @@ paths: - DatasetItems parameters: [] responses: - "200": - description: "" + '200': + description: '' content: application/json: schema: - $ref: "#/components/schemas/DatasetItem" - "400": - description: "" + $ref: '#/components/schemas/DatasetItem' + '400': + description: '' content: application/json: schema: {} - "401": - description: "" + '401': + description: '' content: application/json: schema: {} - "403": - description: "" + '403': + description: '' content: application/json: schema: {} - "404": - description: "" + '404': + description: '' content: application/json: schema: {} - "405": - description: "" + '405': + description: '' content: application/json: schema: {} @@ -247,7 +247,7 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/CreateDatasetItemRequest" + $ref: '#/components/schemas/CreateDatasetItemRequest' get: description: Get dataset items operationId: datasetItems_list @@ -287,34 +287,34 @@ paths: type: integer nullable: true responses: - "200": - description: "" + '200': + description: '' content: application/json: schema: - $ref: "#/components/schemas/PaginatedDatasetItems" - "400": - description: "" + $ref: '#/components/schemas/PaginatedDatasetItems' + '400': + description: '' content: application/json: schema: {} - "401": - description: "" + '401': + description: '' content: application/json: schema: {} - "403": - description: "" + '403': + description: '' content: application/json: schema: {} - "404": - description: "" + '404': + description: '' content: application/json: schema: {} - "405": - description: "" + '405': + description: '' content: application/json: schema: {} @@ -333,34 +333,34 @@ paths: schema: type: string responses: - "200": - description: "" + '200': + description: '' content: application/json: schema: - $ref: "#/components/schemas/DatasetItem" - "400": - description: "" + $ref: '#/components/schemas/DatasetItem' + '400': + description: '' content: application/json: schema: {} - "401": - description: "" + '401': + description: '' content: application/json: schema: {} - "403": - description: "" + '403': + description: '' content: application/json: schema: {} - "404": - description: "" + '404': + description: '' content: application/json: schema: {} - "405": - description: "" + '405': + description: '' content: application/json: schema: {} @@ -374,34 +374,34 @@ paths: - DatasetRunItems parameters: [] responses: - "200": - description: "" + '200': + description: '' content: application/json: schema: - $ref: "#/components/schemas/DatasetRunItem" - "400": - description: "" + $ref: '#/components/schemas/DatasetRunItem' + '400': + description: '' content: application/json: schema: {} - "401": - description: "" + '401': + description: '' content: application/json: schema: {} - "403": - description: "" + '403': + description: '' content: application/json: schema: {} - "404": - description: "" + '404': + description: '' content: application/json: schema: {} - "405": - description: "" + '405': + description: '' content: application/json: schema: {} @@ -412,7 +412,7 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/CreateDatasetRunItemRequest" + $ref: '#/components/schemas/CreateDatasetRunItemRequest' /api/public/v2/datasets: get: description: Get all datasets @@ -435,34 +435,34 @@ paths: type: integer nullable: true responses: - "200": - description: "" + '200': + description: '' content: application/json: schema: - $ref: "#/components/schemas/PaginatedDatasets" - "400": - description: "" + $ref: '#/components/schemas/PaginatedDatasets' + '400': + description: '' content: application/json: schema: {} - "401": - description: "" + '401': + description: '' content: application/json: schema: {} - "403": - description: "" + '403': + description: '' content: application/json: schema: {} - "404": - description: "" + '404': + description: '' content: application/json: schema: {} - "405": - description: "" + '405': + description: '' content: application/json: schema: {} @@ -475,34 +475,34 @@ paths: - Datasets parameters: [] responses: - "200": - description: "" + '200': + description: '' content: application/json: schema: - $ref: "#/components/schemas/Dataset" - "400": - description: "" + $ref: '#/components/schemas/Dataset' + '400': + description: '' content: application/json: schema: {} - "401": - description: "" + '401': + description: '' content: application/json: schema: {} - "403": - description: "" + '403': + description: '' content: application/json: schema: {} - "404": - description: "" + '404': + description: '' content: application/json: schema: {} - "405": - description: "" + '405': + description: '' content: application/json: schema: {} @@ -513,7 +513,7 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/CreateDatasetRequest" + $ref: '#/components/schemas/CreateDatasetRequest' /api/public/v2/datasets/{datasetName}: get: description: Get a dataset @@ -527,34 +527,34 @@ paths: schema: type: string responses: - "200": - description: "" + '200': + description: '' content: application/json: schema: - $ref: "#/components/schemas/Dataset" - "400": - description: "" + $ref: '#/components/schemas/Dataset' + '400': + description: '' content: application/json: schema: {} - "401": - description: "" + '401': + description: '' content: application/json: schema: {} - "403": - description: "" + '403': + description: '' content: application/json: schema: {} - "404": - description: "" + '404': + description: '' content: application/json: schema: {} - "405": - description: "" + '405': + description: '' content: application/json: schema: {} @@ -578,34 +578,34 @@ paths: schema: type: string responses: - "200": - description: "" + '200': + description: '' content: application/json: schema: - $ref: "#/components/schemas/DatasetRunWithItems" - "400": - description: "" + $ref: '#/components/schemas/DatasetRunWithItems' + '400': + description: '' content: application/json: schema: {} - "401": - description: "" + '401': + description: '' content: application/json: schema: {} - "403": - description: "" + '403': + description: '' content: application/json: schema: {} - "404": - description: "" + '404': + description: '' content: application/json: schema: {} - "405": - description: "" + '405': + description: '' content: application/json: schema: {} @@ -638,34 +638,34 @@ paths: type: integer nullable: true responses: - "200": - description: "" + '200': + description: '' content: application/json: schema: - $ref: "#/components/schemas/PaginatedDatasetRuns" - "400": - description: "" + $ref: '#/components/schemas/PaginatedDatasetRuns' + '400': + description: '' content: application/json: schema: {} - "401": - description: "" + '401': + description: '' content: application/json: schema: {} - "403": - description: "" + '403': + description: '' content: application/json: schema: {} - "404": - description: "" + '404': + description: '' content: application/json: schema: {} - "405": - description: "" + '405': + description: '' content: application/json: schema: {} @@ -679,39 +679,39 @@ paths: - Health parameters: [] responses: - "200": - description: "" + '200': + description: '' content: application/json: schema: - $ref: "#/components/schemas/HealthResponse" - "400": - description: "" + $ref: '#/components/schemas/HealthResponse' + '400': + description: '' content: application/json: schema: {} - "401": - description: "" + '401': + description: '' content: application/json: schema: {} - "403": - description: "" + '403': + description: '' content: application/json: schema: {} - "404": - description: "" + '404': + description: '' content: application/json: schema: {} - "405": - description: "" + '405': + description: '' content: application/json: schema: {} - "503": - description: "" + '503': + description: '' /api/public/ingestion: post: description: >- @@ -737,34 +737,34 @@ paths: - Ingestion parameters: [] responses: - "200": - description: "" + '200': + description: '' content: application/json: schema: - $ref: "#/components/schemas/IngestionResponse" - "400": - description: "" + $ref: '#/components/schemas/IngestionResponse' + '400': + description: '' content: application/json: schema: {} - "401": - description: "" + '401': + description: '' content: application/json: schema: {} - "403": - description: "" + '403': + description: '' content: application/json: schema: {} - "404": - description: "" + '404': + description: '' content: application/json: schema: {} - "405": - description: "" + '405': + description: '' content: application/json: schema: {} @@ -780,7 +780,7 @@ paths: batch: type: array items: - $ref: "#/components/schemas/IngestionEvent" + $ref: '#/components/schemas/IngestionEvent' description: >- Batch of tracing events to be ingested. Discriminated by attribute `type`. @@ -805,34 +805,34 @@ paths: schema: type: string responses: - "200": - description: "" + '200': + description: '' content: application/json: schema: - $ref: "#/components/schemas/GetMediaResponse" - "400": - description: "" + $ref: '#/components/schemas/GetMediaResponse' + '400': + description: '' content: application/json: schema: {} - "401": - description: "" + '401': + description: '' content: application/json: schema: {} - "403": - description: "" + '403': + description: '' content: application/json: schema: {} - "404": - description: "" + '404': + description: '' content: application/json: schema: {} - "405": - description: "" + '405': + description: '' content: application/json: schema: {} @@ -851,30 +851,30 @@ paths: schema: type: string responses: - "204": - description: "" - "400": - description: "" + '204': + description: '' + '400': + description: '' content: application/json: schema: {} - "401": - description: "" + '401': + description: '' content: application/json: schema: {} - "403": - description: "" + '403': + description: '' content: application/json: schema: {} - "404": - description: "" + '404': + description: '' content: application/json: schema: {} - "405": - description: "" + '405': + description: '' content: application/json: schema: {} @@ -885,7 +885,7 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/PatchMediaBody" + $ref: '#/components/schemas/PatchMediaBody' /api/public/media: post: description: Get a presigned upload URL for a media record @@ -894,34 +894,34 @@ paths: - Media parameters: [] responses: - "200": - description: "" + '200': + description: '' content: application/json: schema: - $ref: "#/components/schemas/GetMediaUploadUrlResponse" - "400": - description: "" + $ref: '#/components/schemas/GetMediaUploadUrlResponse' + '400': + description: '' content: application/json: schema: {} - "401": - description: "" + '401': + description: '' content: application/json: schema: {} - "403": - description: "" + '403': + description: '' content: application/json: schema: {} - "404": - description: "" + '404': + description: '' content: application/json: schema: {} - "405": - description: "" + '405': + description: '' content: application/json: schema: {} @@ -932,7 +932,7 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/GetMediaUploadUrlRequest" + $ref: '#/components/schemas/GetMediaUploadUrlRequest' /api/public/metrics/daily: get: description: Get daily metrics of the Langfuse project @@ -998,34 +998,34 @@ paths: format: date-time nullable: true responses: - "200": - description: "" + '200': + description: '' content: application/json: schema: - $ref: "#/components/schemas/DailyMetrics" - "400": - description: "" + $ref: '#/components/schemas/DailyMetrics' + '400': + description: '' content: application/json: schema: {} - "401": - description: "" + '401': + description: '' content: application/json: schema: {} - "403": - description: "" + '403': + description: '' content: application/json: schema: {} - "404": - description: "" + '404': + description: '' content: application/json: schema: {} - "405": - description: "" + '405': + description: '' content: application/json: schema: {} @@ -1039,34 +1039,34 @@ paths: - Models parameters: [] responses: - "200": - description: "" + '200': + description: '' content: application/json: schema: - $ref: "#/components/schemas/Model" - "400": - description: "" + $ref: '#/components/schemas/Model' + '400': + description: '' content: application/json: schema: {} - "401": - description: "" + '401': + description: '' content: application/json: schema: {} - "403": - description: "" + '403': + description: '' content: application/json: schema: {} - "404": - description: "" + '404': + description: '' content: application/json: schema: {} - "405": - description: "" + '405': + description: '' content: application/json: schema: {} @@ -1077,7 +1077,7 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/CreateModelRequest" + $ref: '#/components/schemas/CreateModelRequest' get: description: Get all models operationId: models_list @@ -1099,34 +1099,34 @@ paths: type: integer nullable: true responses: - "200": - description: "" + '200': + description: '' content: application/json: schema: - $ref: "#/components/schemas/PaginatedModels" - "400": - description: "" + $ref: '#/components/schemas/PaginatedModels' + '400': + description: '' content: application/json: schema: {} - "401": - description: "" + '401': + description: '' content: application/json: schema: {} - "403": - description: "" + '403': + description: '' content: application/json: schema: {} - "404": - description: "" + '404': + description: '' content: application/json: schema: {} - "405": - description: "" + '405': + description: '' content: application/json: schema: {} @@ -1145,34 +1145,34 @@ paths: schema: type: string responses: - "200": - description: "" + '200': + description: '' content: application/json: schema: - $ref: "#/components/schemas/Model" - "400": - description: "" + $ref: '#/components/schemas/Model' + '400': + description: '' content: application/json: schema: {} - "401": - description: "" + '401': + description: '' content: application/json: schema: {} - "403": - description: "" + '403': + description: '' content: application/json: schema: {} - "404": - description: "" + '404': + description: '' content: application/json: schema: {} - "405": - description: "" + '405': + description: '' content: application/json: schema: {} @@ -1193,30 +1193,30 @@ paths: schema: type: string responses: - "204": - description: "" - "400": - description: "" + '204': + description: '' + '400': + description: '' content: application/json: schema: {} - "401": - description: "" + '401': + description: '' content: application/json: schema: {} - "403": - description: "" + '403': + description: '' content: application/json: schema: {} - "404": - description: "" + '404': + description: '' content: application/json: schema: {} - "405": - description: "" + '405': + description: '' content: application/json: schema: {} @@ -1238,34 +1238,34 @@ paths: schema: type: string responses: - "200": - description: "" + '200': + description: '' content: application/json: schema: - $ref: "#/components/schemas/ObservationsView" - "400": - description: "" + $ref: '#/components/schemas/ObservationsView' + '400': + description: '' content: application/json: schema: {} - "401": - description: "" + '401': + description: '' content: application/json: schema: {} - "403": - description: "" + '403': + description: '' content: application/json: schema: {} - "404": - description: "" + '404': + description: '' content: application/json: schema: {} - "405": - description: "" + '405': + description: '' content: application/json: schema: {} @@ -1352,34 +1352,34 @@ paths: type: string nullable: true responses: - "200": - description: "" + '200': + description: '' content: application/json: schema: - $ref: "#/components/schemas/ObservationsViews" - "400": - description: "" + $ref: '#/components/schemas/ObservationsViews' + '400': + description: '' content: application/json: schema: {} - "401": - description: "" + '401': + description: '' content: application/json: schema: {} - "403": - description: "" + '403': + description: '' content: application/json: schema: {} - "404": - description: "" + '404': + description: '' content: application/json: schema: {} - "405": - description: "" + '405': + description: '' content: application/json: schema: {} @@ -1393,34 +1393,34 @@ paths: - Projects parameters: [] responses: - "200": - description: "" + '200': + description: '' content: application/json: schema: - $ref: "#/components/schemas/Projects" - "400": - description: "" + $ref: '#/components/schemas/Projects' + '400': + description: '' content: application/json: schema: {} - "401": - description: "" + '401': + description: '' content: application/json: schema: {} - "403": - description: "" + '403': + description: '' content: application/json: schema: {} - "404": - description: "" + '404': + description: '' content: application/json: schema: {} - "405": - description: "" + '405': + description: '' content: application/json: schema: {} @@ -1446,34 +1446,34 @@ paths: schema: type: integer responses: - "200": - description: "" + '200': + description: '' content: application/json: schema: - $ref: "#/components/schemas/Prompt" - "400": - description: "" + $ref: '#/components/schemas/Prompt' + '400': + description: '' content: application/json: schema: {} - "401": - description: "" + '401': + description: '' content: application/json: schema: {} - "403": - description: "" + '403': + description: '' content: application/json: schema: {} - "404": - description: "" + '404': + description: '' content: application/json: schema: {} - "405": - description: "" + '405': + description: '' content: application/json: schema: {} @@ -1526,34 +1526,34 @@ paths: type: string nullable: true responses: - "200": - description: "" + '200': + description: '' content: application/json: schema: - $ref: "#/components/schemas/Prompt" - "400": - description: "" + $ref: '#/components/schemas/Prompt' + '400': + description: '' content: application/json: schema: {} - "401": - description: "" + '401': + description: '' content: application/json: schema: {} - "403": - description: "" + '403': + description: '' content: application/json: schema: {} - "404": - description: "" + '404': + description: '' content: application/json: schema: {} - "405": - description: "" + '405': + description: '' content: application/json: schema: {} @@ -1619,34 +1619,34 @@ paths: format: date-time nullable: true responses: - "200": - description: "" + '200': + description: '' content: application/json: schema: - $ref: "#/components/schemas/PromptMetaListResponse" - "400": - description: "" + $ref: '#/components/schemas/PromptMetaListResponse' + '400': + description: '' content: application/json: schema: {} - "401": - description: "" + '401': + description: '' content: application/json: schema: {} - "403": - description: "" + '403': + description: '' content: application/json: schema: {} - "404": - description: "" + '404': + description: '' content: application/json: schema: {} - "405": - description: "" + '405': + description: '' content: application/json: schema: {} @@ -1659,34 +1659,34 @@ paths: - Prompts parameters: [] responses: - "200": - description: "" + '200': + description: '' content: application/json: schema: - $ref: "#/components/schemas/Prompt" - "400": - description: "" + $ref: '#/components/schemas/Prompt' + '400': + description: '' content: application/json: schema: {} - "401": - description: "" + '401': + description: '' content: application/json: schema: {} - "403": - description: "" + '403': + description: '' content: application/json: schema: {} - "404": - description: "" + '404': + description: '' content: application/json: schema: {} - "405": - description: "" + '405': + description: '' content: application/json: schema: {} @@ -1697,7 +1697,7 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/CreatePromptRequest" + $ref: '#/components/schemas/CreatePromptRequest' /api/public/score-configs: post: description: >- @@ -1708,34 +1708,34 @@ paths: - ScoreConfigs parameters: [] responses: - "200": - description: "" + '200': + description: '' content: application/json: schema: - $ref: "#/components/schemas/ScoreConfig" - "400": - description: "" + $ref: '#/components/schemas/ScoreConfig' + '400': + description: '' content: application/json: schema: {} - "401": - description: "" + '401': + description: '' content: application/json: schema: {} - "403": - description: "" + '403': + description: '' content: application/json: schema: {} - "404": - description: "" + '404': + description: '' content: application/json: schema: {} - "405": - description: "" + '405': + description: '' content: application/json: schema: {} @@ -1746,7 +1746,7 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/CreateScoreConfigRequest" + $ref: '#/components/schemas/CreateScoreConfigRequest' get: description: Get all score configs operationId: scoreConfigs_get @@ -1770,34 +1770,34 @@ paths: type: integer nullable: true responses: - "200": - description: "" + '200': + description: '' content: application/json: schema: - $ref: "#/components/schemas/ScoreConfigs" - "400": - description: "" + $ref: '#/components/schemas/ScoreConfigs' + '400': + description: '' content: application/json: schema: {} - "401": - description: "" + '401': + description: '' content: application/json: schema: {} - "403": - description: "" + '403': + description: '' content: application/json: schema: {} - "404": - description: "" + '404': + description: '' content: application/json: schema: {} - "405": - description: "" + '405': + description: '' content: application/json: schema: {} @@ -1817,34 +1817,34 @@ paths: schema: type: string responses: - "200": - description: "" + '200': + description: '' content: application/json: schema: - $ref: "#/components/schemas/ScoreConfig" - "400": - description: "" + $ref: '#/components/schemas/ScoreConfig' + '400': + description: '' content: application/json: schema: {} - "401": - description: "" + '401': + description: '' content: application/json: schema: {} - "403": - description: "" + '403': + description: '' content: application/json: schema: {} - "404": - description: "" + '404': + description: '' content: application/json: schema: {} - "405": - description: "" + '405': + description: '' content: application/json: schema: {} @@ -1858,34 +1858,34 @@ paths: - Score parameters: [] responses: - "200": - description: "" + '200': + description: '' content: application/json: schema: - $ref: "#/components/schemas/CreateScoreResponse" - "400": - description: "" + $ref: '#/components/schemas/CreateScoreResponse' + '400': + description: '' content: application/json: schema: {} - "401": - description: "" + '401': + description: '' content: application/json: schema: {} - "403": - description: "" + '403': + description: '' content: application/json: schema: {} - "404": - description: "" + '404': + description: '' content: application/json: schema: {} - "405": - description: "" + '405': + description: '' content: application/json: schema: {} @@ -1896,7 +1896,7 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/CreateScoreRequest" + $ref: '#/components/schemas/CreateScoreRequest' get: description: Get a list of scores operationId: score_get @@ -1958,7 +1958,7 @@ paths: description: Retrieve only scores from a specific source. required: false schema: - $ref: "#/components/schemas/ScoreSource" + $ref: '#/components/schemas/ScoreSource' nullable: true - name: operator in: query @@ -2001,7 +2001,7 @@ paths: description: Retrieve only scores with a specific dataType. required: false schema: - $ref: "#/components/schemas/ScoreDataType" + $ref: '#/components/schemas/ScoreDataType' nullable: true - name: traceTags in: query @@ -2015,34 +2015,34 @@ paths: type: string nullable: true responses: - "200": - description: "" + '200': + description: '' content: application/json: schema: - $ref: "#/components/schemas/GetScoresResponse" - "400": - description: "" + $ref: '#/components/schemas/GetScoresResponse' + '400': + description: '' content: application/json: schema: {} - "401": - description: "" + '401': + description: '' content: application/json: schema: {} - "403": - description: "" + '403': + description: '' content: application/json: schema: {} - "404": - description: "" + '404': + description: '' content: application/json: schema: {} - "405": - description: "" + '405': + description: '' content: application/json: schema: {} @@ -2062,34 +2062,34 @@ paths: schema: type: string responses: - "200": - description: "" + '200': + description: '' content: application/json: schema: - $ref: "#/components/schemas/Score" - "400": - description: "" + $ref: '#/components/schemas/Score' + '400': + description: '' content: application/json: schema: {} - "401": - description: "" + '401': + description: '' content: application/json: schema: {} - "403": - description: "" + '403': + description: '' content: application/json: schema: {} - "404": - description: "" + '404': + description: '' content: application/json: schema: {} - "405": - description: "" + '405': + description: '' content: application/json: schema: {} @@ -2108,30 +2108,30 @@ paths: schema: type: string responses: - "204": - description: "" - "400": - description: "" + '204': + description: '' + '400': + description: '' content: application/json: schema: {} - "401": - description: "" + '401': + description: '' content: application/json: schema: {} - "403": - description: "" + '403': + description: '' content: application/json: schema: {} - "404": - description: "" + '404': + description: '' content: application/json: schema: {} - "405": - description: "" + '405': + description: '' content: application/json: schema: {} @@ -2181,34 +2181,34 @@ paths: format: date-time nullable: true responses: - "200": - description: "" + '200': + description: '' content: application/json: schema: - $ref: "#/components/schemas/PaginatedSessions" - "400": - description: "" + $ref: '#/components/schemas/PaginatedSessions' + '400': + description: '' content: application/json: schema: {} - "401": - description: "" + '401': + description: '' content: application/json: schema: {} - "403": - description: "" + '403': + description: '' content: application/json: schema: {} - "404": - description: "" + '404': + description: '' content: application/json: schema: {} - "405": - description: "" + '405': + description: '' content: application/json: schema: {} @@ -2231,34 +2231,34 @@ paths: schema: type: string responses: - "200": - description: "" + '200': + description: '' content: application/json: schema: - $ref: "#/components/schemas/SessionWithTraces" - "400": - description: "" + $ref: '#/components/schemas/SessionWithTraces' + '400': + description: '' content: application/json: schema: {} - "401": - description: "" + '401': + description: '' content: application/json: schema: {} - "403": - description: "" + '403': + description: '' content: application/json: schema: {} - "404": - description: "" + '404': + description: '' content: application/json: schema: {} - "405": - description: "" + '405': + description: '' content: application/json: schema: {} @@ -2278,34 +2278,34 @@ paths: schema: type: string responses: - "200": - description: "" + '200': + description: '' content: application/json: schema: - $ref: "#/components/schemas/TraceWithFullDetails" - "400": - description: "" + $ref: '#/components/schemas/TraceWithFullDetails' + '400': + description: '' content: application/json: schema: {} - "401": - description: "" + '401': + description: '' content: application/json: schema: {} - "403": - description: "" + '403': + description: '' content: application/json: schema: {} - "404": - description: "" + '404': + description: '' content: application/json: schema: {} - "405": - description: "" + '405': + description: '' content: application/json: schema: {} @@ -2406,34 +2406,34 @@ paths: type: string nullable: true responses: - "200": - description: "" + '200': + description: '' content: application/json: schema: - $ref: "#/components/schemas/Traces" - "400": - description: "" + $ref: '#/components/schemas/Traces' + '400': + description: '' content: application/json: schema: {} - "401": - description: "" + '401': + description: '' content: application/json: schema: {} - "403": - description: "" + '403': + description: '' content: application/json: schema: {} - "404": - description: "" + '404': + description: '' content: application/json: schema: {} - "405": - description: "" + '405': + description: '' content: application/json: schema: {} @@ -2488,9 +2488,9 @@ components: data: type: array items: - $ref: "#/components/schemas/Comment" + $ref: '#/components/schemas/Comment' meta: - $ref: "#/components/schemas/utilsMetaResponse" + $ref: '#/components/schemas/utilsMetaResponse' required: - data - meta @@ -2581,7 +2581,7 @@ components: - observations - scores allOf: - - $ref: "#/components/schemas/Trace" + - $ref: '#/components/schemas/Trace' TraceWithFullDetails: title: TraceWithFullDetails type: object @@ -2600,12 +2600,12 @@ components: observations: type: array items: - $ref: "#/components/schemas/ObservationsView" + $ref: '#/components/schemas/ObservationsView' description: List of observations scores: type: array items: - $ref: "#/components/schemas/Score" + $ref: '#/components/schemas/Score' description: List of scores required: - htmlPath @@ -2614,7 +2614,7 @@ components: - observations - scores allOf: - - $ref: "#/components/schemas/Trace" + - $ref: '#/components/schemas/Trace' Session: title: Session type: object @@ -2637,11 +2637,11 @@ components: traces: type: array items: - $ref: "#/components/schemas/Trace" + $ref: '#/components/schemas/Trace' required: - traces allOf: - - $ref: "#/components/schemas/Session" + - $ref: '#/components/schemas/Session' Observation: title: Observation type: object @@ -2681,7 +2681,7 @@ components: modelParameters: type: object additionalProperties: - $ref: "#/components/schemas/MapValue" + $ref: '#/components/schemas/MapValue' nullable: true description: The parameters of the model used for the observation input: @@ -2698,13 +2698,13 @@ components: nullable: true description: The output data of the observation usage: - $ref: "#/components/schemas/Usage" + $ref: '#/components/schemas/Usage' nullable: true description: >- (Deprecated. Use usageDetails and costDetails instead.) The usage data of the observation level: - $ref: "#/components/schemas/ObservationLevel" + $ref: '#/components/schemas/ObservationLevel' description: The level of the observation statusMessage: type: string @@ -2805,7 +2805,7 @@ components: nullable: true description: The time to the first token in seconds allOf: - - $ref: "#/components/schemas/Observation" + - $ref: '#/components/schemas/Observation' Usage: title: Usage type: object @@ -2826,7 +2826,7 @@ components: nullable: true description: Defaults to input+output if not set unit: - $ref: "#/components/schemas/ModelUsageUnit" + $ref: '#/components/schemas/ModelUsageUnit' inputCost: type: number format: double @@ -2860,7 +2860,7 @@ components: projectId: type: string dataType: - $ref: "#/components/schemas/ScoreDataType" + $ref: '#/components/schemas/ScoreDataType' isArchived: type: boolean description: Whether the score config is archived. Defaults to false @@ -2881,7 +2881,7 @@ components: categories: type: array items: - $ref: "#/components/schemas/ConfigCategory" + $ref: '#/components/schemas/ConfigCategory' nullable: true description: Configures custom categories for categorical scores description: @@ -2918,7 +2918,7 @@ components: name: type: string source: - $ref: "#/components/schemas/ScoreSource" + $ref: '#/components/schemas/ScoreSource' observationId: type: string nullable: true @@ -2969,7 +2969,7 @@ components: required: - value allOf: - - $ref: "#/components/schemas/BaseScore" + - $ref: '#/components/schemas/BaseScore' BooleanScore: title: BooleanScore type: object @@ -2989,7 +2989,7 @@ components: - value - stringValue allOf: - - $ref: "#/components/schemas/BaseScore" + - $ref: '#/components/schemas/BaseScore' CategoricalScore: title: CategoricalScore type: object @@ -3009,7 +3009,7 @@ components: required: - stringValue allOf: - - $ref: "#/components/schemas/BaseScore" + - $ref: '#/components/schemas/BaseScore' Score: title: Score oneOf: @@ -3021,7 +3021,7 @@ components: type: string enum: - NUMERIC - - $ref: "#/components/schemas/NumericScore" + - $ref: '#/components/schemas/NumericScore' required: - dataType - type: object @@ -3032,7 +3032,7 @@ components: type: string enum: - CATEGORICAL - - $ref: "#/components/schemas/CategoricalScore" + - $ref: '#/components/schemas/CategoricalScore' required: - dataType - type: object @@ -3043,7 +3043,7 @@ components: type: string enum: - BOOLEAN - - $ref: "#/components/schemas/BooleanScore" + - $ref: '#/components/schemas/BooleanScore' required: - dataType CreateScoreValue: @@ -3070,7 +3070,7 @@ components: type: string format: date-time objectType: - $ref: "#/components/schemas/CommentObjectType" + $ref: '#/components/schemas/CommentObjectType' objectId: type: string content: @@ -3120,7 +3120,7 @@ components: id: type: string status: - $ref: "#/components/schemas/DatasetStatus" + $ref: '#/components/schemas/DatasetStatus' input: nullable: true expectedOutput: @@ -3226,11 +3226,11 @@ components: datasetRunItems: type: array items: - $ref: "#/components/schemas/DatasetRunItem" + $ref: '#/components/schemas/DatasetRunItem' required: - datasetRunItems allOf: - - $ref: "#/components/schemas/DatasetRun" + - $ref: '#/components/schemas/DatasetRun' Model: title: Model type: object @@ -3259,7 +3259,7 @@ components: nullable: true description: Apply only to generations which are newer than this ISO date. unit: - $ref: "#/components/schemas/ModelUsageUnit" + $ref: '#/components/schemas/ModelUsageUnit' description: Unit used by this model. inputPrice: type: number @@ -3381,7 +3381,7 @@ components: Dataset items are upserted on their id. Id needs to be unique (project-level) and cannot be reused across datasets. status: - $ref: "#/components/schemas/DatasetStatus" + $ref: '#/components/schemas/DatasetStatus' nullable: true description: Defaults to ACTIVE for newly created items required: @@ -3393,9 +3393,9 @@ components: data: type: array items: - $ref: "#/components/schemas/DatasetItem" + $ref: '#/components/schemas/DatasetItem' meta: - $ref: "#/components/schemas/utilsMetaResponse" + $ref: '#/components/schemas/utilsMetaResponse' required: - data - meta @@ -3433,9 +3433,9 @@ components: data: type: array items: - $ref: "#/components/schemas/Dataset" + $ref: '#/components/schemas/Dataset' meta: - $ref: "#/components/schemas/utilsMetaResponse" + $ref: '#/components/schemas/utilsMetaResponse' required: - data - meta @@ -3459,9 +3459,9 @@ components: data: type: array items: - $ref: "#/components/schemas/DatasetRun" + $ref: '#/components/schemas/DatasetRun' meta: - $ref: "#/components/schemas/utilsMetaResponse" + $ref: '#/components/schemas/utilsMetaResponse' required: - data - meta @@ -3490,7 +3490,7 @@ components: type: string enum: - trace-create - - $ref: "#/components/schemas/TraceEvent" + - $ref: '#/components/schemas/TraceEvent' required: - type - type: object @@ -3501,7 +3501,7 @@ components: type: string enum: - score-create - - $ref: "#/components/schemas/ScoreEvent" + - $ref: '#/components/schemas/ScoreEvent' required: - type - type: object @@ -3512,7 +3512,7 @@ components: type: string enum: - span-create - - $ref: "#/components/schemas/CreateSpanEvent" + - $ref: '#/components/schemas/CreateSpanEvent' required: - type - type: object @@ -3523,7 +3523,7 @@ components: type: string enum: - span-update - - $ref: "#/components/schemas/UpdateSpanEvent" + - $ref: '#/components/schemas/UpdateSpanEvent' required: - type - type: object @@ -3534,7 +3534,7 @@ components: type: string enum: - generation-create - - $ref: "#/components/schemas/CreateGenerationEvent" + - $ref: '#/components/schemas/CreateGenerationEvent' required: - type - type: object @@ -3545,7 +3545,7 @@ components: type: string enum: - generation-update - - $ref: "#/components/schemas/UpdateGenerationEvent" + - $ref: '#/components/schemas/UpdateGenerationEvent' required: - type - type: object @@ -3556,7 +3556,7 @@ components: type: string enum: - event-create - - $ref: "#/components/schemas/CreateEventEvent" + - $ref: '#/components/schemas/CreateEventEvent' required: - type - type: object @@ -3567,7 +3567,7 @@ components: type: string enum: - sdk-log - - $ref: "#/components/schemas/SDKLogEvent" + - $ref: '#/components/schemas/SDKLogEvent' required: - type - type: object @@ -3578,7 +3578,7 @@ components: type: string enum: - observation-create - - $ref: "#/components/schemas/CreateObservationEvent" + - $ref: '#/components/schemas/CreateObservationEvent' required: - type - type: object @@ -3589,7 +3589,7 @@ components: type: string enum: - observation-update - - $ref: "#/components/schemas/UpdateObservationEvent" + - $ref: '#/components/schemas/UpdateObservationEvent' required: - type ObservationType: @@ -3602,8 +3602,8 @@ components: IngestionUsage: title: IngestionUsage oneOf: - - $ref: "#/components/schemas/Usage" - - $ref: "#/components/schemas/OpenAIUsage" + - $ref: '#/components/schemas/Usage' + - $ref: '#/components/schemas/OpenAIUsage' OpenAIUsage: title: OpenAIUsage type: object @@ -3639,7 +3639,7 @@ components: output: nullable: true level: - $ref: "#/components/schemas/ObservationLevel" + $ref: '#/components/schemas/ObservationLevel' nullable: true statusMessage: type: string @@ -3658,7 +3658,7 @@ components: type: string nullable: true allOf: - - $ref: "#/components/schemas/OptionalObservationBody" + - $ref: '#/components/schemas/OptionalObservationBody' UpdateEventBody: title: UpdateEventBody type: object @@ -3668,7 +3668,7 @@ components: required: - id allOf: - - $ref: "#/components/schemas/OptionalObservationBody" + - $ref: '#/components/schemas/OptionalObservationBody' CreateSpanBody: title: CreateSpanBody type: object @@ -3678,7 +3678,7 @@ components: format: date-time nullable: true allOf: - - $ref: "#/components/schemas/CreateEventBody" + - $ref: '#/components/schemas/CreateEventBody' UpdateSpanBody: title: UpdateSpanBody type: object @@ -3688,7 +3688,7 @@ components: format: date-time nullable: true allOf: - - $ref: "#/components/schemas/UpdateEventBody" + - $ref: '#/components/schemas/UpdateEventBody' CreateGenerationBody: title: CreateGenerationBody type: object @@ -3703,13 +3703,13 @@ components: modelParameters: type: object additionalProperties: - $ref: "#/components/schemas/MapValue" + $ref: '#/components/schemas/MapValue' nullable: true usage: - $ref: "#/components/schemas/IngestionUsage" + $ref: '#/components/schemas/IngestionUsage' nullable: true usageDetails: - $ref: "#/components/schemas/UsageDetails" + $ref: '#/components/schemas/UsageDetails' nullable: true costDetails: type: object @@ -3724,7 +3724,7 @@ components: type: integer nullable: true allOf: - - $ref: "#/components/schemas/CreateSpanBody" + - $ref: '#/components/schemas/CreateSpanBody' UpdateGenerationBody: title: UpdateGenerationBody type: object @@ -3739,16 +3739,16 @@ components: modelParameters: type: object additionalProperties: - $ref: "#/components/schemas/MapValue" + $ref: '#/components/schemas/MapValue' nullable: true usage: - $ref: "#/components/schemas/IngestionUsage" + $ref: '#/components/schemas/IngestionUsage' nullable: true promptName: type: string nullable: true usageDetails: - $ref: "#/components/schemas/UsageDetails" + $ref: '#/components/schemas/UsageDetails' nullable: true costDetails: type: object @@ -3760,7 +3760,7 @@ components: type: integer nullable: true allOf: - - $ref: "#/components/schemas/UpdateSpanBody" + - $ref: '#/components/schemas/UpdateSpanBody' ObservationBody: title: ObservationBody type: object @@ -3772,7 +3772,7 @@ components: type: string nullable: true type: - $ref: "#/components/schemas/ObservationType" + $ref: '#/components/schemas/ObservationType' name: type: string nullable: true @@ -3794,7 +3794,7 @@ components: modelParameters: type: object additionalProperties: - $ref: "#/components/schemas/MapValue" + $ref: '#/components/schemas/MapValue' nullable: true input: nullable: true @@ -3806,10 +3806,10 @@ components: output: nullable: true usage: - $ref: "#/components/schemas/Usage" + $ref: '#/components/schemas/Usage' nullable: true level: - $ref: "#/components/schemas/ObservationLevel" + $ref: '#/components/schemas/ObservationLevel' nullable: true statusMessage: type: string @@ -3881,7 +3881,7 @@ components: type: string example: novelty value: - $ref: "#/components/schemas/CreateScoreValue" + $ref: '#/components/schemas/CreateScoreValue' description: >- The value of the score. Must be passed as string for categorical scores, and numeric for boolean and numeric scores. Boolean score @@ -3893,7 +3893,7 @@ components: type: string nullable: true dataType: - $ref: "#/components/schemas/ScoreDataType" + $ref: '#/components/schemas/ScoreDataType' nullable: true description: >- When set, must match the score value's type. If not set, will be @@ -3936,101 +3936,101 @@ components: type: object properties: body: - $ref: "#/components/schemas/TraceBody" + $ref: '#/components/schemas/TraceBody' required: - body allOf: - - $ref: "#/components/schemas/BaseEvent" + - $ref: '#/components/schemas/BaseEvent' CreateObservationEvent: title: CreateObservationEvent type: object properties: body: - $ref: "#/components/schemas/ObservationBody" + $ref: '#/components/schemas/ObservationBody' required: - body allOf: - - $ref: "#/components/schemas/BaseEvent" + - $ref: '#/components/schemas/BaseEvent' UpdateObservationEvent: title: UpdateObservationEvent type: object properties: body: - $ref: "#/components/schemas/ObservationBody" + $ref: '#/components/schemas/ObservationBody' required: - body allOf: - - $ref: "#/components/schemas/BaseEvent" + - $ref: '#/components/schemas/BaseEvent' ScoreEvent: title: ScoreEvent type: object properties: body: - $ref: "#/components/schemas/ScoreBody" + $ref: '#/components/schemas/ScoreBody' required: - body allOf: - - $ref: "#/components/schemas/BaseEvent" + - $ref: '#/components/schemas/BaseEvent' SDKLogEvent: title: SDKLogEvent type: object properties: body: - $ref: "#/components/schemas/SDKLogBody" + $ref: '#/components/schemas/SDKLogBody' required: - body allOf: - - $ref: "#/components/schemas/BaseEvent" + - $ref: '#/components/schemas/BaseEvent' CreateGenerationEvent: title: CreateGenerationEvent type: object properties: body: - $ref: "#/components/schemas/CreateGenerationBody" + $ref: '#/components/schemas/CreateGenerationBody' required: - body allOf: - - $ref: "#/components/schemas/BaseEvent" + - $ref: '#/components/schemas/BaseEvent' UpdateGenerationEvent: title: UpdateGenerationEvent type: object properties: body: - $ref: "#/components/schemas/UpdateGenerationBody" + $ref: '#/components/schemas/UpdateGenerationBody' required: - body allOf: - - $ref: "#/components/schemas/BaseEvent" + - $ref: '#/components/schemas/BaseEvent' CreateSpanEvent: title: CreateSpanEvent type: object properties: body: - $ref: "#/components/schemas/CreateSpanBody" + $ref: '#/components/schemas/CreateSpanBody' required: - body allOf: - - $ref: "#/components/schemas/BaseEvent" + - $ref: '#/components/schemas/BaseEvent' UpdateSpanEvent: title: UpdateSpanEvent type: object properties: body: - $ref: "#/components/schemas/UpdateSpanBody" + $ref: '#/components/schemas/UpdateSpanBody' required: - body allOf: - - $ref: "#/components/schemas/BaseEvent" + - $ref: '#/components/schemas/BaseEvent' CreateEventEvent: title: CreateEventEvent type: object properties: body: - $ref: "#/components/schemas/CreateEventBody" + $ref: '#/components/schemas/CreateEventBody' required: - body allOf: - - $ref: "#/components/schemas/BaseEvent" + - $ref: '#/components/schemas/BaseEvent' IngestionSuccess: title: IngestionSuccess type: object @@ -4065,11 +4065,11 @@ components: successes: type: array items: - $ref: "#/components/schemas/IngestionSuccess" + $ref: '#/components/schemas/IngestionSuccess' errors: type: array items: - $ref: "#/components/schemas/IngestionError" + $ref: '#/components/schemas/IngestionError' required: - successes - errors @@ -4103,7 +4103,7 @@ components: - type: object additionalProperties: type: integer - - $ref: "#/components/schemas/OpenAIUsageSchema" + - $ref: '#/components/schemas/OpenAIUsageSchema' GetMediaResponse: title: GetMediaResponse type: object @@ -4170,7 +4170,7 @@ components: The observation ID associated with the media record. If the media record is associated directly with a trace, this will be null. contentType: - $ref: "#/components/schemas/MediaContentType" + $ref: '#/components/schemas/MediaContentType' contentLength: type: integer description: The size of the media record in bytes @@ -4244,10 +4244,10 @@ components: data: type: array items: - $ref: "#/components/schemas/DailyMetricsDetails" + $ref: '#/components/schemas/DailyMetricsDetails' description: A list of daily metrics, only days with ingested data are included. meta: - $ref: "#/components/schemas/utilsMetaResponse" + $ref: '#/components/schemas/utilsMetaResponse' required: - data - meta @@ -4269,7 +4269,7 @@ components: usage: type: array items: - $ref: "#/components/schemas/UsageByModel" + $ref: '#/components/schemas/UsageByModel' required: - date - countTraces @@ -4317,9 +4317,9 @@ components: data: type: array items: - $ref: "#/components/schemas/Model" + $ref: '#/components/schemas/Model' meta: - $ref: "#/components/schemas/utilsMetaResponse" + $ref: '#/components/schemas/utilsMetaResponse' required: - data - meta @@ -4346,7 +4346,7 @@ components: nullable: true description: Apply only to generations which are newer than this ISO date. unit: - $ref: "#/components/schemas/ModelUsageUnit" + $ref: '#/components/schemas/ModelUsageUnit' description: Unit used by this model. inputPrice: type: number @@ -4386,9 +4386,9 @@ components: data: type: array items: - $ref: "#/components/schemas/Observation" + $ref: '#/components/schemas/Observation' meta: - $ref: "#/components/schemas/utilsMetaResponse" + $ref: '#/components/schemas/utilsMetaResponse' required: - data - meta @@ -4399,9 +4399,9 @@ components: data: type: array items: - $ref: "#/components/schemas/ObservationsView" + $ref: '#/components/schemas/ObservationsView' meta: - $ref: "#/components/schemas/utilsMetaResponse" + $ref: '#/components/schemas/utilsMetaResponse' required: - data - meta @@ -4412,7 +4412,7 @@ components: data: type: array items: - $ref: "#/components/schemas/Project" + $ref: '#/components/schemas/Project' required: - data Project: @@ -4433,9 +4433,9 @@ components: data: type: array items: - $ref: "#/components/schemas/PromptMeta" + $ref: '#/components/schemas/PromptMeta' meta: - $ref: "#/components/schemas/utilsMetaResponse" + $ref: '#/components/schemas/utilsMetaResponse' required: - data - meta @@ -4482,7 +4482,7 @@ components: type: string enum: - chat - - $ref: "#/components/schemas/CreateChatPromptRequest" + - $ref: '#/components/schemas/CreateChatPromptRequest' required: - type - type: object @@ -4493,7 +4493,7 @@ components: type: string enum: - text - - $ref: "#/components/schemas/CreateTextPromptRequest" + - $ref: '#/components/schemas/CreateTextPromptRequest' required: - type CreateChatPromptRequest: @@ -4505,7 +4505,7 @@ components: prompt: type: array items: - $ref: "#/components/schemas/ChatMessage" + $ref: '#/components/schemas/ChatMessage' config: nullable: true labels: @@ -4559,7 +4559,7 @@ components: type: string enum: - chat - - $ref: "#/components/schemas/ChatPrompt" + - $ref: '#/components/schemas/ChatPrompt' required: - type - type: object @@ -4570,7 +4570,7 @@ components: type: string enum: - text - - $ref: "#/components/schemas/TextPrompt" + - $ref: '#/components/schemas/TextPrompt' required: - type BasePrompt: @@ -4620,7 +4620,7 @@ components: required: - prompt allOf: - - $ref: "#/components/schemas/BasePrompt" + - $ref: '#/components/schemas/BasePrompt' ChatPrompt: title: ChatPrompt type: object @@ -4628,11 +4628,11 @@ components: prompt: type: array items: - $ref: "#/components/schemas/ChatMessage" + $ref: '#/components/schemas/ChatMessage' required: - prompt allOf: - - $ref: "#/components/schemas/BasePrompt" + - $ref: '#/components/schemas/BasePrompt' ScoreConfigs: title: ScoreConfigs type: object @@ -4640,9 +4640,9 @@ components: data: type: array items: - $ref: "#/components/schemas/ScoreConfig" + $ref: '#/components/schemas/ScoreConfig' meta: - $ref: "#/components/schemas/utilsMetaResponse" + $ref: '#/components/schemas/utilsMetaResponse' required: - data - meta @@ -4653,11 +4653,11 @@ components: name: type: string dataType: - $ref: "#/components/schemas/ScoreDataType" + $ref: '#/components/schemas/ScoreDataType' categories: type: array items: - $ref: "#/components/schemas/ConfigCategory" + $ref: '#/components/schemas/ConfigCategory' nullable: true description: >- Configure custom categories for categorical scores. Pass a list of @@ -4701,7 +4701,7 @@ components: type: string example: novelty value: - $ref: "#/components/schemas/CreateScoreValue" + $ref: '#/components/schemas/CreateScoreValue' description: >- The value of the score. Must be passed as string for categorical scores, and numeric for boolean and numeric scores. Boolean score @@ -4713,7 +4713,7 @@ components: type: string nullable: true dataType: - $ref: "#/components/schemas/ScoreDataType" + $ref: '#/components/schemas/ScoreDataType' nullable: true description: >- The data type of the score. When passing a configId this field is @@ -4758,31 +4758,31 @@ components: type: object properties: trace: - $ref: "#/components/schemas/GetScoresResponseTraceData" + $ref: '#/components/schemas/GetScoresResponseTraceData' required: - trace allOf: - - $ref: "#/components/schemas/NumericScore" + - $ref: '#/components/schemas/NumericScore' GetScoresResponseDataCategorical: title: GetScoresResponseDataCategorical type: object properties: trace: - $ref: "#/components/schemas/GetScoresResponseTraceData" + $ref: '#/components/schemas/GetScoresResponseTraceData' required: - trace allOf: - - $ref: "#/components/schemas/CategoricalScore" + - $ref: '#/components/schemas/CategoricalScore' GetScoresResponseDataBoolean: title: GetScoresResponseDataBoolean type: object properties: trace: - $ref: "#/components/schemas/GetScoresResponseTraceData" + $ref: '#/components/schemas/GetScoresResponseTraceData' required: - trace allOf: - - $ref: "#/components/schemas/BooleanScore" + - $ref: '#/components/schemas/BooleanScore' GetScoresResponseData: title: GetScoresResponseData oneOf: @@ -4794,7 +4794,7 @@ components: type: string enum: - NUMERIC - - $ref: "#/components/schemas/GetScoresResponseDataNumeric" + - $ref: '#/components/schemas/GetScoresResponseDataNumeric' required: - dataType - type: object @@ -4805,7 +4805,7 @@ components: type: string enum: - CATEGORICAL - - $ref: "#/components/schemas/GetScoresResponseDataCategorical" + - $ref: '#/components/schemas/GetScoresResponseDataCategorical' required: - dataType - type: object @@ -4816,7 +4816,7 @@ components: type: string enum: - BOOLEAN - - $ref: "#/components/schemas/GetScoresResponseDataBoolean" + - $ref: '#/components/schemas/GetScoresResponseDataBoolean' required: - dataType GetScoresResponse: @@ -4826,9 +4826,9 @@ components: data: type: array items: - $ref: "#/components/schemas/GetScoresResponseData" + $ref: '#/components/schemas/GetScoresResponseData' meta: - $ref: "#/components/schemas/utilsMetaResponse" + $ref: '#/components/schemas/utilsMetaResponse' required: - data - meta @@ -4839,9 +4839,9 @@ components: data: type: array items: - $ref: "#/components/schemas/Session" + $ref: '#/components/schemas/Session' meta: - $ref: "#/components/schemas/utilsMetaResponse" + $ref: '#/components/schemas/utilsMetaResponse' required: - data - meta @@ -4852,9 +4852,9 @@ components: data: type: array items: - $ref: "#/components/schemas/TraceWithDetails" + $ref: '#/components/schemas/TraceWithDetails' meta: - $ref: "#/components/schemas/utilsMetaResponse" + $ref: '#/components/schemas/utilsMetaResponse' required: - data - meta From 272766b9bbb54452942ec0828a1f4659dce822d0 Mon Sep 17 00:00:00 2001 From: Max Deichmann Date: Mon, 20 Jan 2025 22:29:22 +0100 Subject: [PATCH 09/13] feat: update prompts and invalidate cache --- langfuse-core/openapi-spec/openapi-server.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/langfuse-core/openapi-spec/openapi-server.yaml b/langfuse-core/openapi-spec/openapi-server.yaml index 43f31947..b1d671fb 100644 --- a/langfuse-core/openapi-spec/openapi-server.yaml +++ b/langfuse-core/openapi-spec/openapi-server.yaml @@ -3295,6 +3295,7 @@ components: - id - modelName - matchPattern + - unit - isLangfuseManaged ModelUsageUnit: title: ModelUsageUnit @@ -4378,6 +4379,7 @@ components: JSON. See docs for more details. required: - modelName + - unit - matchPattern Observations: title: Observations From bc7162f3c392665a6771dd66c78a3c4a3164d7c5 Mon Sep 17 00:00:00 2001 From: Max Deichmann Date: Mon, 20 Jan 2025 22:33:29 +0100 Subject: [PATCH 10/13] feat: update prompts and invalidate cache --- langfuse-core/openapi-spec/openapi-server.yaml | 15 ++++++++------- langfuse-core/src/openapi/server.ts | 12 ++++++------ 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/langfuse-core/openapi-spec/openapi-server.yaml b/langfuse-core/openapi-spec/openapi-server.yaml index b1d671fb..bb6c7fad 100644 --- a/langfuse-core/openapi-spec/openapi-server.yaml +++ b/langfuse-core/openapi-spec/openapi-server.yaml @@ -1492,7 +1492,7 @@ paths: type: string description: >- New labels for the prompt version. Labels are unique across - versions. The 'latest' label is reserved and managed by + versions. The "latest" label is reserved and managed by Langfuse. required: - newLabels @@ -1519,7 +1519,7 @@ paths: - name: label in: query description: >- - Label of the prompt to be retrieved. Defaults to 'production' if no + Label of the prompt to be retrieved. Defaults to "production" if no label or version is set. required: false schema: @@ -2827,6 +2827,7 @@ components: description: Defaults to input+output if not set unit: $ref: '#/components/schemas/ModelUsageUnit' + nullable: true inputCost: type: number format: double @@ -2978,13 +2979,13 @@ components: type: number format: double description: >- - The numeric value of the score. Equals 1 for 'True' and 0 for - 'False' + The numeric value of the score. Equals 1 for "True" and 0 for + "False" stringValue: type: string description: >- The string representation of the score value. Is inferred from the - numeric value and equals 'True' or 'False' + numeric value and equals "True" or "False" required: - value - stringValue @@ -3260,6 +3261,7 @@ components: description: Apply only to generations which are newer than this ISO date. unit: $ref: '#/components/schemas/ModelUsageUnit' + nullable: true description: Unit used by this model. inputPrice: type: number @@ -3295,7 +3297,6 @@ components: - id - modelName - matchPattern - - unit - isLangfuseManaged ModelUsageUnit: title: ModelUsageUnit @@ -4348,6 +4349,7 @@ components: description: Apply only to generations which are newer than this ISO date. unit: $ref: '#/components/schemas/ModelUsageUnit' + nullable: true description: Unit used by this model. inputPrice: type: number @@ -4379,7 +4381,6 @@ components: JSON. See docs for more details. required: - modelName - - unit - matchPattern Observations: title: Observations diff --git a/langfuse-core/src/openapi/server.ts b/langfuse-core/src/openapi/server.ts index 78cb8737..9b795371 100644 --- a/langfuse-core/src/openapi/server.ts +++ b/langfuse-core/src/openapi/server.ts @@ -838,10 +838,10 @@ export interface components { BooleanScore: { /** * Format: double - * @description The numeric value of the score. Equals 1 for "True" and 0 for "False" + * @description The numeric value of the score. Equals 1 for 'True' and 0 for 'False' */ value: number; - /** @description The string representation of the score value. Is inferred from the numeric value and equals "True" or "False" */ + /** @description The string representation of the score value. Is inferred from the numeric value and equals 'True' or 'False' */ stringValue: string; } & components["schemas"]["BaseScore"]; /** CategoricalScore */ @@ -972,7 +972,7 @@ export interface components { */ startDate?: string | null; /** @description Unit used by this model. */ - unit?: components["schemas"]["ModelUsageUnit"]; + unit: components["schemas"]["ModelUsageUnit"]; /** * Format: double * @description Price (USD) per input unit @@ -1495,7 +1495,7 @@ export interface components { */ startDate?: string | null; /** @description Unit used by this model. */ - unit?: components["schemas"]["ModelUsageUnit"]; + unit: components["schemas"]["ModelUsageUnit"]; /** * Format: double * @description Price (USD) per input unit @@ -3350,7 +3350,7 @@ export interface operations { requestBody: { content: { "application/json": { - /** @description New labels for the prompt version. Labels are unique across versions. The "latest" label is reserved and managed by Langfuse. */ + /** @description New labels for the prompt version. Labels are unique across versions. The 'latest' label is reserved and managed by Langfuse. */ newLabels: string[]; }; }; @@ -3411,7 +3411,7 @@ export interface operations { query?: { /** @description Version of the prompt to be retrieved. */ version?: number | null; - /** @description Label of the prompt to be retrieved. Defaults to "production" if no label or version is set. */ + /** @description Label of the prompt to be retrieved. Defaults to 'production' if no label or version is set. */ label?: string | null; }; header?: never; From 4cf062561a69483dc89d2a0b938571b2dbeb34f2 Mon Sep 17 00:00:00 2001 From: Max Deichmann Date: Mon, 20 Jan 2025 22:33:42 +0100 Subject: [PATCH 11/13] feat: update prompts and invalidate cache --- langfuse-core/src/openapi/server.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/langfuse-core/src/openapi/server.ts b/langfuse-core/src/openapi/server.ts index 9b795371..78cb8737 100644 --- a/langfuse-core/src/openapi/server.ts +++ b/langfuse-core/src/openapi/server.ts @@ -838,10 +838,10 @@ export interface components { BooleanScore: { /** * Format: double - * @description The numeric value of the score. Equals 1 for 'True' and 0 for 'False' + * @description The numeric value of the score. Equals 1 for "True" and 0 for "False" */ value: number; - /** @description The string representation of the score value. Is inferred from the numeric value and equals 'True' or 'False' */ + /** @description The string representation of the score value. Is inferred from the numeric value and equals "True" or "False" */ stringValue: string; } & components["schemas"]["BaseScore"]; /** CategoricalScore */ @@ -972,7 +972,7 @@ export interface components { */ startDate?: string | null; /** @description Unit used by this model. */ - unit: components["schemas"]["ModelUsageUnit"]; + unit?: components["schemas"]["ModelUsageUnit"]; /** * Format: double * @description Price (USD) per input unit @@ -1495,7 +1495,7 @@ export interface components { */ startDate?: string | null; /** @description Unit used by this model. */ - unit: components["schemas"]["ModelUsageUnit"]; + unit?: components["schemas"]["ModelUsageUnit"]; /** * Format: double * @description Price (USD) per input unit @@ -3350,7 +3350,7 @@ export interface operations { requestBody: { content: { "application/json": { - /** @description New labels for the prompt version. Labels are unique across versions. The 'latest' label is reserved and managed by Langfuse. */ + /** @description New labels for the prompt version. Labels are unique across versions. The "latest" label is reserved and managed by Langfuse. */ newLabels: string[]; }; }; @@ -3411,7 +3411,7 @@ export interface operations { query?: { /** @description Version of the prompt to be retrieved. */ version?: number | null; - /** @description Label of the prompt to be retrieved. Defaults to 'production' if no label or version is set. */ + /** @description Label of the prompt to be retrieved. Defaults to "production" if no label or version is set. */ label?: string | null; }; header?: never; From 611d8163117d1b07aea20457c661599ef0c02664 Mon Sep 17 00:00:00 2001 From: Hassieb Pakzad <68423100+hassiebp@users.noreply.github.com> Date: Tue, 21 Jan 2025 10:38:53 +0100 Subject: [PATCH 12/13] Update integration-test/langfuse-integration-node.spec.ts Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com> --- integration-test/langfuse-integration-node.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/integration-test/langfuse-integration-node.spec.ts b/integration-test/langfuse-integration-node.spec.ts index b649494d..d65c0597 100644 --- a/integration-test/langfuse-integration-node.spec.ts +++ b/integration-test/langfuse-integration-node.spec.ts @@ -433,7 +433,7 @@ describe("Langfuse Node.js", () => { }); }); - it.only("update a prompt", async () => { + it("update a prompt", async () => { const promptName = "test-prompt" + Math.random().toString(36); await langfuse.createPrompt({ name: promptName, From b983d5ffaedc7f9def6a7194750d4195f6127d78 Mon Sep 17 00:00:00 2001 From: Hassieb Pakzad <68423100+hassiebp@users.noreply.github.com> Date: Tue, 21 Jan 2025 10:39:14 +0100 Subject: [PATCH 13/13] Update langfuse-core/src/openapi/server.ts --- langfuse-core/src/openapi/server.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/langfuse-core/src/openapi/server.ts b/langfuse-core/src/openapi/server.ts index 78cb8737..18a90926 100644 --- a/langfuse-core/src/openapi/server.ts +++ b/langfuse-core/src/openapi/server.ts @@ -1006,7 +1006,7 @@ export interface components { */ ObservationLevel: "DEBUG" | "DEFAULT" | "WARNING" | "ERROR"; /** MapValue */ - MapValue: (string | null) | (number | null) | (boolean | null) | (string[] | null); + MapValue: (string | null) | (number | null) | (boolean | null) | (string[] | null) | undefined; /** * CommentObjectType * @enum {string}