You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: langfuse/api/reference.md
+18-24
Original file line number
Diff line number
Diff line change
@@ -1120,7 +1120,15 @@ client.health.health()
1120
1120
<dl>
1121
1121
<dd>
1122
1122
1123
-
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.
1123
+
Batched ingestion for Langfuse Tracing.
1124
+
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.
1125
+
1126
+
Within each batch, there can be multiple events.
1127
+
Each event has a type, an id, a timestamp, metadata and a body.
1128
+
Internally, we refer to this as the "event envelope" as it tells us something about the event but not the trace.
1129
+
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.
1130
+
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.
1131
+
I.e. if you want to update a trace, you'd use the same body id, but separate event IDs.
1124
1132
1125
1133
Notes:
1126
1134
@@ -1141,9 +1149,7 @@ Notes:
1141
1149
<dd>
1142
1150
1143
1151
```python
1144
-
import datetime
1145
-
1146
-
from langfuse import IngestionEvent_TraceCreate, TraceBody
1152
+
from langfuse import IngestionEvent_ScoreCreate, ScoreBody
The environment from which this score originated. Can be any lowercase alphanumeric string with hyphens and underscores that does not start with 'langfuse'.
Copy file name to clipboardexpand all lines: langfuse/api/resources/commons/types/observation.py
+5
Original file line number
Diff line number
Diff line change
@@ -125,6 +125,11 @@ class Observation(pydantic_v1.BaseModel):
125
125
The cost details of the observation. Key is the name of the cost metric, value is the cost in USD. The total key is the sum of all (non-total) cost metrics or the total value ingested.
The environment from which this observation originated. Can be any lowercase alphanumeric string with hyphens and underscores that does not start with 'langfuse'.
The environment from which this trace originated. Can be any lowercase alphanumeric string with hyphens and underscores that does not start with 'langfuse'.
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.
34
+
Batched ingestion for Langfuse Tracing.
35
+
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.
36
+
37
+
Within each batch, there can be multiple events.
38
+
Each event has a type, an id, a timestamp, metadata and a body.
39
+
Internally, we refer to this as the "event envelope" as it tells us something about the event but not the trace.
40
+
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.
41
+
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.
42
+
I.e. if you want to update a trace, you'd use the same body id, but separate event IDs.
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.
151
+
Batched ingestion for Langfuse Tracing.
152
+
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.
153
+
154
+
Within each batch, there can be multiple events.
155
+
Each event has a type, an id, a timestamp, metadata and a body.
156
+
Internally, we refer to this as the "event envelope" as it tells us something about the event but not the trace.
157
+
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.
158
+
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.
159
+
I.e. if you want to update a trace, you'd use the same body id, but separate event IDs.
Copy file name to clipboardexpand all lines: langfuse/api/resources/ingestion/types/score_body.py
+1
Original file line number
Diff line number
Diff line change
@@ -25,6 +25,7 @@ class ScoreBody(pydantic_v1.BaseModel):
25
25
id: typing.Optional[str] =None
26
26
trace_id: str=pydantic_v1.Field(alias="traceId")
27
27
name: str
28
+
environment: typing.Optional[str] =None
28
29
value: CreateScoreValue=pydantic_v1.Field()
29
30
"""
30
31
The value of the score. Must be passed as string for categorical scores, and numeric for boolean and numeric scores. Boolean score values must equal either 1 or 0 (true or false)
0 commit comments