Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions langfuse/api/evaluators/types/cursor_meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@
import typing

import pydantic
from ...core.pydantic_utilities import UniversalBaseModel
from ...utils.pagination.types.cursor_meta_response import CursorMetaResponse


class CursorMeta(UniversalBaseModel):
cursor: typing.Optional[str] = pydantic.Field(default=None)
class CursorMeta(CursorMetaResponse):
"""
Opaque cursor for the next page. Omitted when there is no next page.
Cursor pagination metadata.
"""

model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(
Expand Down
7 changes: 3 additions & 4 deletions langfuse/api/experiments/types/experiments_response_meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@
import typing

import pydantic
from ...core.pydantic_utilities import UniversalBaseModel
from ...utils.pagination.types.cursor_meta_response import CursorMetaResponse


class ExperimentsResponseMeta(UniversalBaseModel):
cursor: typing.Optional[str] = pydantic.Field(default=None)
class ExperimentsResponseMeta(CursorMetaResponse):
"""
Versioned base64url cursor for retrieving the next page. Absent when there are no more results.
Metadata for cursor-based pagination.
"""

model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(
Expand Down
11 changes: 3 additions & 8 deletions langfuse/api/observations/types/observations_v2meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,12 @@
import typing

import pydantic
from ...core.pydantic_utilities import UniversalBaseModel
from ...utils.pagination.types.cursor_meta_response import CursorMetaResponse


class ObservationsV2Meta(UniversalBaseModel):
class ObservationsV2Meta(CursorMetaResponse):
"""
Metadata for cursor-based pagination
"""

cursor: typing.Optional[str] = pydantic.Field(default=None)
"""
Base64-encoded cursor to use for retrieving the next page. If not present, there are no more results.
Metadata for cursor-based pagination.
"""

model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(
Expand Down
8 changes: 2 additions & 6 deletions langfuse/api/scores_v3/types/get_scores_v3meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,11 @@
import typing

import pydantic
from ...core.pydantic_utilities import UniversalBaseModel
from ...utils.pagination.types.cursor_meta_response import CursorMetaResponse


class GetScoresV3Meta(UniversalBaseModel):
class GetScoresV3Meta(CursorMetaResponse):
limit: int
cursor: typing.Optional[str] = pydantic.Field(default=None)
"""
URL-safe base64 (base64url) cursor for the next page. Absent when there are no more results.
"""

model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(
extra="allow", frozen=True
Expand Down
5 changes: 3 additions & 2 deletions langfuse/api/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@

if typing.TYPE_CHECKING:
from . import pagination
from .pagination import MetaResponse
from .pagination import CursorMetaResponse, MetaResponse
_dynamic_imports: typing.Dict[str, str] = {
"CursorMetaResponse": ".pagination",
"MetaResponse": ".pagination",
"pagination": ".pagination",
}
Expand Down Expand Up @@ -41,4 +42,4 @@ def __dir__():
return sorted(lazy_attrs)


__all__ = ["MetaResponse", "pagination"]
__all__ = ["CursorMetaResponse", "MetaResponse", "pagination"]
9 changes: 6 additions & 3 deletions langfuse/api/utils/pagination/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@
from importlib import import_module

if typing.TYPE_CHECKING:
from .types import MetaResponse
_dynamic_imports: typing.Dict[str, str] = {"MetaResponse": ".types"}
from .types import CursorMetaResponse, MetaResponse
_dynamic_imports: typing.Dict[str, str] = {
"CursorMetaResponse": ".types",
"MetaResponse": ".types",
}


def __getattr__(attr_name: str) -> typing.Any:
Expand Down Expand Up @@ -37,4 +40,4 @@ def __dir__():
return sorted(lazy_attrs)


__all__ = ["MetaResponse"]
__all__ = ["CursorMetaResponse", "MetaResponse"]
8 changes: 6 additions & 2 deletions langfuse/api/utils/pagination/types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,12 @@
from importlib import import_module

if typing.TYPE_CHECKING:
from .cursor_meta_response import CursorMetaResponse
from .meta_response import MetaResponse
_dynamic_imports: typing.Dict[str, str] = {"MetaResponse": ".meta_response"}
_dynamic_imports: typing.Dict[str, str] = {
"CursorMetaResponse": ".cursor_meta_response",
"MetaResponse": ".meta_response",
}


def __getattr__(attr_name: str) -> typing.Any:
Expand Down Expand Up @@ -37,4 +41,4 @@ def __dir__():
return sorted(lazy_attrs)


__all__ = ["MetaResponse"]
__all__ = ["CursorMetaResponse", "MetaResponse"]
21 changes: 21 additions & 0 deletions langfuse/api/utils/pagination/types/cursor_meta_response.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# This file was auto-generated by Fern from our API Definition.

import typing

import pydantic
from ....core.pydantic_utilities import UniversalBaseModel


class CursorMetaResponse(UniversalBaseModel):
"""
Metadata for cursor-based pagination.
"""

cursor: typing.Optional[str] = pydantic.Field(default=None)
"""
Opaque cursor for the next page. Omitted when there is no next page.
"""

model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(
extra="allow", frozen=True
)
Loading