Skip to content

Commit d3a7d0e

Browse files
langfuse-botlangfuse-bot
andauthored
feat(api): update API spec from langfuse/langfuse 7cb2eed (#2000)
Co-authored-by: langfuse-bot <langfuse-bot@langfuse.com>
1 parent 6599a97 commit d3a7d0e

40 files changed

Lines changed: 17 additions & 1807 deletions

‎langfuse/api/__init__.py‎

Lines changed: 4 additions & 120 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
experiments,
2121
feedback,
2222
health,
23-
ingestion,
2423
llm_connections,
2524
media,
2625
metrics,
@@ -101,6 +100,7 @@
101100
NumericScore,
102101
ObservationLevel,
103102
ObservationV2,
103+
OpenAiUsage,
104104
PricingTier,
105105
PricingTierAttributeCondition,
106106
PricingTierAttributeSource,
@@ -257,47 +257,6 @@
257257
SubmitFeedbackResponse,
258258
)
259259
from .health import HealthResponse, ServiceUnavailableError
260-
from .ingestion import (
261-
BaseEvent,
262-
CreateEventBody,
263-
CreateEventEvent,
264-
CreateGenerationBody,
265-
CreateGenerationEvent,
266-
CreateObservationEvent,
267-
CreateSpanBody,
268-
CreateSpanEvent,
269-
IngestionError,
270-
IngestionEvent,
271-
IngestionEvent_EventCreate,
272-
IngestionEvent_GenerationCreate,
273-
IngestionEvent_GenerationUpdate,
274-
IngestionEvent_ObservationCreate,
275-
IngestionEvent_ObservationUpdate,
276-
IngestionEvent_ScoreCreate,
277-
IngestionEvent_SpanCreate,
278-
IngestionEvent_SpanUpdate,
279-
IngestionEvent_TraceCreate,
280-
IngestionResponse,
281-
IngestionSuccess,
282-
IngestionUsage,
283-
ObservationBody,
284-
ObservationType,
285-
OpenAiCompletionUsageSchema,
286-
OpenAiResponseUsageSchema,
287-
OpenAiUsage,
288-
OptionalObservationBody,
289-
ScoreBody,
290-
ScoreEvent,
291-
TraceBody,
292-
TraceEvent,
293-
UpdateEventBody,
294-
UpdateGenerationBody,
295-
UpdateGenerationEvent,
296-
UpdateObservationEvent,
297-
UpdateSpanBody,
298-
UpdateSpanEvent,
299-
UsageDetails,
300-
)
301260
from .llm_connections import (
302261
DeleteLlmConnectionResponse,
303262
LlmAdapter,
@@ -407,6 +366,7 @@
407366
GetScoresV3Meta,
408367
GetScoresV3Response,
409368
NumericScoreV3,
369+
ScoreBody,
410370
ScoreSubjectExperimentV3,
411371
ScoreSubjectObservationV3,
412372
ScoreSubjectSessionV3,
@@ -440,7 +400,6 @@
440400
"AsyncLangfuseAPI": ".client",
441401
"AuthenticationScheme": ".scim",
442402
"BadRequestError": ".evaluation_errors",
443-
"BaseEvent": ".ingestion",
444403
"BasePrompt": ".prompts",
445404
"BaseScore": ".commons",
446405
"BaseScoreV3": ".scores",
@@ -491,13 +450,8 @@
491450
"CreateEvaluatorRequest": ".evaluators",
492451
"CreateEvaluatorRequest_Code": ".evaluators",
493452
"CreateEvaluatorRequest_LlmAsJudge": ".evaluators",
494-
"CreateEventBody": ".ingestion",
495-
"CreateEventEvent": ".ingestion",
496-
"CreateGenerationBody": ".ingestion",
497-
"CreateGenerationEvent": ".ingestion",
498453
"CreateLlmAsJudgeEvaluatorRequest": ".evaluators",
499454
"CreateModelRequest": ".models",
500-
"CreateObservationEvent": ".ingestion",
501455
"CreatePromptRequest": ".prompts",
502456
"CreateScoreBatchError": ".scores",
503457
"CreateScoreBatchResponse": ".scores",
@@ -508,8 +462,6 @@
508462
"CreateScoreValue": ".commons",
509463
"CreateScoresRequest": ".scores",
510464
"CreateScoresResponse": ".scores",
511-
"CreateSpanBody": ".ingestion",
512-
"CreateSpanEvent": ".ingestion",
513465
"CreateTextPromptRequest": ".prompts",
514466
"CreateTextPromptType": ".prompts",
515467
"Creator": ".evaluators",
@@ -600,20 +552,6 @@
600552
"GetScoresV3Meta": ".scores",
601553
"GetScoresV3Response": ".scores",
602554
"HealthResponse": ".health",
603-
"IngestionError": ".ingestion",
604-
"IngestionEvent": ".ingestion",
605-
"IngestionEvent_EventCreate": ".ingestion",
606-
"IngestionEvent_GenerationCreate": ".ingestion",
607-
"IngestionEvent_GenerationUpdate": ".ingestion",
608-
"IngestionEvent_ObservationCreate": ".ingestion",
609-
"IngestionEvent_ObservationUpdate": ".ingestion",
610-
"IngestionEvent_ScoreCreate": ".ingestion",
611-
"IngestionEvent_SpanCreate": ".ingestion",
612-
"IngestionEvent_SpanUpdate": ".ingestion",
613-
"IngestionEvent_TraceCreate": ".ingestion",
614-
"IngestionResponse": ".ingestion",
615-
"IngestionSuccess": ".ingestion",
616-
"IngestionUsage": ".ingestion",
617555
"InternalServerError": ".evaluation_errors",
618556
"LangfuseAPI": ".client",
619557
"LegacyEvaluationObject": ".evaluation_commons",
@@ -641,16 +579,11 @@
641579
"NumberObjectEvaluationRuleFilter": ".evaluation_commons",
642580
"NumericScore": ".commons",
643581
"NumericScoreV3": ".scores",
644-
"ObservationBody": ".ingestion",
645582
"ObservationLevel": ".commons",
646-
"ObservationType": ".ingestion",
647583
"ObservationV2": ".commons",
648584
"ObservationsV2Meta": ".observations",
649585
"ObservationsV2Response": ".observations",
650-
"OpenAiCompletionUsageSchema": ".ingestion",
651-
"OpenAiResponseUsageSchema": ".ingestion",
652-
"OpenAiUsage": ".ingestion",
653-
"OptionalObservationBody": ".ingestion",
586+
"OpenAiUsage": ".commons",
654587
"Organization": ".projects",
655588
"OrganizationApiKey": ".organizations",
656589
"OrganizationApiKeysResponse": ".organizations",
@@ -719,12 +652,11 @@
719652
"ScimUser": ".scim",
720653
"ScimUsersListResponse": ".scim",
721654
"Score": ".commons",
722-
"ScoreBody": ".ingestion",
655+
"ScoreBody": ".scores",
723656
"ScoreConfig": ".commons",
724657
"ScoreConfigDataType": ".commons",
725658
"ScoreConfigs": ".score_configs",
726659
"ScoreDataType": ".commons",
727-
"ScoreEvent": ".ingestion",
728660
"ScoreSource": ".commons",
729661
"ScoreSubjectExperimentV3": ".scores",
730662
"ScoreSubjectObservationV3": ".scores",
@@ -757,25 +689,16 @@
757689
"TextScore": ".commons",
758690
"TextScoreV3": ".scores",
759691
"TooManyRequestsError": ".evaluation_errors",
760-
"TraceBody": ".ingestion",
761-
"TraceEvent": ".ingestion",
762692
"UnauthorizedError": ".commons",
763693
"UpdateAnnotationQueueItemRequest": ".annotation_queues",
764694
"UpdateCodeEvaluatorRequest": ".evaluators",
765695
"UpdateEvaluationRuleRequest": ".evaluation_rules",
766696
"UpdateEvaluatorMetadataRequest": ".evaluators",
767697
"UpdateEvaluatorRequest": ".evaluators",
768-
"UpdateEventBody": ".ingestion",
769-
"UpdateGenerationBody": ".ingestion",
770-
"UpdateGenerationEvent": ".ingestion",
771698
"UpdateLlmAsJudgeEvaluatorRequest": ".evaluators",
772-
"UpdateObservationEvent": ".ingestion",
773699
"UpdateScoreConfigRequest": ".score_configs",
774-
"UpdateSpanBody": ".ingestion",
775-
"UpdateSpanEvent": ".ingestion",
776700
"UpsertLlmConnectionRequest": ".llm_connections",
777701
"Usage": ".commons",
778-
"UsageDetails": ".ingestion",
779702
"UserMeta": ".scim",
780703
"annotation_queues": ".annotation_queues",
781704
"blob_storage_integrations": ".blob_storage_integrations",
@@ -790,7 +713,6 @@
790713
"experiments": ".experiments",
791714
"feedback": ".feedback",
792715
"health": ".health",
793-
"ingestion": ".ingestion",
794716
"llm_connections": ".llm_connections",
795717
"media": ".media",
796718
"metrics": ".metrics",
@@ -852,7 +774,6 @@ def __dir__():
852774
"AsyncLangfuseAPI",
853775
"AuthenticationScheme",
854776
"BadRequestError",
855-
"BaseEvent",
856777
"BasePrompt",
857778
"BaseScore",
858779
"BaseScoreV3",
@@ -903,13 +824,8 @@ def __dir__():
903824
"CreateEvaluatorRequest",
904825
"CreateEvaluatorRequest_Code",
905826
"CreateEvaluatorRequest_LlmAsJudge",
906-
"CreateEventBody",
907-
"CreateEventEvent",
908-
"CreateGenerationBody",
909-
"CreateGenerationEvent",
910827
"CreateLlmAsJudgeEvaluatorRequest",
911828
"CreateModelRequest",
912-
"CreateObservationEvent",
913829
"CreatePromptRequest",
914830
"CreateScoreBatchError",
915831
"CreateScoreBatchResponse",
@@ -920,8 +836,6 @@ def __dir__():
920836
"CreateScoreValue",
921837
"CreateScoresRequest",
922838
"CreateScoresResponse",
923-
"CreateSpanBody",
924-
"CreateSpanEvent",
925839
"CreateTextPromptRequest",
926840
"CreateTextPromptType",
927841
"Creator",
@@ -1012,20 +926,6 @@ def __dir__():
1012926
"GetScoresV3Meta",
1013927
"GetScoresV3Response",
1014928
"HealthResponse",
1015-
"IngestionError",
1016-
"IngestionEvent",
1017-
"IngestionEvent_EventCreate",
1018-
"IngestionEvent_GenerationCreate",
1019-
"IngestionEvent_GenerationUpdate",
1020-
"IngestionEvent_ObservationCreate",
1021-
"IngestionEvent_ObservationUpdate",
1022-
"IngestionEvent_ScoreCreate",
1023-
"IngestionEvent_SpanCreate",
1024-
"IngestionEvent_SpanUpdate",
1025-
"IngestionEvent_TraceCreate",
1026-
"IngestionResponse",
1027-
"IngestionSuccess",
1028-
"IngestionUsage",
1029929
"InternalServerError",
1030930
"LangfuseAPI",
1031931
"LegacyEvaluationObject",
@@ -1053,16 +953,11 @@ def __dir__():
1053953
"NumberObjectEvaluationRuleFilter",
1054954
"NumericScore",
1055955
"NumericScoreV3",
1056-
"ObservationBody",
1057956
"ObservationLevel",
1058-
"ObservationType",
1059957
"ObservationV2",
1060958
"ObservationsV2Meta",
1061959
"ObservationsV2Response",
1062-
"OpenAiCompletionUsageSchema",
1063-
"OpenAiResponseUsageSchema",
1064960
"OpenAiUsage",
1065-
"OptionalObservationBody",
1066961
"Organization",
1067962
"OrganizationApiKey",
1068963
"OrganizationApiKeysResponse",
@@ -1136,7 +1031,6 @@ def __dir__():
11361031
"ScoreConfigDataType",
11371032
"ScoreConfigs",
11381033
"ScoreDataType",
1139-
"ScoreEvent",
11401034
"ScoreSource",
11411035
"ScoreSubjectExperimentV3",
11421036
"ScoreSubjectObservationV3",
@@ -1169,25 +1063,16 @@ def __dir__():
11691063
"TextScore",
11701064
"TextScoreV3",
11711065
"TooManyRequestsError",
1172-
"TraceBody",
1173-
"TraceEvent",
11741066
"UnauthorizedError",
11751067
"UpdateAnnotationQueueItemRequest",
11761068
"UpdateCodeEvaluatorRequest",
11771069
"UpdateEvaluationRuleRequest",
11781070
"UpdateEvaluatorMetadataRequest",
11791071
"UpdateEvaluatorRequest",
1180-
"UpdateEventBody",
1181-
"UpdateGenerationBody",
1182-
"UpdateGenerationEvent",
11831072
"UpdateLlmAsJudgeEvaluatorRequest",
1184-
"UpdateObservationEvent",
11851073
"UpdateScoreConfigRequest",
1186-
"UpdateSpanBody",
1187-
"UpdateSpanEvent",
11881074
"UpsertLlmConnectionRequest",
11891075
"Usage",
1190-
"UsageDetails",
11911076
"UserMeta",
11921077
"annotation_queues",
11931078
"blob_storage_integrations",
@@ -1202,7 +1087,6 @@ def __dir__():
12021087
"experiments",
12031088
"feedback",
12041089
"health",
1205-
"ingestion",
12061090
"llm_connections",
12071091
"media",
12081092
"metrics",

‎langfuse/api/client.py‎

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
from .experiments.client import AsyncExperimentsClient, ExperimentsClient
2828
from .feedback.client import AsyncFeedbackClient, FeedbackClient
2929
from .health.client import AsyncHealthClient, HealthClient
30-
from .ingestion.client import AsyncIngestionClient, IngestionClient
3130
from .llm_connections.client import AsyncLlmConnectionsClient, LlmConnectionsClient
3231
from .media.client import AsyncMediaClient, MediaClient
3332
from .metrics.client import AsyncMetricsClient, MetricsClient
@@ -135,7 +134,6 @@ def __init__(
135134
self._experiments: typing.Optional[ExperimentsClient] = None
136135
self._feedback: typing.Optional[FeedbackClient] = None
137136
self._health: typing.Optional[HealthClient] = None
138-
self._ingestion: typing.Optional[IngestionClient] = None
139137
self._llm_connections: typing.Optional[LlmConnectionsClient] = None
140138
self._media: typing.Optional[MediaClient] = None
141139
self._metrics: typing.Optional[MetricsClient] = None
@@ -240,14 +238,6 @@ def health(self):
240238
self._health = HealthClient(client_wrapper=self._client_wrapper)
241239
return self._health
242240

243-
@property
244-
def ingestion(self):
245-
if self._ingestion is None:
246-
from .ingestion.client import IngestionClient # noqa: E402
247-
248-
self._ingestion = IngestionClient(client_wrapper=self._client_wrapper)
249-
return self._ingestion
250-
251241
@property
252242
def llm_connections(self):
253243
if self._llm_connections is None:
@@ -469,7 +459,6 @@ def __init__(
469459
self._experiments: typing.Optional[AsyncExperimentsClient] = None
470460
self._feedback: typing.Optional[AsyncFeedbackClient] = None
471461
self._health: typing.Optional[AsyncHealthClient] = None
472-
self._ingestion: typing.Optional[AsyncIngestionClient] = None
473462
self._llm_connections: typing.Optional[AsyncLlmConnectionsClient] = None
474463
self._media: typing.Optional[AsyncMediaClient] = None
475464
self._metrics: typing.Optional[AsyncMetricsClient] = None
@@ -580,14 +569,6 @@ def health(self):
580569
self._health = AsyncHealthClient(client_wrapper=self._client_wrapper)
581570
return self._health
582571

583-
@property
584-
def ingestion(self):
585-
if self._ingestion is None:
586-
from .ingestion.client import AsyncIngestionClient # noqa: E402
587-
588-
self._ingestion = AsyncIngestionClient(client_wrapper=self._client_wrapper)
589-
return self._ingestion
590-
591572
@property
592573
def llm_connections(self):
593574
if self._llm_connections is None:

‎langfuse/api/commons/__init__.py‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
NumericScore,
3030
ObservationLevel,
3131
ObservationV2,
32+
OpenAiUsage,
3233
PricingTier,
3334
PricingTierAttributeCondition,
3435
PricingTierAttributeSource,
@@ -85,6 +86,7 @@
8586
"NumericScore": ".types",
8687
"ObservationLevel": ".types",
8788
"ObservationV2": ".types",
89+
"OpenAiUsage": ".types",
8890
"PricingTier": ".types",
8991
"PricingTierAttributeCondition": ".types",
9092
"PricingTierAttributeSource": ".types",
@@ -164,6 +166,7 @@ def __dir__():
164166
"NumericScore",
165167
"ObservationLevel",
166168
"ObservationV2",
169+
"OpenAiUsage",
167170
"PricingTier",
168171
"PricingTierAttributeCondition",
169172
"PricingTierAttributeSource",

0 commit comments

Comments
 (0)