🪢 Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform.
TypeScript analyticsautogenevaluationlangchainlarge-language-modelsllama-indexllmllm-evaluationllm-observabilityllmopsmonitoringobservabilityopen-sourceopenaiplaygroundprompt-engineeringprompt-managementself-hostedycombinator
chore: enhance ingestion api documentation (#5550)
Steffen Schmitzac517c18494d
diff --git a/fern/apis/server/definition/ingestion.yml b/fern/apis/server/definition/ingestion.ymlindex a8db90b871..78f211be37 100644--- a/fern/apis/server/definition/ingestion.yml+++ b/fern/apis/server/definition/ingestion.yml@@ -8,7 +8,15 @@ service:endpoints:batch:docs: |- Batched ingestion for Langfuse Tracing. If you want to use tracing via the API, such as to build your own Langfuse client implementation, this is the only API route you need to implement.+ Batched ingestion for Langfuse Tracing.+ If you want to use tracing via the API, such as to build your own Langfuse client implementation, this is the only API route you need to implement.++ Within each batch, there can be multiple events.+ Each event has a type, an id, a timestamp, metadata and a body.+ Internally, we refer to this as the "event envelope" as it tells us something about the event but not the trace.+ We use the event id within this envelope to deduplicate messages to avoid processing the same event twice, i.e. the event id should be unique per request.+ The event.body.id is the ID of the actual trace and will be used for updates and will be visible within the Langfuse App.+ I.e. if you want to update a trace, you'd use the same body id, but separate event IDs.Notes:- Introduction to data model: https://langfuse.com/docs/tracing-data-model@@ -29,6 +37,67 @@ service:response:type: IngestionResponsestatus-code: 207+ examples:+ # Trace Create Request+ - request:+ batch:+ - id: abcdef-1234-5678-90ab+ timestamp: "2022-01-01T00:00:00.000Z"+ type: "trace-create"+ body:+ id: abcdef-1234-5678-90ab+ timestamp: "2022-01-01T00:00:00.000Z"+ name: "My Trace"+ userId: "1234-5678-90ab-cdef"+ input: "My input"+ output: "My output"+ sessionId: "1234-5678-90ab-cdef"+ release: "1.0.0"+ version: "1.0.0"+ metadata: "My metadata"+ tags: ["tag1", "tag2"]+ public: true+ response:+ body:+ successes:+ - id: abcdef-1234-5678-90ab+ status: 201+ errors: []++ # Observation Create Request+ - request:+ batch:+ - id: abcdef-1234-5678-90ab+ timestamp: "2022-01-01T00:00:00.000Z"+ type: "span-create"+ body:+ id: abcdef-1234-5678-90ab+ traceId: "1234-5678-90ab-cdef"+ startTime: "2022-01-01T00:00:00.000Z"+ response:+ body:+ successes:+ - id: abcdef-1234-5678-90ab+ status: 201+ errors: []++ # Score Create Request+ - request:+ batch:+ - id: abcdef-1234-5678-90ab+ timestamp: "2022-01-01T00:00:00.000Z"+ type: "score-create"+ body:+ id: abcdef-1234-5678-90ab+ traceId: "1234-5678-90ab-cdef"+ name: "My Score"+ value: 0.9+ response:+ body:+ successes:+ - id: abcdef-1234-5678-90ab+ status: 201+ errors: []types:IngestionEvent:diff --git a/web/public/generated/api/openapi.yml b/web/public/generated/api/openapi.ymlindex b0a5e470fb..05529852dd 100644--- a/web/public/generated/api/openapi.yml+++ b/web/public/generated/api/openapi.yml@@ -715,9 +715,29 @@ paths:/api/public/ingestion:post:description: >-- Batched ingestion for Langfuse Tracing. If you want to use tracing via- the API, such as to build your own Langfuse client implementation, this- is the only API route you need to implement.+ Batched ingestion for Langfuse Tracing.++ If you want to use tracing via the API, such as to build your own+ Langfuse client implementation, this is the only API route you need to+ implement.+++ Within each batch, there can be multiple events.++ Each event has a type, an id, a timestamp, metadata and a body.++ Internally, we refer to this as the "event envelope" as it tells us+ something about the event but not the trace.++ We use the event id within this envelope to deduplicate messages to+ avoid processing the same event twice, i.e. the event id should be+ unique per request.++ The event.body.id is the ID of the actual trace and will be used for+ updates and will be visible within the Langfuse App.++ I.e. if you want to update a trace, you'd use the same body id, but+ separate event IDs.Notes:@@ -743,6 +763,25 @@ paths:application/json:schema:$ref: '#/components/schemas/IngestionResponse'+ examples:+ Example1:+ value:+ successes:+ - id: abcdef-1234-5678-90ab+ status: 201+ errors: []+ Example2:+ value:+ successes:+ - id: abcdef-1234-5678-90ab+ status: 201+ errors: []+ Example3:+ value:+ successes:+ - id: abcdef-1234-5678-90ab+ status: 201+ errors: []'400':description: ''content:@@ -791,6 +830,49 @@ paths:debugging.required:- batch+ examples:+ Example1:+ value:+ batch:+ - id: abcdef-1234-5678-90ab+ timestamp: '2022-01-01T00:00:00.000Z'+ type: trace-create+ body:+ id: abcdef-1234-5678-90ab+ timestamp: '2022-01-01T00:00:00.000Z'+ name: My Trace+ userId: 1234-5678-90ab-cdef+ input: My input+ output: My output+ sessionId: 1234-5678-90ab-cdef+ release: 1.0.0+ version: 1.0.0+ metadata: My metadata+ tags:+ - tag1+ - tag2+ public: true+ Example2:+ value:+ batch:+ - id: abcdef-1234-5678-90ab+ timestamp: '2022-01-01T00:00:00.000Z'+ type: span-create+ body:+ id: abcdef-1234-5678-90ab+ traceId: 1234-5678-90ab-cdef+ startTime: '2022-01-01T00:00:00.000Z'+ Example3:+ value:+ batch:+ - id: abcdef-1234-5678-90ab+ timestamp: '2022-01-01T00:00:00.000Z'+ type: score-create+ body:+ id: abcdef-1234-5678-90ab+ traceId: 1234-5678-90ab-cdef+ name: My Score+ value: 0.9/api/public/media/{mediaId}:get:description: Get a media recorddiff --git a/web/public/generated/postman/collection.json b/web/public/generated/postman/collection.jsonindex a323ea9bdb..eb040897df 100644--- a/web/public/generated/postman/collection.json+++ b/web/public/generated/postman/collection.json@@ -558,7 +558,7 @@"_type": "endpoint","name": "Batch","request": {- "description": "Batched ingestion for Langfuse Tracing. If you want to use tracing via the API, such as to build your own Langfuse client implementation, this is the only API route you need to implement.\n\nNotes:\n\n- Introduction to data model: https://langfuse.com/docs/tracing-data-model\n- Batch sizes are limited to 3.5 MB in total. You need to adjust the number of events per batch accordingly.\n- 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.",+ "description": "Batched ingestion for Langfuse Tracing.\nIf you want to use tracing via the API, such as to build your own Langfuse client implementation, this is the only API route you need to implement.\n\nWithin each batch, there can be multiple events.\nEach event has a type, an id, a timestamp, metadata and a body.\nInternally, we refer to this as the \"event envelope\" as it tells us something about the event but not the trace.\nWe use the event id within this envelope to deduplicate messages to avoid processing the same event twice, i.e. the event id should be unique per request.\nThe event.body.id is the ID of the actual trace and will be used for updates and will be visible within the Langfuse App.\nI.e. if you want to update a trace, you'd use the same body id, but separate event IDs.\n\nNotes:\n\n- Introduction to data model: https://langfuse.com/docs/tracing-data-model\n- Batch sizes are limited to 3.5 MB in total. You need to adjust the number of events per batch accordingly.\n- 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.","url": {"raw": "{{baseUrl}}/api/public/ingestion","host": [@@ -572,12 +572,18 @@"query": [],"variable": []},- "header": [],+ "header": [+ {+ "type": "text",+ "key": "Content-Type",+ "value": "application/json"+ }+ ],"method": "POST","auth": null,"body": {"mode": "raw",- "raw": "{\n \"batch\": [\n {\n \"type\": \"trace-create\",\n \"body\": {\n \"id\": \"example\",\n \"timestamp\": \"1994-11-05T13:15:30Z\",\n \"name\": \"example\",\n \"userId\": \"example\",\n \"input\": \"UNKNOWN\",\n \"output\": \"UNKNOWN\",\n \"sessionId\": \"example\",\n \"release\": \"example\",\n \"version\": \"example\",\n \"metadata\": \"UNKNOWN\",\n \"tags\": [\n \"example\"\n ],\n \"public\": true\n },\n \"id\": \"example\",\n \"timestamp\": \"example\",\n \"metadata\": \"UNKNOWN\"\n }\n ],\n \"metadata\": \"UNKNOWN\"\n}",+ "raw": "{\n \"batch\": [\n {\n \"id\": \"abcdef-1234-5678-90ab\",\n \"timestamp\": \"2022-01-01T00:00:00.000Z\",\n \"type\": \"trace-create\",\n \"body\": {\n \"id\": \"abcdef-1234-5678-90ab\",\n \"timestamp\": \"2022-01-01T00:00:00.000Z\",\n \"name\": \"My Trace\",\n \"userId\": \"1234-5678-90ab-cdef\",\n \"input\": \"My input\",\n \"output\": \"My output\",\n \"sessionId\": \"1234-5678-90ab-cdef\",\n \"release\": \"1.0.0\",\n \"version\": \"1.0.0\",\n \"metadata\": \"My metadata\",\n \"tags\": [\n \"tag1\",\n \"tag2\"\n ],\n \"public\": true\n }\n }\n ]\n}","options": {"raw": {"language": "json"@@ -585,7 +591,134 @@}}},- "response": []+ "response": [+ {+ "name": "Success",+ "status": "OK",+ "code": 200,+ "originalRequest": {+ "description": "Batched ingestion for Langfuse Tracing.\nIf you want to use tracing via the API, such as to build your own Langfuse client implementation, this is the only API route you need to implement.\n\nWithin each batch, there can be multiple events.\nEach event has a type, an id, a timestamp, metadata and a body.\nInternally, we refer to this as the \"event envelope\" as it tells us something about the event but not the trace.\nWe use the event id within this envelope to deduplicate messages to avoid processing the same event twice, i.e. the event id should be unique per request.\nThe event.body.id is the ID of the actual trace and will be used for updates and will be visible within the Langfuse App.\nI.e. if you want to update a trace, you'd use the same body id, but separate event IDs.\n\nNotes:\n\n- Introduction to data model: https://langfuse.com/docs/tracing-data-model\n- Batch sizes are limited to 3.5 MB in total. You need to adjust the number of events per batch accordingly.\n- 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.",+ "url": {+ "raw": "{{baseUrl}}/api/public/ingestion",+ "host": [+ "{{baseUrl}}"+ ],+ "path": [+ "api",+ "public",+ "ingestion"+ ],+ "query": [],+ "variable": []+ },+ "header": [+ {+ "type": "text",+ "key": "Content-Type",+ "value": "application/json"+ }+ ],+ "method": "POST",+ "auth": null,+ "body": {+ "mode": "raw",+ "raw": "{\n \"batch\": [\n {\n \"id\": \"abcdef-1234-5678-90ab\",\n \"timestamp\": \"2022-01-01T00:00:00.000Z\",\n \"type\": \"trace-create\",\n \"body\": {\n \"id\": \"abcdef-1234-5678-90ab\",\n \"timestamp\": \"2022-01-01T00:00:00.000Z\",\n \"name\": \"My Trace\",\n \"userId\": \"1234-5678-90ab-cdef\",\n \"input\": \"My input\",\n \"output\": \"My output\",\n \"sessionId\": \"1234-5678-90ab-cdef\",\n \"release\": \"1.0.0\",\n \"version\": \"1.0.0\",\n \"metadata\": \"My metadata\",\n \"tags\": [\n \"tag1\",\n \"tag2\"\n ],\n \"public\": true\n }\n }\n ]\n}",+ "options": {+ "raw": {+ "language": "json"+ }+ }+ }+ },+ "description": null,+ "body": "{\n \"successes\": [\n {\n \"id\": \"abcdef-1234-5678-90ab\",\n \"status\": 201\n }\n ],\n \"errors\": []\n}",+ "_postman_previewlanguage": "json"+ },+ {+ "name": "Success",+ "status": "OK",+ "code": 200,+ "originalRequest": {+ "description": "Batched ingestion for Langfuse Tracing.\nIf you want to use tracing via the API, such as to build your own Langfuse client implementation, this is the only API route you need to implement.\n\nWithin each batch, there can be multiple events.\nEach event has a type, an id, a timestamp, metadata and a body.\nInternally, we refer to this as the \"event envelope\" as it tells us something about the event but not the trace.\nWe use the event id within this envelope to deduplicate messages to avoid processing the same event twice, i.e. the event id should be unique per request.\nThe event.body.id is the ID of the actual trace and will be used for updates and will be visible within the Langfuse App.\nI.e. if you want to update a trace, you'd use the same body id, but separate event IDs.\n\nNotes:\n\n- Introduction to data model: https://langfuse.com/docs/tracing-data-model\n- Batch sizes are limited to 3.5 MB in total. You need to adjust the number of events per batch accordingly.\n- 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.",+ "url": {+ "raw": "{{baseUrl}}/api/public/ingestion",+ "host": [+ "{{baseUrl}}"+ ],+ "path": [+ "api",+ "public",+ "ingestion"+ ],+ "query": [],+ "variable": []+ },+ "header": [+ {+ "type": "text",+ "key": "Content-Type",+ "value": "application/json"+ }+ ],+ "method": "POST",+ "auth": null,+ "body": {+ "mode": "raw",+ "raw": "{\n \"batch\": [\n {\n \"id\": \"abcdef-1234-5678-90ab\",\n \"timestamp\": \"2022-01-01T00:00:00.000Z\",\n \"type\": \"span-create\",\n \"body\": {\n \"id\": \"abcdef-1234-5678-90ab\",\n \"traceId\": \"1234-5678-90ab-cdef\",\n \"startTime\": \"2022-01-01T00:00:00.000Z\"\n }\n }\n ]\n}",+ "options": {+ "raw": {+ "language": "json"+ }+ }+ }+ },+ "description": null,+ "body": "{\n \"successes\": [\n {\n \"id\": \"abcdef-1234-5678-90ab\",\n \"status\": 201\n }\n ],\n \"errors\": []\n}",+ "_postman_previewlanguage": "json"+ },+ {+ "name": "Success",+ "status": "OK",+ "code": 200,+ "originalRequest": {+ "description": "Batched ingestion for Langfuse Tracing.\nIf you want to use tracing via the API, such as to build your own Langfuse client implementation, this is the only API route you need to implement.\n\nWithin each batch, there can be multiple events.\nEach event has a type, an id, a timestamp, metadata and a body.\nInternally, we refer to this as the \"event envelope\" as it tells us something about the event but not the trace.\nWe use the event id within this envelope to deduplicate messages to avoid processing the same event twice, i.e. the event id should be unique per request.\nThe event.body.id is the ID of the actual trace and will be used for updates and will be visible within the Langfuse App.\nI.e. if you want to update a trace, you'd use the same body id, but separate event IDs.\n\nNotes:\n\n- Introduction to data model: https://langfuse.com/docs/tracing-data-model\n- Batch sizes are limited to 3.5 MB in total. You need to adjust the number of events per batch accordingly.\n- 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.",+ "url": {+ "raw": "{{baseUrl}}/api/public/ingestion",+ "host": [+ "{{baseUrl}}"+ ],+ "path": [+ "api",+ "public",+ "ingestion"+ ],+ "query": [],+ "variable": []+ },+ "header": [+ {+ "type": "text",+ "key": "Content-Type",+ "value": "application/json"+ }+ ],+ "method": "POST",+ "auth": null,+ "body": {+ "mode": "raw",+ "raw": "{\n \"batch\": [\n {\n \"id\": \"abcdef-1234-5678-90ab\",\n \"timestamp\": \"2022-01-01T00:00:00.000Z\",\n \"type\": \"score-create\",\n \"body\": {\n \"id\": \"abcdef-1234-5678-90ab\",\n \"traceId\": \"1234-5678-90ab-cdef\",\n \"name\": \"My Score\",\n \"value\": 0.9\n }\n }\n ]\n}",+ "options": {+ "raw": {+ "language": "json"+ }+ }+ }+ },+ "description": null,+ "body": "{\n \"successes\": [\n {\n \"id\": \"abcdef-1234-5678-90ab\",\n \"status\": 201\n }\n ],\n \"errors\": []\n}",+ "_postman_previewlanguage": "json"+ }+ ]}]},