Skip to content
Closed
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
6 changes: 3 additions & 3 deletions langfuse/api/commons/types/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

class Model(UniversalBaseModel):
"""
Model definition used for transforming usage into USD cost and/or tokenization.
Model definition used for calculating USD cost from usage submitted with observations.

Models can have either simple flat pricing or tiered pricing:
- Flat pricing: Single price per usage type (legacy, but still supported)
Expand Down Expand Up @@ -77,14 +77,14 @@ class Model(UniversalBaseModel):
typing.Optional[str], FieldMetadata(alias="tokenizerId")
] = pydantic.Field(default=None)
"""
Optional. Tokenizer to be applied to observations which match to this model. See docs for more details.
Legacy tokenizer identifier retained for API compatibility. Ingestion no longer uses it to infer observation usage.
"""

tokenizer_config: typing_extensions.Annotated[
typing.Any, FieldMetadata(alias="tokenizerConfig")
] = pydantic.Field()
"""
Optional. Configuration for the selected tokenizer. Needs to be JSON. See docs for more details.
Legacy tokenizer configuration retained for API compatibility. Ingestion no longer uses it to infer observation usage.
"""

is_langfuse_managed: typing_extensions.Annotated[
Expand Down
16 changes: 8 additions & 8 deletions langfuse/api/models/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,10 @@ def create(
which will automatically create a single default tier named "Standard".

tokenizer_id : typing.Optional[ModelTokenizerId]
Optional. Tokenizer to be applied to observations which match to this model. See docs for more details.
Legacy tokenizer identifier retained for API compatibility. Ingestion no longer uses it to infer observation usage.

tokenizer_config : typing.Optional[typing.Any]
Optional. Configuration for the selected tokenizer. Needs to be JSON. See docs for more details.
Legacy tokenizer configuration retained for API compatibility. Ingestion no longer uses it to infer observation usage.

request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Expand Down Expand Up @@ -204,10 +204,10 @@ def upsert(
which will automatically create a single default tier named "Standard".

tokenizer_id : typing.Optional[ModelTokenizerId]
Optional. Tokenizer to be applied to observations which match to this model. See docs for more details.
Legacy tokenizer identifier retained for API compatibility. Ingestion no longer uses it to infer observation usage.

tokenizer_config : typing.Optional[typing.Any]
Optional. Configuration for the selected tokenizer. Needs to be JSON. See docs for more details.
Legacy tokenizer configuration retained for API compatibility. Ingestion no longer uses it to infer observation usage.

request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Expand Down Expand Up @@ -446,10 +446,10 @@ async def create(
which will automatically create a single default tier named "Standard".

tokenizer_id : typing.Optional[ModelTokenizerId]
Optional. Tokenizer to be applied to observations which match to this model. See docs for more details.
Legacy tokenizer identifier retained for API compatibility. Ingestion no longer uses it to infer observation usage.

tokenizer_config : typing.Optional[typing.Any]
Optional. Configuration for the selected tokenizer. Needs to be JSON. See docs for more details.
Legacy tokenizer configuration retained for API compatibility. Ingestion no longer uses it to infer observation usage.

request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Expand Down Expand Up @@ -565,10 +565,10 @@ async def upsert(
which will automatically create a single default tier named "Standard".

tokenizer_id : typing.Optional[ModelTokenizerId]
Optional. Tokenizer to be applied to observations which match to this model. See docs for more details.
Legacy tokenizer identifier retained for API compatibility. Ingestion no longer uses it to infer observation usage.

tokenizer_config : typing.Optional[typing.Any]
Optional. Configuration for the selected tokenizer. Needs to be JSON. See docs for more details.
Legacy tokenizer configuration retained for API compatibility. Ingestion no longer uses it to infer observation usage.

request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Expand Down
16 changes: 8 additions & 8 deletions langfuse/api/models/raw_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,10 @@ def create(
which will automatically create a single default tier named "Standard".

tokenizer_id : typing.Optional[ModelTokenizerId]
Optional. Tokenizer to be applied to observations which match to this model. See docs for more details.
Legacy tokenizer identifier retained for API compatibility. Ingestion no longer uses it to infer observation usage.

tokenizer_config : typing.Optional[typing.Any]
Optional. Configuration for the selected tokenizer. Needs to be JSON. See docs for more details.
Legacy tokenizer configuration retained for API compatibility. Ingestion no longer uses it to infer observation usage.

request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Expand Down Expand Up @@ -269,10 +269,10 @@ def upsert(
which will automatically create a single default tier named "Standard".

tokenizer_id : typing.Optional[ModelTokenizerId]
Optional. Tokenizer to be applied to observations which match to this model. See docs for more details.
Legacy tokenizer identifier retained for API compatibility. Ingestion no longer uses it to infer observation usage.

tokenizer_config : typing.Optional[typing.Any]
Optional. Configuration for the selected tokenizer. Needs to be JSON. See docs for more details.
Legacy tokenizer configuration retained for API compatibility. Ingestion no longer uses it to infer observation usage.

request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Expand Down Expand Up @@ -753,10 +753,10 @@ async def create(
which will automatically create a single default tier named "Standard".

tokenizer_id : typing.Optional[ModelTokenizerId]
Optional. Tokenizer to be applied to observations which match to this model. See docs for more details.
Legacy tokenizer identifier retained for API compatibility. Ingestion no longer uses it to infer observation usage.

tokenizer_config : typing.Optional[typing.Any]
Optional. Configuration for the selected tokenizer. Needs to be JSON. See docs for more details.
Legacy tokenizer configuration retained for API compatibility. Ingestion no longer uses it to infer observation usage.

request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Expand Down Expand Up @@ -930,10 +930,10 @@ async def upsert(
which will automatically create a single default tier named "Standard".

tokenizer_id : typing.Optional[ModelTokenizerId]
Optional. Tokenizer to be applied to observations which match to this model. See docs for more details.
Legacy tokenizer identifier retained for API compatibility. Ingestion no longer uses it to infer observation usage.

tokenizer_config : typing.Optional[typing.Any]
Optional. Configuration for the selected tokenizer. Needs to be JSON. See docs for more details.
Legacy tokenizer configuration retained for API compatibility. Ingestion no longer uses it to infer observation usage.

request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Expand Down
4 changes: 2 additions & 2 deletions langfuse/api/models/types/create_model_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,14 @@ class CreateModelRequest(UniversalBaseModel):
typing.Optional[ModelTokenizerId], FieldMetadata(alias="tokenizerId")
] = pydantic.Field(default=None)
"""
Optional. Tokenizer to be applied to observations which match to this model. See docs for more details.
Legacy tokenizer identifier retained for API compatibility. Ingestion no longer uses it to infer observation usage.
"""

tokenizer_config: typing_extensions.Annotated[
typing.Optional[typing.Any], FieldMetadata(alias="tokenizerConfig")
] = pydantic.Field(default=None)
"""
Optional. Configuration for the selected tokenizer. Needs to be JSON. See docs for more details.
Legacy tokenizer configuration retained for API compatibility. Ingestion no longer uses it to infer observation usage.
"""

model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(
Expand Down
2 changes: 1 addition & 1 deletion langfuse/api/models/types/model_tokenizer_id.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

class ModelTokenizerId(enum.StrEnum):
"""
Tokenizer supported by Langfuse for model usage inference.
Legacy tokenizer identifier retained for API compatibility. Ingestion no longer uses it to infer observation usage.
"""

OPENAI = "openai"
Expand Down
14 changes: 10 additions & 4 deletions langfuse/api/observations/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,10 @@ def get_many(
## Cursor-based Pagination
This endpoint uses cursor-based pagination for efficient traversal of large datasets.
The cursor is returned in the response metadata and should be passed in subsequent requests
to retrieve the next page of results.
to retrieve the next page of results. The `limit` parameter is a maximum: a page may contain
fewer items than the requested limit, including zero items, while `meta.cursor` is present.
Continue requesting pages until `meta.cursor` is absent.
Requests without a lower start-time bound may search only from January 1, 2020.

## Field Selection
Use the `fields` parameter to control which observation fields are returned:
Expand Down Expand Up @@ -92,7 +95,7 @@ def get_many(
Example: "key1,key2"

limit : typing.Optional[int]
Number of items to return per page. Maximum 1000, default 50.
Maximum number of items to return per page. A page may contain fewer items, including zero items, while meta.cursor is present. Maximum 1000, default 50.

cursor : typing.Optional[str]
Base64-encoded cursor for pagination. Use the cursor from the previous response to get the next page.
Expand Down Expand Up @@ -342,7 +345,10 @@ async def get_many(
## Cursor-based Pagination
This endpoint uses cursor-based pagination for efficient traversal of large datasets.
The cursor is returned in the response metadata and should be passed in subsequent requests
to retrieve the next page of results.
to retrieve the next page of results. The `limit` parameter is a maximum: a page may contain
fewer items than the requested limit, including zero items, while `meta.cursor` is present.
Continue requesting pages until `meta.cursor` is absent.
Requests without a lower start-time bound may search only from January 1, 2020.

## Field Selection
Use the `fields` parameter to control which observation fields are returned:
Expand Down Expand Up @@ -378,7 +384,7 @@ async def get_many(
Example: "key1,key2"

limit : typing.Optional[int]
Number of items to return per page. Maximum 1000, default 50.
Maximum number of items to return per page. A page may contain fewer items, including zero items, while meta.cursor is present. Maximum 1000, default 50.

cursor : typing.Optional[str]
Base64-encoded cursor for pagination. Use the cursor from the previous response to get the next page.
Expand Down
14 changes: 10 additions & 4 deletions langfuse/api/observations/raw_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,10 @@ def get_many(
## Cursor-based Pagination
This endpoint uses cursor-based pagination for efficient traversal of large datasets.
The cursor is returned in the response metadata and should be passed in subsequent requests
to retrieve the next page of results.
to retrieve the next page of results. The `limit` parameter is a maximum: a page may contain
fewer items than the requested limit, including zero items, while `meta.cursor` is present.
Continue requesting pages until `meta.cursor` is absent.
Requests without a lower start-time bound may search only from January 1, 2020.

## Field Selection
Use the `fields` parameter to control which observation fields are returned:
Expand Down Expand Up @@ -90,7 +93,7 @@ def get_many(
Example: "key1,key2"

limit : typing.Optional[int]
Number of items to return per page. Maximum 1000, default 50.
Maximum number of items to return per page. A page may contain fewer items, including zero items, while meta.cursor is present. Maximum 1000, default 50.

cursor : typing.Optional[str]
Base64-encoded cursor for pagination. Use the cursor from the previous response to get the next page.
Expand Down Expand Up @@ -399,7 +402,10 @@ async def get_many(
## Cursor-based Pagination
This endpoint uses cursor-based pagination for efficient traversal of large datasets.
The cursor is returned in the response metadata and should be passed in subsequent requests
to retrieve the next page of results.
to retrieve the next page of results. The `limit` parameter is a maximum: a page may contain
fewer items than the requested limit, including zero items, while `meta.cursor` is present.
Continue requesting pages until `meta.cursor` is absent.
Requests without a lower start-time bound may search only from January 1, 2020.

## Field Selection
Use the `fields` parameter to control which observation fields are returned:
Expand Down Expand Up @@ -435,7 +441,7 @@ async def get_many(
Example: "key1,key2"

limit : typing.Optional[int]
Number of items to return per page. Maximum 1000, default 50.
Maximum number of items to return per page. A page may contain fewer items, including zero items, while meta.cursor is present. Maximum 1000, default 50.

cursor : typing.Optional[str]
Base64-encoded cursor for pagination. Use the cursor from the previous response to get the next page.
Expand Down
5 changes: 5 additions & 0 deletions langfuse/api/observations/types/observations_v2meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ class ObservationsV2Meta(CursorMetaResponse):
Metadata for cursor-based pagination.
"""

comment: typing.Optional[str] = pydantic.Field(default=None)
"""
Present when an empty page has a cursor; continue requesting pages until the cursor is absent.
"""

model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(
extra="allow", frozen=True
)
4 changes: 3 additions & 1 deletion langfuse/api/observations/types/observations_v2response.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ class ObservationsV2Response(UniversalBaseModel):
Response containing observations with field-group-based filtering and cursor-based pagination.

The `data` array contains observation objects with only the requested field groups included.
Use the `cursor` in `meta` to retrieve the next page of results.
Use the `cursor` in `meta` to retrieve the next page of results. The array may contain fewer
than the requested `limit` items, or be empty, while a cursor is present. Continue until the
cursor is absent.
"""

data: typing.List[ObservationV2] = pydantic.Field()
Expand Down
33 changes: 33 additions & 0 deletions langfuse/api/unstable/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,24 @@
)
from .topics import (
Topic,
TopicAssignment,
TopicAssignmentList,
TopicAssignmentStatus,
TopicAssignmentTopic,
TopicFacet,
TopicFacetCounts,
TopicFacetList,
TopicFacetPublishedRun,
TopicFacetRef,
TopicList,
TopicResultListMeta,
TopicResultsOrderBy,
TopicRule,
TopicRuleList,
TopicStatusCounts,
TopicSummary,
TopicSummaryList,
TopicSummaryState,
TopicWindow,
TopicWithStatus,
TopicsOrderBy,
Expand Down Expand Up @@ -115,13 +126,24 @@
"PublicApiValidationIssue": ".errors",
"TooManyRequestsError": ".errors",
"Topic": ".topics",
"TopicAssignment": ".topics",
"TopicAssignmentList": ".topics",
"TopicAssignmentStatus": ".topics",
"TopicAssignmentTopic": ".topics",
"TopicFacet": ".topics",
"TopicFacetCounts": ".topics",
"TopicFacetList": ".topics",
"TopicFacetPublishedRun": ".topics",
"TopicFacetRef": ".topics",
"TopicList": ".topics",
"TopicResultListMeta": ".topics",
"TopicResultsOrderBy": ".topics",
"TopicRule": ".topics",
"TopicRuleList": ".topics",
"TopicStatusCounts": ".topics",
"TopicSummary": ".topics",
"TopicSummaryList": ".topics",
"TopicSummaryState": ".topics",
"TopicWindow": ".topics",
"TopicWithStatus": ".topics",
"TopicsOrderBy": ".topics",
Expand Down Expand Up @@ -207,13 +229,24 @@ def __dir__():
"PublicApiValidationIssue",
"TooManyRequestsError",
"Topic",
"TopicAssignment",
"TopicAssignmentList",
"TopicAssignmentStatus",
"TopicAssignmentTopic",
"TopicFacet",
"TopicFacetCounts",
"TopicFacetList",
"TopicFacetPublishedRun",
"TopicFacetRef",
"TopicList",
"TopicResultListMeta",
"TopicResultsOrderBy",
"TopicRule",
"TopicRuleList",
"TopicStatusCounts",
"TopicSummary",
"TopicSummaryList",
"TopicSummaryState",
"TopicWindow",
"TopicWithStatus",
"TopicsOrderBy",
Expand Down
Loading
Loading