Skip to content

Commit f09a15f

Browse files
author
langfuse-bot
committed
feat(api): update API spec from langfuse/langfuse c04b990
1 parent 600325d commit f09a15f

File tree

9 files changed

+79
-3
lines changed

9 files changed

+79
-3
lines changed

langfuse/api/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@
137137
OpenAiResponseUsageSchema,
138138
OpenAiUsage,
139139
OptionalObservationBody,
140+
Organization,
140141
OrganizationApiKey,
141142
OrganizationApiKeysResponse,
142143
OrganizationProject,
@@ -392,6 +393,7 @@
392393
"OpenAiResponseUsageSchema",
393394
"OpenAiUsage",
394395
"OptionalObservationBody",
396+
"Organization",
395397
"OrganizationApiKey",
396398
"OrganizationApiKeysResponse",
397399
"OrganizationProject",

langfuse/api/reference.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3191,6 +3191,8 @@ JSON string containing the query parameters with the following structure:
31913191

31923192
Get metrics from the Langfuse project using a query object.
31933193

3194+
Consider using the [v2 metrics endpoint](/api-reference/metrics-v2/metrics) for better performance.
3195+
31943196
For more details, see the [Metrics API documentation](https://langfuse.com/docs/metrics/features/metrics-api).
31953197
</dd>
31963198
</dl>
@@ -4007,7 +4009,9 @@ client.observations.get(
40074009
<dl>
40084010
<dd>
40094011

4010-
Get a list of observations
4012+
Get a list of observations.
4013+
4014+
Consider using the [v2 observations endpoint](/api-reference/observations-v2/getMany) for cursor-based pagination and field selection.
40114015
</dd>
40124016
</dl>
40134017
</dd>

langfuse/api/resources/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,7 @@
211211
ApiKeyList,
212212
ApiKeyResponse,
213213
ApiKeySummary,
214+
Organization,
214215
Project,
215216
ProjectDeletionResponse,
216217
Projects,
@@ -412,6 +413,7 @@
412413
"OpenAiResponseUsageSchema",
413414
"OpenAiUsage",
414415
"OptionalObservationBody",
416+
"Organization",
415417
"OrganizationApiKey",
416418
"OrganizationApiKeysResponse",
417419
"OrganizationProject",

langfuse/api/resources/metrics/client.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ def metrics(
2525
"""
2626
Get metrics from the Langfuse project using a query object.
2727
28+
Consider using the [v2 metrics endpoint](/api-reference/metrics-v2/metrics) for better performance.
29+
2830
For more details, see the [Metrics API documentation](https://langfuse.com/docs/metrics/features/metrics-api).
2931
3032
Parameters
@@ -138,6 +140,8 @@ async def metrics(
138140
"""
139141
Get metrics from the Langfuse project using a query object.
140142
143+
Consider using the [v2 metrics endpoint](/api-reference/metrics-v2/metrics) for better performance.
144+
141145
For more details, see the [Metrics API documentation](https://langfuse.com/docs/metrics/features/metrics-api).
142146
143147
Parameters

langfuse/api/resources/observations/client.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,9 @@ def get_many(
111111
request_options: typing.Optional[RequestOptions] = None,
112112
) -> ObservationsViews:
113113
"""
114-
Get a list of observations
114+
Get a list of observations.
115+
116+
Consider using the [v2 observations endpoint](/api-reference/observations-v2/getMany) for cursor-based pagination and field selection.
115117
116118
Parameters
117119
----------
@@ -412,7 +414,9 @@ async def get_many(
412414
request_options: typing.Optional[RequestOptions] = None,
413415
) -> ObservationsViews:
414416
"""
415-
Get a list of observations
417+
Get a list of observations.
418+
419+
Consider using the [v2 observations endpoint](/api-reference/observations-v2/getMany) for cursor-based pagination and field selection.
416420
417421
Parameters
418422
----------

langfuse/api/resources/projects/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
ApiKeyList,
66
ApiKeyResponse,
77
ApiKeySummary,
8+
Organization,
89
Project,
910
ProjectDeletionResponse,
1011
Projects,
@@ -15,6 +16,7 @@
1516
"ApiKeyList",
1617
"ApiKeyResponse",
1718
"ApiKeySummary",
19+
"Organization",
1820
"Project",
1921
"ProjectDeletionResponse",
2022
"Projects",

langfuse/api/resources/projects/types/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
from .api_key_list import ApiKeyList
55
from .api_key_response import ApiKeyResponse
66
from .api_key_summary import ApiKeySummary
7+
from .organization import Organization
78
from .project import Project
89
from .project_deletion_response import ProjectDeletionResponse
910
from .projects import Projects
@@ -13,6 +14,7 @@
1314
"ApiKeyList",
1415
"ApiKeyResponse",
1516
"ApiKeySummary",
17+
"Organization",
1618
"Project",
1719
"ProjectDeletionResponse",
1820
"Projects",
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# This file was auto-generated by Fern from our API Definition.
2+
3+
import datetime as dt
4+
import typing
5+
6+
from ....core.datetime_utils import serialize_datetime
7+
from ....core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1
8+
9+
10+
class Organization(pydantic_v1.BaseModel):
11+
id: str = pydantic_v1.Field()
12+
"""
13+
The unique identifier of the organization
14+
"""
15+
16+
name: str = pydantic_v1.Field()
17+
"""
18+
The name of the organization
19+
"""
20+
21+
def json(self, **kwargs: typing.Any) -> str:
22+
kwargs_with_defaults: typing.Any = {
23+
"by_alias": True,
24+
"exclude_unset": True,
25+
**kwargs,
26+
}
27+
return super().json(**kwargs_with_defaults)
28+
29+
def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
30+
kwargs_with_defaults_exclude_unset: typing.Any = {
31+
"by_alias": True,
32+
"exclude_unset": True,
33+
**kwargs,
34+
}
35+
kwargs_with_defaults_exclude_none: typing.Any = {
36+
"by_alias": True,
37+
"exclude_none": True,
38+
**kwargs,
39+
}
40+
41+
return deep_union_pydantic_dicts(
42+
super().dict(**kwargs_with_defaults_exclude_unset),
43+
super().dict(**kwargs_with_defaults_exclude_none),
44+
)
45+
46+
class Config:
47+
frozen = True
48+
smart_union = True
49+
extra = pydantic_v1.Extra.allow
50+
json_encoders = {dt.datetime: serialize_datetime}

langfuse/api/resources/projects/types/project.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,17 @@
55

66
from ....core.datetime_utils import serialize_datetime
77
from ....core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1
8+
from .organization import Organization
89

910

1011
class Project(pydantic_v1.BaseModel):
1112
id: str
1213
name: str
14+
organization: Organization = pydantic_v1.Field()
15+
"""
16+
The organization this project belongs to
17+
"""
18+
1319
metadata: typing.Dict[str, typing.Any] = pydantic_v1.Field()
1420
"""
1521
Metadata for the project

0 commit comments

Comments
 (0)