diff --git a/langfuse/api/README.md b/langfuse/api/README.md index 78acd43f1..93549c0d6 100644 --- a/langfuse/api/README.md +++ b/langfuse/api/README.md @@ -1,14 +1,14 @@ -# Finto Python Library +# Langfuse Python Library -[![fern shield](https://img.shields.io/badge/%F0%9F%8C%BF-Built%20with%20Fern-brightgreen)](https://buildwithfern.com?utm_source=github&utm_medium=github&utm_campaign=readme&utm_source=Finto%2FPython) -[![pypi](https://img.shields.io/pypi/v/finto)](https://pypi.python.org/pypi/finto) +[![fern shield](https://img.shields.io/badge/%F0%9F%8C%BF-Built%20with%20Fern-brightgreen)](https://buildwithfern.com?utm_source=github&utm_medium=github&utm_campaign=readme&utm_source=Langfuse%2FPython) +[![pypi](https://img.shields.io/pypi/v/langfuse)](https://pypi.python.org/pypi/langfuse) -The Finto Python library provides convenient access to the Finto API from Python. +The Langfuse Python library provides convenient access to the Langfuse API from Python. ## Installation ```sh -pip install finto +pip install langfuse ``` ## Usage @@ -16,8 +16,8 @@ pip install finto Instantiate and use the client with the following: ```python -from langfuse.api import CreateCommentRequest -from langfuse.api.client import FernLangfuse +from langfuse import CreateCommentRequest +from langfuse.client import FernLangfuse client = FernLangfuse( x_langfuse_sdk_name="YOUR_X_LANGFUSE_SDK_NAME", @@ -45,8 +45,8 @@ The SDK also exports an `async` client so that you can make non-blocking calls t ```python import asyncio -from langfuse.api import CreateCommentRequest -from langfuse.api.client import AsyncFernLangfuse +from langfuse import CreateCommentRequest +from langfuse.client import AsyncFernLangfuse client = AsyncFernLangfuse( x_langfuse_sdk_name="YOUR_X_LANGFUSE_SDK_NAME", @@ -116,7 +116,7 @@ The SDK defaults to a 60 second timeout. You can configure this with a timeout o ```python -from langfuse.api.client import FernLangfuse +from langfuse.client import FernLangfuse client = FernLangfuse(..., { timeout=20.0 }, ) @@ -131,10 +131,9 @@ client.comments.create(...,{ You can override the `httpx` client to customize it for your use-case. Some common use-cases include support for proxies and transports. - ```python import httpx -from langfuse.api.client import FernLangfuse +from langfuse.client import FernLangfuse client = FernLangfuse( ..., diff --git a/langfuse/api/client.py b/langfuse/api/client.py index 0e71fe1be..674d62721 100644 --- a/langfuse/api/client.py +++ b/langfuse/api/client.py @@ -51,7 +51,7 @@ class FernLangfuse: Examples -------- - from langfuse.api.client import FernLangfuse + from langfuse.client import FernLangfuse client = FernLangfuse( x_langfuse_sdk_name="YOUR_X_LANGFUSE_SDK_NAME", @@ -140,7 +140,7 @@ class AsyncFernLangfuse: Examples -------- - from langfuse.api.client import AsyncFernLangfuse + from langfuse.client import AsyncFernLangfuse client = AsyncFernLangfuse( x_langfuse_sdk_name="YOUR_X_LANGFUSE_SDK_NAME", diff --git a/langfuse/api/reference.md b/langfuse/api/reference.md index 5e5642677..37683e9f7 100644 --- a/langfuse/api/reference.md +++ b/langfuse/api/reference.md @@ -1,8 +1,6 @@ # Reference - ## Comments - -
client.comments.create(...) +
client.comments.create(...)
@@ -15,7 +13,6 @@
Create a comment. Comments may be attached to different object types (trace, observation, session, prompt). -
@@ -30,8 +27,8 @@ Create a comment. Comments may be attached to different object types (trace, obs
```python -from langfuse.api import CreateCommentRequest -from langfuse.api.client import FernLangfuse +from langfuse import CreateCommentRequest +from langfuse.client import FernLangfuse client = FernLangfuse( x_langfuse_sdk_name="YOUR_X_LANGFUSE_SDK_NAME", @@ -52,7 +49,6 @@ client.comments.create( ) ``` -
@@ -66,8 +62,8 @@ client.comments.create(
-**request:** `CreateCommentRequest` - +**request:** `CreateCommentRequest` +
@@ -75,17 +71,18 @@ client.comments.create(
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - +
+
-
client.comments.get(...) +
client.comments.get(...)
@@ -98,7 +95,6 @@ client.comments.create(
Get all comments -
@@ -113,7 +109,7 @@ Get all comments
```python -from langfuse.api.client import FernLangfuse +from langfuse.client import FernLangfuse client = FernLangfuse( x_langfuse_sdk_name="YOUR_X_LANGFUSE_SDK_NAME", @@ -132,7 +128,6 @@ client.comments.get( ) ``` -
@@ -147,7 +142,7 @@ client.comments.get(
**page:** `typing.Optional[int]` — Page number, starts at 1. - +
@@ -155,7 +150,7 @@ client.comments.get(
**limit:** `typing.Optional[int]` — Limit of items per page. If you encounter api issues due to too large page sizes, try to reduce the limit - +
@@ -163,7 +158,7 @@ client.comments.get(
**object_type:** `typing.Optional[str]` — Filter comments by object type (trace, observation, session, prompt). - +
@@ -171,7 +166,7 @@ client.comments.get(
**object_id:** `typing.Optional[str]` — Filter comments by object id. If objectType is not provided, an error will be thrown. - +
@@ -179,7 +174,7 @@ client.comments.get(
**author_user_id:** `typing.Optional[str]` — Filter comments by author user id. - +
@@ -187,17 +182,18 @@ client.comments.get(
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - +
+
-
client.comments.get_by_id(...) +
client.comments.get_by_id(...)
@@ -210,7 +206,6 @@ client.comments.get(
Get a comment by id -
@@ -225,7 +220,7 @@ Get a comment by id
```python -from langfuse.api.client import FernLangfuse +from langfuse.client import FernLangfuse client = FernLangfuse( x_langfuse_sdk_name="YOUR_X_LANGFUSE_SDK_NAME", @@ -240,7 +235,6 @@ client.comments.get_by_id( ) ``` -
@@ -255,7 +249,7 @@ client.comments.get_by_id(
**comment_id:** `str` — The unique langfuse identifier of a comment - +
@@ -263,19 +257,19 @@ client.comments.get_by_id(
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - +
+
## DatasetItems - -
client.dataset_items.create(...) +
client.dataset_items.create(...)
@@ -288,7 +282,6 @@ client.comments.get_by_id(
Create a dataset item -
@@ -303,8 +296,8 @@ Create a dataset item
```python -from langfuse.api import CreateDatasetItemRequest, DatasetStatus -from langfuse.api.client import FernLangfuse +from langfuse import CreateDatasetItemRequest, DatasetStatus +from langfuse.client import FernLangfuse client = FernLangfuse( x_langfuse_sdk_name="YOUR_X_LANGFUSE_SDK_NAME", @@ -328,7 +321,6 @@ client.dataset_items.create( ) ``` -
@@ -342,8 +334,8 @@ client.dataset_items.create(
-**request:** `CreateDatasetItemRequest` - +**request:** `CreateDatasetItemRequest` +
@@ -351,17 +343,18 @@ client.dataset_items.create(
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - +
+
-
client.dataset_items.get(...) +
client.dataset_items.get(...)
@@ -374,7 +367,6 @@ client.dataset_items.create(
Get a dataset item -
@@ -389,7 +381,7 @@ Get a dataset item
```python -from langfuse.api.client import FernLangfuse +from langfuse.client import FernLangfuse client = FernLangfuse( x_langfuse_sdk_name="YOUR_X_LANGFUSE_SDK_NAME", @@ -404,7 +396,6 @@ client.dataset_items.get( ) ``` -
@@ -418,8 +409,8 @@ client.dataset_items.get(
-**id:** `str` - +**id:** `str` +
@@ -427,17 +418,18 @@ client.dataset_items.get(
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - +
+
-
client.dataset_items.list(...) +
client.dataset_items.list(...)
@@ -450,7 +442,6 @@ client.dataset_items.get(
Get dataset items -
@@ -465,7 +456,7 @@ Get dataset items
```python -from langfuse.api.client import FernLangfuse +from langfuse.client import FernLangfuse client = FernLangfuse( x_langfuse_sdk_name="YOUR_X_LANGFUSE_SDK_NAME", @@ -484,7 +475,6 @@ client.dataset_items.list( ) ``` -
@@ -498,24 +488,24 @@ client.dataset_items.list(
-**dataset_name:** `typing.Optional[str]` - +**dataset_name:** `typing.Optional[str]` +
-**source_trace_id:** `typing.Optional[str]` - +**source_trace_id:** `typing.Optional[str]` +
-**source_observation_id:** `typing.Optional[str]` - +**source_observation_id:** `typing.Optional[str]` +
@@ -523,7 +513,7 @@ client.dataset_items.list(
**page:** `typing.Optional[int]` — page number, starts at 1 - +
@@ -531,7 +521,7 @@ client.dataset_items.list(
**limit:** `typing.Optional[int]` — limit of items per page - +
@@ -539,19 +529,19 @@ client.dataset_items.list(
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - +
+
## DatasetRunItems - -
client.dataset_run_items.create(...) +
client.dataset_run_items.create(...)
@@ -564,7 +554,6 @@ client.dataset_items.list(
Create a dataset run item -
@@ -579,8 +568,8 @@ Create a dataset run item
```python -from langfuse.api import CreateDatasetRunItemRequest -from langfuse.api.client import FernLangfuse +from langfuse import CreateDatasetRunItemRequest +from langfuse.client import FernLangfuse client = FernLangfuse( x_langfuse_sdk_name="YOUR_X_LANGFUSE_SDK_NAME", @@ -602,7 +591,6 @@ client.dataset_run_items.create( ) ``` -
@@ -616,8 +604,8 @@ client.dataset_run_items.create(
-**request:** `CreateDatasetRunItemRequest` - +**request:** `CreateDatasetRunItemRequest` +
@@ -625,19 +613,19 @@ client.dataset_run_items.create(
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - +
+
## Datasets - -
client.datasets.list(...) +
client.datasets.list(...)
@@ -650,7 +638,6 @@ client.dataset_run_items.create(
Get all datasets -
@@ -665,7 +652,7 @@ Get all datasets
```python -from langfuse.api.client import FernLangfuse +from langfuse.client import FernLangfuse client = FernLangfuse( x_langfuse_sdk_name="YOUR_X_LANGFUSE_SDK_NAME", @@ -681,7 +668,6 @@ client.datasets.list( ) ``` -
@@ -696,7 +682,7 @@ client.datasets.list(
**page:** `typing.Optional[int]` — page number, starts at 1 - +
@@ -704,7 +690,7 @@ client.datasets.list(
**limit:** `typing.Optional[int]` — limit of items per page - +
@@ -712,17 +698,18 @@ client.datasets.list(
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - +
+
-
client.datasets.get(...) +
client.datasets.get(...)
@@ -735,7 +722,6 @@ client.datasets.list(
Get a dataset -
@@ -750,7 +736,7 @@ Get a dataset
```python -from langfuse.api.client import FernLangfuse +from langfuse.client import FernLangfuse client = FernLangfuse( x_langfuse_sdk_name="YOUR_X_LANGFUSE_SDK_NAME", @@ -765,7 +751,6 @@ client.datasets.get( ) ``` -
@@ -779,8 +764,8 @@ client.datasets.get(
-**dataset_name:** `str` - +**dataset_name:** `str` +
@@ -788,17 +773,18 @@ client.datasets.get(
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - +
+
-
client.datasets.create(...) +
client.datasets.create(...)
@@ -811,7 +797,6 @@ client.datasets.get(
Create a dataset -
@@ -826,8 +811,8 @@ Create a dataset
```python -from langfuse.api import CreateDatasetRequest -from langfuse.api.client import FernLangfuse +from langfuse import CreateDatasetRequest +from langfuse.client import FernLangfuse client = FernLangfuse( x_langfuse_sdk_name="YOUR_X_LANGFUSE_SDK_NAME", @@ -846,7 +831,6 @@ client.datasets.create( ) ``` -
@@ -860,8 +844,8 @@ client.datasets.create(
-**request:** `CreateDatasetRequest` - +**request:** `CreateDatasetRequest` +
@@ -869,17 +853,18 @@ client.datasets.create(
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - +
+
-
client.datasets.get_run(...) +
client.datasets.get_run(...)
@@ -892,7 +877,6 @@ client.datasets.create(
Get a dataset run and its items -
@@ -907,7 +891,7 @@ Get a dataset run and its items
```python -from langfuse.api.client import FernLangfuse +from langfuse.client import FernLangfuse client = FernLangfuse( x_langfuse_sdk_name="YOUR_X_LANGFUSE_SDK_NAME", @@ -923,7 +907,6 @@ client.datasets.get_run( ) ``` -
@@ -937,16 +920,16 @@ client.datasets.get_run(
-**dataset_name:** `str` - +**dataset_name:** `str` +
-**run_name:** `str` - +**run_name:** `str` +
@@ -954,17 +937,18 @@ client.datasets.get_run(
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - +
+
-
client.datasets.get_runs(...) +
client.datasets.get_runs(...)
@@ -977,7 +961,6 @@ client.datasets.get_run(
Get dataset runs -
@@ -992,7 +975,7 @@ Get dataset runs
```python -from langfuse.api.client import FernLangfuse +from langfuse.client import FernLangfuse client = FernLangfuse( x_langfuse_sdk_name="YOUR_X_LANGFUSE_SDK_NAME", @@ -1009,7 +992,6 @@ client.datasets.get_runs( ) ``` -
@@ -1023,8 +1005,8 @@ client.datasets.get_runs(
-**dataset_name:** `str` - +**dataset_name:** `str` +
@@ -1032,7 +1014,7 @@ client.datasets.get_runs(
**page:** `typing.Optional[int]` — page number, starts at 1 - +
@@ -1040,7 +1022,7 @@ client.datasets.get_runs(
**limit:** `typing.Optional[int]` — limit of items per page - +
@@ -1048,19 +1030,19 @@ client.datasets.get_runs(
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - +
+
## Health - -
client.health.health() +
client.health.health()
@@ -1073,7 +1055,6 @@ client.datasets.get_runs(
Check health of API and database -
@@ -1088,7 +1069,7 @@ Check health of API and database
```python -from langfuse.api.client import FernLangfuse +from langfuse.client import FernLangfuse client = FernLangfuse( x_langfuse_sdk_name="YOUR_X_LANGFUSE_SDK_NAME", @@ -1101,7 +1082,6 @@ client = FernLangfuse( client.health.health() ``` -
@@ -1116,19 +1096,19 @@ client.health.health()
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - +
+
## Ingestion - -
client.ingestion.batch(...) +
client.ingestion.batch(...)
@@ -1144,6 +1124,7 @@ Batched ingestion for Langfuse Tracing. If you want to use tracing via the API, Notes: +- Introduction to data model: https://langfuse.com/docs/tracing-data-model - Batch sizes are limited to 3.5 MB in total. You need to adjust the number of events per batch accordingly. - The API does not return a 4xx status code for input errors. Instead, it responds with a 207 status code, which includes a list of the encountered errors.
@@ -1162,8 +1143,8 @@ Notes: ```python import datetime -from langfuse.api import IngestionEvent_TraceCreate, TraceBody -from langfuse.api.client import FernLangfuse +from langfuse import IngestionEvent_TraceCreate, TraceBody +from langfuse.client import FernLangfuse client = FernLangfuse( x_langfuse_sdk_name="YOUR_X_LANGFUSE_SDK_NAME", @@ -1201,7 +1182,6 @@ client.ingestion.batch( ) ``` -
@@ -1216,7 +1196,7 @@ client.ingestion.batch(
**batch:** `typing.Sequence[IngestionEvent]` — Batch of tracing events to be ingested. Discriminated by attribute `type`. - +
@@ -1224,7 +1204,7 @@ client.ingestion.batch(
**metadata:** `typing.Optional[typing.Any]` — Optional. Metadata field used by the Langfuse SDKs for debugging. - +
@@ -1232,19 +1212,19 @@ client.ingestion.batch(
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - +
+
## Media - -
client.media.get(...) +
client.media.get(...)
@@ -1257,7 +1237,6 @@ client.ingestion.batch(
Get a media record -
@@ -1272,7 +1251,7 @@ Get a media record
```python -from langfuse.api.client import FernLangfuse +from langfuse.client import FernLangfuse client = FernLangfuse( x_langfuse_sdk_name="YOUR_X_LANGFUSE_SDK_NAME", @@ -1287,7 +1266,6 @@ client.media.get( ) ``` -
@@ -1302,7 +1280,7 @@ client.media.get(
**media_id:** `str` — The unique langfuse identifier of a media record - +
@@ -1310,17 +1288,18 @@ client.media.get(
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - +
+
-
client.media.patch(...) +
client.media.patch(...)
@@ -1333,7 +1312,6 @@ client.media.get(
Patch a media record -
@@ -1350,8 +1328,8 @@ Patch a media record ```python import datetime -from langfuse.api import PatchMediaBody -from langfuse.api.client import FernLangfuse +from langfuse import PatchMediaBody +from langfuse.client import FernLangfuse client = FernLangfuse( x_langfuse_sdk_name="YOUR_X_LANGFUSE_SDK_NAME", @@ -1374,7 +1352,6 @@ client.media.patch( ) ``` - @@ -1389,15 +1366,15 @@ client.media.patch(
**media_id:** `str` — The unique langfuse identifier of a media record - +
-**request:** `PatchMediaBody` - +**request:** `PatchMediaBody` +
@@ -1405,17 +1382,18 @@ client.media.patch(
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - +
+
-
client.media.get_upload_url(...) +
client.media.get_upload_url(...)
@@ -1428,7 +1406,6 @@ client.media.patch(
Get a presigned upload URL for a media record -
@@ -1443,8 +1420,8 @@ Get a presigned upload URL for a media record
```python -from langfuse.api import GetMediaUploadUrlRequest -from langfuse.api.client import FernLangfuse +from langfuse import GetMediaUploadUrlRequest, MediaContentType +from langfuse.client import FernLangfuse client = FernLangfuse( x_langfuse_sdk_name="YOUR_X_LANGFUSE_SDK_NAME", @@ -1458,6 +1435,7 @@ client.media.get_upload_url( request=GetMediaUploadUrlRequest( trace_id="string", observation_id="string", + content_type=MediaContentType.IMAGE_PNG, content_length=1, sha_256_hash="string", field="string", @@ -1465,7 +1443,6 @@ client.media.get_upload_url( ) ``` -
@@ -1479,8 +1456,8 @@ client.media.get_upload_url(
-**request:** `GetMediaUploadUrlRequest` - +**request:** `GetMediaUploadUrlRequest` +
@@ -1488,19 +1465,19 @@ client.media.get_upload_url(
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - +
+
## Metrics - -
client.metrics.daily(...) +
client.metrics.daily(...)
@@ -1513,7 +1490,6 @@ client.media.get_upload_url(
Get daily metrics of the Langfuse project -
@@ -1530,7 +1506,7 @@ Get daily metrics of the Langfuse project ```python import datetime -from langfuse.api.client import FernLangfuse +from langfuse.client import FernLangfuse client = FernLangfuse( x_langfuse_sdk_name="YOUR_X_LANGFUSE_SDK_NAME", @@ -1555,7 +1531,6 @@ client.metrics.daily( ) ``` - @@ -1570,7 +1545,7 @@ client.metrics.daily(
**page:** `typing.Optional[int]` — page number, starts at 1 - +
@@ -1578,7 +1553,7 @@ client.metrics.daily(
**limit:** `typing.Optional[int]` — limit of items per page - +
@@ -1586,7 +1561,7 @@ client.metrics.daily(
**trace_name:** `typing.Optional[str]` — Optional filter by the name of the trace - +
@@ -1594,7 +1569,7 @@ client.metrics.daily(
**user_id:** `typing.Optional[str]` — Optional filter by the userId associated with the trace - +
@@ -1602,7 +1577,7 @@ client.metrics.daily(
**tags:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` — Optional filter for metrics where traces include all of these tags - +
@@ -1610,7 +1585,7 @@ client.metrics.daily(
**from_timestamp:** `typing.Optional[dt.datetime]` — Optional filter to only include traces and observations on or after a certain datetime (ISO 8601) - +
@@ -1618,7 +1593,7 @@ client.metrics.daily(
**to_timestamp:** `typing.Optional[dt.datetime]` — Optional filter to only include traces and observations before a certain datetime (ISO 8601) - +
@@ -1626,19 +1601,19 @@ client.metrics.daily(
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - +
+
## Models - -
client.models.create(...) +
client.models.create(...)
@@ -1651,7 +1626,6 @@ client.metrics.daily(
Create a model -
@@ -1668,8 +1642,8 @@ Create a model ```python import datetime -from langfuse.api import CreateModelRequest, ModelUsageUnit -from langfuse.api.client import FernLangfuse +from langfuse import CreateModelRequest, ModelUsageUnit +from langfuse.client import FernLangfuse client = FernLangfuse( x_langfuse_sdk_name="YOUR_X_LANGFUSE_SDK_NAME", @@ -1696,7 +1670,6 @@ client.models.create( ) ``` - @@ -1710,8 +1683,8 @@ client.models.create(
-**request:** `CreateModelRequest` - +**request:** `CreateModelRequest` +
@@ -1719,17 +1692,18 @@ client.models.create(
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - +
+
-
client.models.list(...) +
client.models.list(...)
@@ -1742,7 +1716,6 @@ client.models.create(
Get all models -
@@ -1757,7 +1730,7 @@ Get all models
```python -from langfuse.api.client import FernLangfuse +from langfuse.client import FernLangfuse client = FernLangfuse( x_langfuse_sdk_name="YOUR_X_LANGFUSE_SDK_NAME", @@ -1773,7 +1746,6 @@ client.models.list( ) ``` -
@@ -1788,7 +1760,7 @@ client.models.list(
**page:** `typing.Optional[int]` — page number, starts at 1 - +
@@ -1796,7 +1768,7 @@ client.models.list(
**limit:** `typing.Optional[int]` — limit of items per page - +
@@ -1804,17 +1776,18 @@ client.models.list(
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - +
+
-
client.models.get(...) +
client.models.get(...)
@@ -1827,7 +1800,6 @@ client.models.list(
Get a model -
@@ -1842,7 +1814,7 @@ Get a model
```python -from langfuse.api.client import FernLangfuse +from langfuse.client import FernLangfuse client = FernLangfuse( x_langfuse_sdk_name="YOUR_X_LANGFUSE_SDK_NAME", @@ -1857,7 +1829,6 @@ client.models.get( ) ``` -
@@ -1871,8 +1842,8 @@ client.models.get(
-**id:** `str` - +**id:** `str` +
@@ -1880,17 +1851,18 @@ client.models.get(
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - +
+
-
client.models.delete(...) +
client.models.delete(...)
@@ -1903,7 +1875,6 @@ client.models.get(
Delete a model. Cannot delete models managed by Langfuse. You can create your own definition with the same modelName to override the definition though. -
@@ -1918,7 +1889,7 @@ Delete a model. Cannot delete models managed by Langfuse. You can create your ow
```python -from langfuse.api.client import FernLangfuse +from langfuse.client import FernLangfuse client = FernLangfuse( x_langfuse_sdk_name="YOUR_X_LANGFUSE_SDK_NAME", @@ -1933,7 +1904,6 @@ client.models.delete( ) ``` -
@@ -1947,8 +1917,8 @@ client.models.delete(
-**id:** `str` - +**id:** `str` +
@@ -1956,19 +1926,19 @@ client.models.delete(
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - +
+
## Observations - -
client.observations.get(...) +
client.observations.get(...)
@@ -1981,7 +1951,6 @@ client.models.delete(
Get a observation -
@@ -1996,7 +1965,7 @@ Get a observation
```python -from langfuse.api.client import FernLangfuse +from langfuse.client import FernLangfuse client = FernLangfuse( x_langfuse_sdk_name="YOUR_X_LANGFUSE_SDK_NAME", @@ -2011,7 +1980,6 @@ client.observations.get( ) ``` -
@@ -2026,7 +1994,7 @@ client.observations.get(
**observation_id:** `str` — The unique langfuse identifier of an observation, can be an event, span or generation - +
@@ -2034,17 +2002,18 @@ client.observations.get(
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - +
+
-
client.observations.get_many(...) +
client.observations.get_many(...)
@@ -2057,7 +2026,6 @@ client.observations.get(
Get a list of observations -
@@ -2074,7 +2042,7 @@ Get a list of observations ```python import datetime -from langfuse.api.client import FernLangfuse +from langfuse.client import FernLangfuse client = FernLangfuse( x_langfuse_sdk_name="YOUR_X_LANGFUSE_SDK_NAME", @@ -2102,7 +2070,6 @@ client.observations.get_many( ) ``` - @@ -2117,7 +2084,7 @@ client.observations.get_many(
**page:** `typing.Optional[int]` — Page number, starts at 1. - +
@@ -2125,47 +2092,47 @@ client.observations.get_many(
**limit:** `typing.Optional[int]` — Limit of items per page. If you encounter api issues due to too large page sizes, try to reduce the limit. - +
-**name:** `typing.Optional[str]` - +**name:** `typing.Optional[str]` +
-**user_id:** `typing.Optional[str]` - +**user_id:** `typing.Optional[str]` +
-**type:** `typing.Optional[str]` - +**type:** `typing.Optional[str]` +
-**trace_id:** `typing.Optional[str]` - +**trace_id:** `typing.Optional[str]` +
-**parent_observation_id:** `typing.Optional[str]` - +**parent_observation_id:** `typing.Optional[str]` +
@@ -2173,7 +2140,7 @@ client.observations.get_many(
**from_start_time:** `typing.Optional[dt.datetime]` — Retrieve only observations with a start_time or or after this datetime (ISO 8601). - +
@@ -2181,7 +2148,7 @@ client.observations.get_many(
**to_start_time:** `typing.Optional[dt.datetime]` — Retrieve only observations with a start_time before this datetime (ISO 8601). - +
@@ -2189,7 +2156,7 @@ client.observations.get_many(
**version:** `typing.Optional[str]` — Optional filter to only include observations with a certain version. - +
@@ -2197,19 +2164,19 @@ client.observations.get_many(
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - +
+
## Projects - -
client.projects.get() +
client.projects.get()
@@ -2222,7 +2189,6 @@ client.observations.get_many(
Get Project associated with API key -
@@ -2237,7 +2203,7 @@ Get Project associated with API key
```python -from langfuse.api.client import FernLangfuse +from langfuse.client import FernLangfuse client = FernLangfuse( x_langfuse_sdk_name="YOUR_X_LANGFUSE_SDK_NAME", @@ -2250,7 +2216,6 @@ client = FernLangfuse( client.projects.get() ``` -
@@ -2265,19 +2230,19 @@ client.projects.get()
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - +
+
## Prompts - -
client.prompts.get(...) +
client.prompts.get(...)
@@ -2290,7 +2255,6 @@ client.projects.get()
Get a prompt -
@@ -2305,7 +2269,7 @@ Get a prompt
```python -from langfuse.api.client import FernLangfuse +from langfuse.client import FernLangfuse client = FernLangfuse( x_langfuse_sdk_name="YOUR_X_LANGFUSE_SDK_NAME", @@ -2322,7 +2286,6 @@ client.prompts.get( ) ``` -
@@ -2337,7 +2300,7 @@ client.prompts.get(
**prompt_name:** `str` — The name of the prompt - +
@@ -2345,7 +2308,7 @@ client.prompts.get(
**version:** `typing.Optional[int]` — Version of the prompt to be retrieved. - +
@@ -2353,7 +2316,7 @@ client.prompts.get(
**label:** `typing.Optional[str]` — Label of the prompt to be retrieved. Defaults to "production" if no label or version is set. - +
@@ -2361,17 +2324,18 @@ client.prompts.get(
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - +
+
-
client.prompts.list(...) +
client.prompts.list(...)
@@ -2384,7 +2348,6 @@ client.prompts.get(
Get a list of prompt names with versions and labels -
@@ -2401,7 +2364,7 @@ Get a list of prompt names with versions and labels ```python import datetime -from langfuse.api.client import FernLangfuse +from langfuse.client import FernLangfuse client = FernLangfuse( x_langfuse_sdk_name="YOUR_X_LANGFUSE_SDK_NAME", @@ -2426,7 +2389,6 @@ client.prompts.list( ) ``` - @@ -2440,24 +2402,24 @@ client.prompts.list(
-**name:** `typing.Optional[str]` - +**name:** `typing.Optional[str]` +
-**label:** `typing.Optional[str]` - +**label:** `typing.Optional[str]` +
-**tag:** `typing.Optional[str]` - +**tag:** `typing.Optional[str]` +
@@ -2465,7 +2427,7 @@ client.prompts.list(
**page:** `typing.Optional[int]` — page number, starts at 1 - +
@@ -2473,7 +2435,7 @@ client.prompts.list(
**limit:** `typing.Optional[int]` — limit of items per page - +
@@ -2481,7 +2443,7 @@ client.prompts.list(
**from_updated_at:** `typing.Optional[dt.datetime]` — Optional filter to only include prompt versions created/updated on or after a certain datetime (ISO 8601) - +
@@ -2489,7 +2451,7 @@ client.prompts.list(
**to_updated_at:** `typing.Optional[dt.datetime]` — Optional filter to only include prompt versions created/updated before a certain datetime (ISO 8601) - +
@@ -2497,17 +2459,18 @@ client.prompts.list(
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - +
+
-
client.prompts.create(...) +
client.prompts.create(...)
@@ -2520,7 +2483,6 @@ client.prompts.list(
Create a new version for the prompt with the given `name` -
@@ -2535,8 +2497,8 @@ Create a new version for the prompt with the given `name`
```python -from langfuse.api import ChatMessage, CreatePromptRequest_Chat -from langfuse.api.client import FernLangfuse +from langfuse import ChatMessage, CreatePromptRequest_Chat +from langfuse.client import FernLangfuse client = FernLangfuse( x_langfuse_sdk_name="YOUR_X_LANGFUSE_SDK_NAME", @@ -2562,7 +2524,6 @@ client.prompts.create( ) ``` -
@@ -2576,8 +2537,8 @@ client.prompts.create(
-**request:** `CreatePromptRequest` - +**request:** `CreatePromptRequest` +
@@ -2585,19 +2546,19 @@ client.prompts.create(
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - +
+
## ScoreConfigs - -
client.score_configs.create(...) +
client.score_configs.create(...)
@@ -2610,7 +2571,6 @@ client.prompts.create(
Create a score configuration (config). Score configs are used to define the structure of scores -
@@ -2625,8 +2585,8 @@ Create a score configuration (config). Score configs are used to define the stru
```python -from langfuse.api import ConfigCategory, CreateScoreConfigRequest, ScoreDataType -from langfuse.api.client import FernLangfuse +from langfuse import ConfigCategory, CreateScoreConfigRequest, ScoreDataType +from langfuse.client import FernLangfuse client = FernLangfuse( x_langfuse_sdk_name="YOUR_X_LANGFUSE_SDK_NAME", @@ -2653,7 +2613,6 @@ client.score_configs.create( ) ``` -
@@ -2667,8 +2626,8 @@ client.score_configs.create(
-**request:** `CreateScoreConfigRequest` - +**request:** `CreateScoreConfigRequest` +
@@ -2676,17 +2635,18 @@ client.score_configs.create(
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - +
+
-
client.score_configs.get(...) +
client.score_configs.get(...)
@@ -2699,7 +2659,6 @@ client.score_configs.create(
Get all score configs -
@@ -2714,7 +2673,7 @@ Get all score configs
```python -from langfuse.api.client import FernLangfuse +from langfuse.client import FernLangfuse client = FernLangfuse( x_langfuse_sdk_name="YOUR_X_LANGFUSE_SDK_NAME", @@ -2730,7 +2689,6 @@ client.score_configs.get( ) ``` -
@@ -2745,7 +2703,7 @@ client.score_configs.get(
**page:** `typing.Optional[int]` — Page number, starts at 1. - +
@@ -2753,7 +2711,7 @@ client.score_configs.get(
**limit:** `typing.Optional[int]` — Limit of items per page. If you encounter api issues due to too large page sizes, try to reduce the limit - +
@@ -2761,17 +2719,18 @@ client.score_configs.get(
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - +
+
-
client.score_configs.get_by_id(...) +
client.score_configs.get_by_id(...)
@@ -2784,7 +2743,6 @@ client.score_configs.get(
Get a score config -
@@ -2799,7 +2757,7 @@ Get a score config
```python -from langfuse.api.client import FernLangfuse +from langfuse.client import FernLangfuse client = FernLangfuse( x_langfuse_sdk_name="YOUR_X_LANGFUSE_SDK_NAME", @@ -2814,7 +2772,6 @@ client.score_configs.get_by_id( ) ``` -
@@ -2829,7 +2786,7 @@ client.score_configs.get_by_id(
**config_id:** `str` — The unique langfuse identifier of a score config - +
@@ -2837,19 +2794,19 @@ client.score_configs.get_by_id(
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - +
+
## Score - -
client.score.create(...) +
client.score.create(...)
@@ -2862,7 +2819,6 @@ client.score_configs.get_by_id(
Create a score -
@@ -2877,8 +2833,8 @@ Create a score
```python -from langfuse.api import CreateScoreRequest -from langfuse.api.client import FernLangfuse +from langfuse import CreateScoreRequest +from langfuse.client import FernLangfuse client = FernLangfuse( x_langfuse_sdk_name="YOUR_X_LANGFUSE_SDK_NAME", @@ -2897,7 +2853,6 @@ client.score.create( ) ``` -
@@ -2911,8 +2866,8 @@ client.score.create(
-**request:** `CreateScoreRequest` - +**request:** `CreateScoreRequest` +
@@ -2920,17 +2875,18 @@ client.score.create(
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - +
+
-
client.score.get(...) +
client.score.get(...)
@@ -2943,7 +2899,6 @@ client.score.create(
Get a list of scores -
@@ -2960,8 +2915,8 @@ Get a list of scores ```python import datetime -from langfuse.api import ScoreDataType, ScoreSource -from langfuse.api.client import FernLangfuse +from langfuse import ScoreDataType, ScoreSource +from langfuse.client import FernLangfuse client = FernLangfuse( x_langfuse_sdk_name="YOUR_X_LANGFUSE_SDK_NAME", @@ -2993,7 +2948,6 @@ client.score.get( ) ``` - @@ -3008,7 +2962,7 @@ client.score.get(
**page:** `typing.Optional[int]` — Page number, starts at 1. - +
@@ -3016,7 +2970,7 @@ client.score.get(
**limit:** `typing.Optional[int]` — Limit of items per page. If you encounter api issues due to too large page sizes, try to reduce the limit. - +
@@ -3024,7 +2978,7 @@ client.score.get(
**user_id:** `typing.Optional[str]` — Retrieve only scores with this userId associated to the trace. - +
@@ -3032,7 +2986,7 @@ client.score.get(
**name:** `typing.Optional[str]` — Retrieve only scores with this name. - +
@@ -3040,7 +2994,7 @@ client.score.get(
**from_timestamp:** `typing.Optional[dt.datetime]` — Optional filter to only include scores created on or after a certain datetime (ISO 8601) - +
@@ -3048,7 +3002,7 @@ client.score.get(
**to_timestamp:** `typing.Optional[dt.datetime]` — Optional filter to only include scores created before a certain datetime (ISO 8601) - +
@@ -3056,7 +3010,7 @@ client.score.get(
**source:** `typing.Optional[ScoreSource]` — Retrieve only scores from a specific source. - +
@@ -3064,7 +3018,7 @@ client.score.get(
**operator:** `typing.Optional[str]` — Retrieve only scores with value. - +
@@ -3072,7 +3026,7 @@ client.score.get(
**value:** `typing.Optional[float]` — Retrieve only scores with value. - +
@@ -3080,7 +3034,7 @@ client.score.get(
**score_ids:** `typing.Optional[str]` — Comma-separated list of score IDs to limit the results to. - +
@@ -3088,7 +3042,7 @@ client.score.get(
**config_id:** `typing.Optional[str]` — Retrieve only scores with a specific configId. - +
@@ -3096,7 +3050,7 @@ client.score.get(
**queue_id:** `typing.Optional[str]` — Retrieve only scores with a specific annotation queueId. - +
@@ -3104,7 +3058,7 @@ client.score.get(
**data_type:** `typing.Optional[ScoreDataType]` — Retrieve only scores with a specific dataType. - +
@@ -3114,7 +3068,7 @@ client.score.get( **trace_tags:** `typing.Optional[ typing.Union[typing.Sequence[str], typing.Sequence[typing.Sequence[str]]] ]` — Only scores linked to traces that include all of these tags will be returned. - + @@ -3122,17 +3076,18 @@ client.score.get(
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - +
+
-
client.score.get_by_id(...) +
client.score.get_by_id(...)
@@ -3145,7 +3100,6 @@ client.score.get(
Get a score -
@@ -3160,7 +3114,7 @@ Get a score
```python -from langfuse.api.client import FernLangfuse +from langfuse.client import FernLangfuse client = FernLangfuse( x_langfuse_sdk_name="YOUR_X_LANGFUSE_SDK_NAME", @@ -3175,7 +3129,6 @@ client.score.get_by_id( ) ``` -
@@ -3190,7 +3143,7 @@ client.score.get_by_id(
**score_id:** `str` — The unique langfuse identifier of a score - +
@@ -3198,17 +3151,18 @@ client.score.get_by_id(
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - +
+
-
client.score.delete(...) +
client.score.delete(...)
@@ -3221,7 +3175,6 @@ client.score.get_by_id(
Delete a score -
@@ -3236,7 +3189,7 @@ Delete a score
```python -from langfuse.api.client import FernLangfuse +from langfuse.client import FernLangfuse client = FernLangfuse( x_langfuse_sdk_name="YOUR_X_LANGFUSE_SDK_NAME", @@ -3251,7 +3204,6 @@ client.score.delete( ) ``` -
@@ -3266,7 +3218,7 @@ client.score.delete(
**score_id:** `str` — The unique langfuse identifier of a score - +
@@ -3274,19 +3226,19 @@ client.score.delete(
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - +
+
## Sessions - -
client.sessions.list(...) +
client.sessions.list(...)
@@ -3299,7 +3251,6 @@ client.score.delete(
Get sessions -
@@ -3316,7 +3267,7 @@ Get sessions ```python import datetime -from langfuse.api.client import FernLangfuse +from langfuse.client import FernLangfuse client = FernLangfuse( x_langfuse_sdk_name="YOUR_X_LANGFUSE_SDK_NAME", @@ -3338,7 +3289,6 @@ client.sessions.list( ) ``` - @@ -3353,7 +3303,7 @@ client.sessions.list(
**page:** `typing.Optional[int]` — Page number, starts at 1 - +
@@ -3361,7 +3311,7 @@ client.sessions.list(
**limit:** `typing.Optional[int]` — Limit of items per page. If you encounter api issues due to too large page sizes, try to reduce the limit. - +
@@ -3369,7 +3319,7 @@ client.sessions.list(
**from_timestamp:** `typing.Optional[dt.datetime]` — Optional filter to only include sessions created on or after a certain datetime (ISO 8601) - +
@@ -3377,7 +3327,7 @@ client.sessions.list(
**to_timestamp:** `typing.Optional[dt.datetime]` — Optional filter to only include sessions created before a certain datetime (ISO 8601) - +
@@ -3385,17 +3335,18 @@ client.sessions.list(
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - +
+
-
client.sessions.get(...) +
client.sessions.get(...)
@@ -3408,7 +3359,6 @@ client.sessions.list(
Get a session. Please note that `traces` on this endpoint are not paginated, if you plan to fetch large sessions, consider `GET /api/public/traces?sessionId=` -
@@ -3423,7 +3373,7 @@ Get a session. Please note that `traces` on this endpoint are not paginated, if
```python -from langfuse.api.client import FernLangfuse +from langfuse.client import FernLangfuse client = FernLangfuse( x_langfuse_sdk_name="YOUR_X_LANGFUSE_SDK_NAME", @@ -3438,7 +3388,6 @@ client.sessions.get( ) ``` -
@@ -3453,7 +3402,7 @@ client.sessions.get(
**session_id:** `str` — The unique id of a session - +
@@ -3461,19 +3410,19 @@ client.sessions.get(
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - +
+
## Trace - -
client.trace.get(...) +
client.trace.get(...)
@@ -3486,7 +3435,6 @@ client.sessions.get(
Get a specific trace -
@@ -3501,7 +3449,7 @@ Get a specific trace
```python -from langfuse.api.client import FernLangfuse +from langfuse.client import FernLangfuse client = FernLangfuse( x_langfuse_sdk_name="YOUR_X_LANGFUSE_SDK_NAME", @@ -3516,7 +3464,6 @@ client.trace.get( ) ``` -
@@ -3531,7 +3478,7 @@ client.trace.get(
**trace_id:** `str` — The unique langfuse identifier of a trace - +
@@ -3539,17 +3486,18 @@ client.trace.get(
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - +
+
-
client.trace.list(...) +
client.trace.list(...)
@@ -3562,7 +3510,6 @@ client.trace.get(
Get list of traces -
@@ -3579,7 +3526,7 @@ Get list of traces ```python import datetime -from langfuse.api.client import FernLangfuse +from langfuse.client import FernLangfuse client = FernLangfuse( x_langfuse_sdk_name="YOUR_X_LANGFUSE_SDK_NAME", @@ -3608,7 +3555,6 @@ client.trace.list( ) ``` - @@ -3623,7 +3569,7 @@ client.trace.list(
**page:** `typing.Optional[int]` — Page number, starts at 1 - +
@@ -3631,31 +3577,31 @@ client.trace.list(
**limit:** `typing.Optional[int]` — Limit of items per page. If you encounter api issues due to too large page sizes, try to reduce the limit. - +
-**user_id:** `typing.Optional[str]` - +**user_id:** `typing.Optional[str]` +
-**name:** `typing.Optional[str]` - +**name:** `typing.Optional[str]` +
-**session_id:** `typing.Optional[str]` - +**session_id:** `typing.Optional[str]` +
@@ -3663,7 +3609,7 @@ client.trace.list(
**from_timestamp:** `typing.Optional[dt.datetime]` — Optional filter to only include traces with a trace.timestamp on or after a certain datetime (ISO 8601) - +
@@ -3671,7 +3617,7 @@ client.trace.list(
**to_timestamp:** `typing.Optional[dt.datetime]` — Optional filter to only include traces with a trace.timestamp before a certain datetime (ISO 8601) - +
@@ -3679,7 +3625,7 @@ client.trace.list(
**order_by:** `typing.Optional[str]` — Format of the string [field].[asc/desc]. Fields: id, timestamp, name, userId, release, version, public, bookmarked, sessionId. Example: timestamp.asc - +
@@ -3687,7 +3633,7 @@ client.trace.list(
**tags:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` — Only traces that include all of these tags will be returned. - +
@@ -3695,7 +3641,7 @@ client.trace.list(
**version:** `typing.Optional[str]` — Optional filter to only include traces with a certain version. - +
@@ -3703,7 +3649,7 @@ client.trace.list(
**release:** `typing.Optional[str]` — Optional filter to only include traces with a certain release. - +
@@ -3711,12 +3657,14 @@ client.trace.list(
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - +
+
+ diff --git a/langfuse/api/resources/comments/client.py b/langfuse/api/resources/comments/client.py index 072df98aa..9d84948a3 100644 --- a/langfuse/api/resources/comments/client.py +++ b/langfuse/api/resources/comments/client.py @@ -48,8 +48,8 @@ def create( Examples -------- - from langfuse.api import CreateCommentRequest - from langfuse.api.client import FernLangfuse + from langfuse import CreateCommentRequest + from langfuse.client import FernLangfuse client = FernLangfuse( x_langfuse_sdk_name="YOUR_X_LANGFUSE_SDK_NAME", @@ -141,7 +141,7 @@ def get( Examples -------- - from langfuse.api.client import FernLangfuse + from langfuse.client import FernLangfuse client = FernLangfuse( x_langfuse_sdk_name="YOUR_X_LANGFUSE_SDK_NAME", @@ -220,7 +220,7 @@ def get_by_id( Examples -------- - from langfuse.api.client import FernLangfuse + from langfuse.client import FernLangfuse client = FernLangfuse( x_langfuse_sdk_name="YOUR_X_LANGFUSE_SDK_NAME", @@ -294,8 +294,8 @@ async def create( -------- import asyncio - from langfuse.api import CreateCommentRequest - from langfuse.api.client import AsyncFernLangfuse + from langfuse import CreateCommentRequest + from langfuse.client import AsyncFernLangfuse client = AsyncFernLangfuse( x_langfuse_sdk_name="YOUR_X_LANGFUSE_SDK_NAME", @@ -395,7 +395,7 @@ async def get( -------- import asyncio - from langfuse.api.client import AsyncFernLangfuse + from langfuse.client import AsyncFernLangfuse client = AsyncFernLangfuse( x_langfuse_sdk_name="YOUR_X_LANGFUSE_SDK_NAME", @@ -482,7 +482,7 @@ async def get_by_id( -------- import asyncio - from langfuse.api.client import AsyncFernLangfuse + from langfuse.client import AsyncFernLangfuse client = AsyncFernLangfuse( x_langfuse_sdk_name="YOUR_X_LANGFUSE_SDK_NAME", diff --git a/langfuse/api/resources/commons/types/model.py b/langfuse/api/resources/commons/types/model.py index 18b26c478..8e9449272 100644 --- a/langfuse/api/resources/commons/types/model.py +++ b/langfuse/api/resources/commons/types/model.py @@ -24,7 +24,7 @@ class Model(pydantic_v1.BaseModel): Regex pattern which matches this model definition to generation.model. Useful in case of fine-tuned models. If you want to exact match, use `(?i)^modelname$` """ - start_date: typing.Optional[dt.date] = pydantic_v1.Field( + start_date: typing.Optional[dt.datetime] = pydantic_v1.Field( alias="startDate", default=None ) """ diff --git a/langfuse/api/resources/dataset_items/client.py b/langfuse/api/resources/dataset_items/client.py index 55f801f2a..7cab6f51c 100644 --- a/langfuse/api/resources/dataset_items/client.py +++ b/langfuse/api/resources/dataset_items/client.py @@ -47,8 +47,8 @@ def create( Examples -------- - from langfuse.api import CreateDatasetItemRequest, DatasetStatus - from langfuse.api.client import FernLangfuse + from langfuse import CreateDatasetItemRequest, DatasetStatus + from langfuse.client import FernLangfuse client = FernLangfuse( x_langfuse_sdk_name="YOUR_X_LANGFUSE_SDK_NAME", @@ -123,7 +123,7 @@ def get( Examples -------- - from langfuse.api.client import FernLangfuse + from langfuse.client import FernLangfuse client = FernLangfuse( x_langfuse_sdk_name="YOUR_X_LANGFUSE_SDK_NAME", @@ -204,7 +204,7 @@ def list( Examples -------- - from langfuse.api.client import FernLangfuse + from langfuse.client import FernLangfuse client = FernLangfuse( x_langfuse_sdk_name="YOUR_X_LANGFUSE_SDK_NAME", @@ -289,8 +289,8 @@ async def create( -------- import asyncio - from langfuse.api import CreateDatasetItemRequest, DatasetStatus - from langfuse.api.client import AsyncFernLangfuse + from langfuse import CreateDatasetItemRequest, DatasetStatus + from langfuse.client import AsyncFernLangfuse client = AsyncFernLangfuse( x_langfuse_sdk_name="YOUR_X_LANGFUSE_SDK_NAME", @@ -373,7 +373,7 @@ async def get( -------- import asyncio - from langfuse.api.client import AsyncFernLangfuse + from langfuse.client import AsyncFernLangfuse client = AsyncFernLangfuse( x_langfuse_sdk_name="YOUR_X_LANGFUSE_SDK_NAME", @@ -462,7 +462,7 @@ async def list( -------- import asyncio - from langfuse.api.client import AsyncFernLangfuse + from langfuse.client import AsyncFernLangfuse client = AsyncFernLangfuse( x_langfuse_sdk_name="YOUR_X_LANGFUSE_SDK_NAME", diff --git a/langfuse/api/resources/dataset_run_items/client.py b/langfuse/api/resources/dataset_run_items/client.py index dcc0f85dc..c4c923a9b 100644 --- a/langfuse/api/resources/dataset_run_items/client.py +++ b/langfuse/api/resources/dataset_run_items/client.py @@ -45,8 +45,8 @@ def create( Examples -------- - from langfuse.api import CreateDatasetRunItemRequest - from langfuse.api.client import FernLangfuse + from langfuse import CreateDatasetRunItemRequest + from langfuse.client import FernLangfuse client = FernLangfuse( x_langfuse_sdk_name="YOUR_X_LANGFUSE_SDK_NAME", @@ -129,8 +129,8 @@ async def create( -------- import asyncio - from langfuse.api import CreateDatasetRunItemRequest - from langfuse.api.client import AsyncFernLangfuse + from langfuse import CreateDatasetRunItemRequest + from langfuse.client import AsyncFernLangfuse client = AsyncFernLangfuse( x_langfuse_sdk_name="YOUR_X_LANGFUSE_SDK_NAME", diff --git a/langfuse/api/resources/datasets/client.py b/langfuse/api/resources/datasets/client.py index 4c6048b94..5d535b949 100644 --- a/langfuse/api/resources/datasets/client.py +++ b/langfuse/api/resources/datasets/client.py @@ -54,7 +54,7 @@ def list( Examples -------- - from langfuse.api.client import FernLangfuse + from langfuse.client import FernLangfuse client = FernLangfuse( x_langfuse_sdk_name="YOUR_X_LANGFUSE_SDK_NAME", @@ -123,7 +123,7 @@ def get( Examples -------- - from langfuse.api.client import FernLangfuse + from langfuse.client import FernLangfuse client = FernLangfuse( x_langfuse_sdk_name="YOUR_X_LANGFUSE_SDK_NAME", @@ -190,8 +190,8 @@ def create( Examples -------- - from langfuse.api import CreateDatasetRequest - from langfuse.api.client import FernLangfuse + from langfuse import CreateDatasetRequest + from langfuse.client import FernLangfuse client = FernLangfuse( x_langfuse_sdk_name="YOUR_X_LANGFUSE_SDK_NAME", @@ -267,7 +267,7 @@ def get_run( Examples -------- - from langfuse.api.client import FernLangfuse + from langfuse.client import FernLangfuse client = FernLangfuse( x_langfuse_sdk_name="YOUR_X_LANGFUSE_SDK_NAME", @@ -343,7 +343,7 @@ def get_runs( Examples -------- - from langfuse.api.client import FernLangfuse + from langfuse.client import FernLangfuse client = FernLangfuse( x_langfuse_sdk_name="YOUR_X_LANGFUSE_SDK_NAME", @@ -425,7 +425,7 @@ async def list( -------- import asyncio - from langfuse.api.client import AsyncFernLangfuse + from langfuse.client import AsyncFernLangfuse client = AsyncFernLangfuse( x_langfuse_sdk_name="YOUR_X_LANGFUSE_SDK_NAME", @@ -502,7 +502,7 @@ async def get( -------- import asyncio - from langfuse.api.client import AsyncFernLangfuse + from langfuse.client import AsyncFernLangfuse client = AsyncFernLangfuse( x_langfuse_sdk_name="YOUR_X_LANGFUSE_SDK_NAME", @@ -577,8 +577,8 @@ async def create( -------- import asyncio - from langfuse.api import CreateDatasetRequest - from langfuse.api.client import AsyncFernLangfuse + from langfuse import CreateDatasetRequest + from langfuse.client import AsyncFernLangfuse client = AsyncFernLangfuse( x_langfuse_sdk_name="YOUR_X_LANGFUSE_SDK_NAME", @@ -662,7 +662,7 @@ async def get_run( -------- import asyncio - from langfuse.api.client import AsyncFernLangfuse + from langfuse.client import AsyncFernLangfuse client = AsyncFernLangfuse( x_langfuse_sdk_name="YOUR_X_LANGFUSE_SDK_NAME", @@ -746,7 +746,7 @@ async def get_runs( -------- import asyncio - from langfuse.api.client import AsyncFernLangfuse + from langfuse.client import AsyncFernLangfuse client = AsyncFernLangfuse( x_langfuse_sdk_name="YOUR_X_LANGFUSE_SDK_NAME", diff --git a/langfuse/api/resources/health/client.py b/langfuse/api/resources/health/client.py index 3e84ced68..029be7a0c 100644 --- a/langfuse/api/resources/health/client.py +++ b/langfuse/api/resources/health/client.py @@ -37,7 +37,7 @@ def health( Examples -------- - from langfuse.api.client import FernLangfuse + from langfuse.client import FernLangfuse client = FernLangfuse( x_langfuse_sdk_name="YOUR_X_LANGFUSE_SDK_NAME", @@ -104,7 +104,7 @@ async def health( -------- import asyncio - from langfuse.api.client import AsyncFernLangfuse + from langfuse.client import AsyncFernLangfuse client = AsyncFernLangfuse( x_langfuse_sdk_name="YOUR_X_LANGFUSE_SDK_NAME", diff --git a/langfuse/api/resources/health/types/health_response.py b/langfuse/api/resources/health/types/health_response.py index 3cd5e429a..633da67a8 100644 --- a/langfuse/api/resources/health/types/health_response.py +++ b/langfuse/api/resources/health/types/health_response.py @@ -11,7 +11,7 @@ class HealthResponse(pydantic_v1.BaseModel): """ Examples -------- - from langfuse.api import HealthResponse + from langfuse import HealthResponse HealthResponse( version="1.25.0", diff --git a/langfuse/api/resources/ingestion/client.py b/langfuse/api/resources/ingestion/client.py index 90f88bf45..cc58c32e4 100644 --- a/langfuse/api/resources/ingestion/client.py +++ b/langfuse/api/resources/ingestion/client.py @@ -35,6 +35,7 @@ def batch( Notes: + - Introduction to data model: https://langfuse.com/docs/tracing-data-model - Batch sizes are limited to 3.5 MB in total. You need to adjust the number of events per batch accordingly. - The API does not return a 4xx status code for input errors. Instead, it responds with a 207 status code, which includes a list of the encountered errors. @@ -57,8 +58,8 @@ def batch( -------- import datetime - from langfuse.api import IngestionEvent_TraceCreate, TraceBody - from langfuse.api.client import FernLangfuse + from langfuse import IngestionEvent_TraceCreate, TraceBody + from langfuse.client import FernLangfuse client = FernLangfuse( x_langfuse_sdk_name="YOUR_X_LANGFUSE_SDK_NAME", @@ -145,6 +146,7 @@ async def batch( Notes: + - Introduction to data model: https://langfuse.com/docs/tracing-data-model - Batch sizes are limited to 3.5 MB in total. You need to adjust the number of events per batch accordingly. - The API does not return a 4xx status code for input errors. Instead, it responds with a 207 status code, which includes a list of the encountered errors. @@ -168,8 +170,8 @@ async def batch( import asyncio import datetime - from langfuse.api import IngestionEvent_TraceCreate, TraceBody - from langfuse.api.client import AsyncFernLangfuse + from langfuse import IngestionEvent_TraceCreate, TraceBody + from langfuse.client import AsyncFernLangfuse client = AsyncFernLangfuse( x_langfuse_sdk_name="YOUR_X_LANGFUSE_SDK_NAME", diff --git a/langfuse/api/resources/ingestion/types/score_body.py b/langfuse/api/resources/ingestion/types/score_body.py index a043ef145..aad152dd8 100644 --- a/langfuse/api/resources/ingestion/types/score_body.py +++ b/langfuse/api/resources/ingestion/types/score_body.py @@ -13,7 +13,7 @@ class ScoreBody(pydantic_v1.BaseModel): """ Examples -------- - from langfuse.api import ScoreBody + from langfuse import ScoreBody ScoreBody( name="novelty", diff --git a/langfuse/api/resources/media/client.py b/langfuse/api/resources/media/client.py index eb8eb16ac..0dcd75e8e 100644 --- a/langfuse/api/resources/media/client.py +++ b/langfuse/api/resources/media/client.py @@ -46,7 +46,7 @@ def get( Examples -------- - from langfuse.api.client import FernLangfuse + from langfuse.client import FernLangfuse client = FernLangfuse( x_langfuse_sdk_name="YOUR_X_LANGFUSE_SDK_NAME", @@ -119,8 +119,8 @@ def patch( -------- import datetime - from langfuse.api import PatchMediaBody - from langfuse.api.client import FernLangfuse + from langfuse import PatchMediaBody + from langfuse.client import FernLangfuse client = FernLangfuse( x_langfuse_sdk_name="YOUR_X_LANGFUSE_SDK_NAME", @@ -197,8 +197,8 @@ def get_upload_url( Examples -------- - from langfuse.api import GetMediaUploadUrlRequest, MediaContentType - from langfuse.api.client import FernLangfuse + from langfuse import GetMediaUploadUrlRequest, MediaContentType + from langfuse.client import FernLangfuse client = FernLangfuse( x_langfuse_sdk_name="YOUR_X_LANGFUSE_SDK_NAME", @@ -281,7 +281,7 @@ async def get( -------- import asyncio - from langfuse.api.client import AsyncFernLangfuse + from langfuse.client import AsyncFernLangfuse client = AsyncFernLangfuse( x_langfuse_sdk_name="YOUR_X_LANGFUSE_SDK_NAME", @@ -361,8 +361,8 @@ async def patch( import asyncio import datetime - from langfuse.api import PatchMediaBody - from langfuse.api.client import AsyncFernLangfuse + from langfuse import PatchMediaBody + from langfuse.client import AsyncFernLangfuse client = AsyncFernLangfuse( x_langfuse_sdk_name="YOUR_X_LANGFUSE_SDK_NAME", @@ -447,8 +447,8 @@ async def get_upload_url( -------- import asyncio - from langfuse.api import GetMediaUploadUrlRequest, MediaContentType - from langfuse.api.client import AsyncFernLangfuse + from langfuse import GetMediaUploadUrlRequest, MediaContentType + from langfuse.client import AsyncFernLangfuse client = AsyncFernLangfuse( x_langfuse_sdk_name="YOUR_X_LANGFUSE_SDK_NAME", diff --git a/langfuse/api/resources/metrics/client.py b/langfuse/api/resources/metrics/client.py index 0fe6a45ed..6447b1133 100644 --- a/langfuse/api/resources/metrics/client.py +++ b/langfuse/api/resources/metrics/client.py @@ -70,7 +70,7 @@ def daily( -------- import datetime - from langfuse.api.client import FernLangfuse + from langfuse.client import FernLangfuse client = FernLangfuse( x_langfuse_sdk_name="YOUR_X_LANGFUSE_SDK_NAME", @@ -193,7 +193,7 @@ async def daily( import asyncio import datetime - from langfuse.api.client import AsyncFernLangfuse + from langfuse.client import AsyncFernLangfuse client = AsyncFernLangfuse( x_langfuse_sdk_name="YOUR_X_LANGFUSE_SDK_NAME", diff --git a/langfuse/api/resources/models/client.py b/langfuse/api/resources/models/client.py index c44a303d6..1ebac9d07 100644 --- a/langfuse/api/resources/models/client.py +++ b/langfuse/api/resources/models/client.py @@ -49,8 +49,8 @@ def create( -------- import datetime - from langfuse.api import CreateModelRequest, ModelUsageUnit - from langfuse.api.client import FernLangfuse + from langfuse import CreateModelRequest, ModelUsageUnit + from langfuse.client import FernLangfuse client = FernLangfuse( x_langfuse_sdk_name="YOUR_X_LANGFUSE_SDK_NAME", @@ -136,7 +136,7 @@ def list( Examples -------- - from langfuse.api.client import FernLangfuse + from langfuse.client import FernLangfuse client = FernLangfuse( x_langfuse_sdk_name="YOUR_X_LANGFUSE_SDK_NAME", @@ -202,7 +202,7 @@ def get( Examples -------- - from langfuse.api.client import FernLangfuse + from langfuse.client import FernLangfuse client = FernLangfuse( x_langfuse_sdk_name="YOUR_X_LANGFUSE_SDK_NAME", @@ -266,7 +266,7 @@ def delete( Examples -------- - from langfuse.api.client import FernLangfuse + from langfuse.client import FernLangfuse client = FernLangfuse( x_langfuse_sdk_name="YOUR_X_LANGFUSE_SDK_NAME", @@ -341,8 +341,8 @@ async def create( import asyncio import datetime - from langfuse.api import CreateModelRequest, ModelUsageUnit - from langfuse.api.client import AsyncFernLangfuse + from langfuse import CreateModelRequest, ModelUsageUnit + from langfuse.client import AsyncFernLangfuse client = AsyncFernLangfuse( x_langfuse_sdk_name="YOUR_X_LANGFUSE_SDK_NAME", @@ -436,7 +436,7 @@ async def list( -------- import asyncio - from langfuse.api.client import AsyncFernLangfuse + from langfuse.client import AsyncFernLangfuse client = AsyncFernLangfuse( x_langfuse_sdk_name="YOUR_X_LANGFUSE_SDK_NAME", @@ -510,7 +510,7 @@ async def get( -------- import asyncio - from langfuse.api.client import AsyncFernLangfuse + from langfuse.client import AsyncFernLangfuse client = AsyncFernLangfuse( x_langfuse_sdk_name="YOUR_X_LANGFUSE_SDK_NAME", @@ -582,7 +582,7 @@ async def delete( -------- import asyncio - from langfuse.api.client import AsyncFernLangfuse + from langfuse.client import AsyncFernLangfuse client = AsyncFernLangfuse( x_langfuse_sdk_name="YOUR_X_LANGFUSE_SDK_NAME", diff --git a/langfuse/api/resources/models/types/create_model_request.py b/langfuse/api/resources/models/types/create_model_request.py index 7c8d84db4..b3d8a6462 100644 --- a/langfuse/api/resources/models/types/create_model_request.py +++ b/langfuse/api/resources/models/types/create_model_request.py @@ -26,7 +26,7 @@ class CreateModelRequest(pydantic_v1.BaseModel): Apply only to generations which are newer than this ISO date. """ - unit: ModelUsageUnit = pydantic_v1.Field() + unit: typing.Optional[ModelUsageUnit] = pydantic_v1.Field(default=None) """ Unit used by this model. """ diff --git a/langfuse/api/resources/observations/client.py b/langfuse/api/resources/observations/client.py index 46190588b..d937841b9 100644 --- a/langfuse/api/resources/observations/client.py +++ b/langfuse/api/resources/observations/client.py @@ -46,7 +46,7 @@ def get( Examples -------- - from langfuse.api.client import FernLangfuse + from langfuse.client import FernLangfuse client = FernLangfuse( x_langfuse_sdk_name="YOUR_X_LANGFUSE_SDK_NAME", @@ -147,7 +147,7 @@ def get_many( -------- import datetime - from langfuse.api.client import FernLangfuse + from langfuse.client import FernLangfuse client = FernLangfuse( x_langfuse_sdk_name="YOUR_X_LANGFUSE_SDK_NAME", @@ -251,7 +251,7 @@ async def get( -------- import asyncio - from langfuse.api.client import AsyncFernLangfuse + from langfuse.client import AsyncFernLangfuse client = AsyncFernLangfuse( x_langfuse_sdk_name="YOUR_X_LANGFUSE_SDK_NAME", @@ -359,7 +359,7 @@ async def get_many( import asyncio import datetime - from langfuse.api.client import AsyncFernLangfuse + from langfuse.client import AsyncFernLangfuse client = AsyncFernLangfuse( x_langfuse_sdk_name="YOUR_X_LANGFUSE_SDK_NAME", diff --git a/langfuse/api/resources/projects/client.py b/langfuse/api/resources/projects/client.py index 7f723e629..3f4e38e6e 100644 --- a/langfuse/api/resources/projects/client.py +++ b/langfuse/api/resources/projects/client.py @@ -36,7 +36,7 @@ def get( Examples -------- - from langfuse.api.client import FernLangfuse + from langfuse.client import FernLangfuse client = FernLangfuse( x_langfuse_sdk_name="YOUR_X_LANGFUSE_SDK_NAME", @@ -101,7 +101,7 @@ async def get( -------- import asyncio - from langfuse.api.client import AsyncFernLangfuse + from langfuse.client import AsyncFernLangfuse client = AsyncFernLangfuse( x_langfuse_sdk_name="YOUR_X_LANGFUSE_SDK_NAME", diff --git a/langfuse/api/resources/prompts/client.py b/langfuse/api/resources/prompts/client.py index b900bf494..ebaa07909 100644 --- a/langfuse/api/resources/prompts/client.py +++ b/langfuse/api/resources/prompts/client.py @@ -58,7 +58,7 @@ def get( Examples -------- - from langfuse.api.client import FernLangfuse + from langfuse.client import FernLangfuse client = FernLangfuse( x_langfuse_sdk_name="YOUR_X_LANGFUSE_SDK_NAME", @@ -152,7 +152,7 @@ def list( -------- import datetime - from langfuse.api.client import FernLangfuse + from langfuse.client import FernLangfuse client = FernLangfuse( x_langfuse_sdk_name="YOUR_X_LANGFUSE_SDK_NAME", @@ -244,8 +244,8 @@ def create( Examples -------- - from langfuse.api import ChatMessage, CreatePromptRequest_Chat - from langfuse.api.client import FernLangfuse + from langfuse import ChatMessage, CreatePromptRequest_Chat + from langfuse.client import FernLangfuse client = FernLangfuse( x_langfuse_sdk_name="YOUR_X_LANGFUSE_SDK_NAME", @@ -341,7 +341,7 @@ async def get( -------- import asyncio - from langfuse.api.client import AsyncFernLangfuse + from langfuse.client import AsyncFernLangfuse client = AsyncFernLangfuse( x_langfuse_sdk_name="YOUR_X_LANGFUSE_SDK_NAME", @@ -442,7 +442,7 @@ async def list( import asyncio import datetime - from langfuse.api.client import AsyncFernLangfuse + from langfuse.client import AsyncFernLangfuse client = AsyncFernLangfuse( x_langfuse_sdk_name="YOUR_X_LANGFUSE_SDK_NAME", @@ -542,8 +542,8 @@ async def create( -------- import asyncio - from langfuse.api import ChatMessage, CreatePromptRequest_Chat - from langfuse.api.client import AsyncFernLangfuse + from langfuse import ChatMessage, CreatePromptRequest_Chat + from langfuse.client import AsyncFernLangfuse client = AsyncFernLangfuse( x_langfuse_sdk_name="YOUR_X_LANGFUSE_SDK_NAME", diff --git a/langfuse/api/resources/score/client.py b/langfuse/api/resources/score/client.py index a7e28651c..2c911449d 100644 --- a/langfuse/api/resources/score/client.py +++ b/langfuse/api/resources/score/client.py @@ -52,8 +52,8 @@ def create( Examples -------- - from langfuse.api import CreateScoreRequest - from langfuse.api.client import FernLangfuse + from langfuse import CreateScoreRequest + from langfuse.client import FernLangfuse client = FernLangfuse( x_langfuse_sdk_name="YOUR_X_LANGFUSE_SDK_NAME", @@ -183,8 +183,8 @@ def get( -------- import datetime - from langfuse.api import ScoreDataType, ScoreSource - from langfuse.api.client import FernLangfuse + from langfuse import ScoreDataType, ScoreSource + from langfuse.client import FernLangfuse client = FernLangfuse( x_langfuse_sdk_name="YOUR_X_LANGFUSE_SDK_NAME", @@ -286,7 +286,7 @@ def get_by_id( Examples -------- - from langfuse.api.client import FernLangfuse + from langfuse.client import FernLangfuse client = FernLangfuse( x_langfuse_sdk_name="YOUR_X_LANGFUSE_SDK_NAME", @@ -351,7 +351,7 @@ def delete( Examples -------- - from langfuse.api.client import FernLangfuse + from langfuse.client import FernLangfuse client = FernLangfuse( x_langfuse_sdk_name="YOUR_X_LANGFUSE_SDK_NAME", @@ -425,8 +425,8 @@ async def create( -------- import asyncio - from langfuse.api import CreateScoreRequest - from langfuse.api.client import AsyncFernLangfuse + from langfuse import CreateScoreRequest + from langfuse.client import AsyncFernLangfuse client = AsyncFernLangfuse( x_langfuse_sdk_name="YOUR_X_LANGFUSE_SDK_NAME", @@ -563,8 +563,8 @@ async def get( import asyncio import datetime - from langfuse.api import ScoreDataType, ScoreSource - from langfuse.api.client import AsyncFernLangfuse + from langfuse import ScoreDataType, ScoreSource + from langfuse.client import AsyncFernLangfuse client = AsyncFernLangfuse( x_langfuse_sdk_name="YOUR_X_LANGFUSE_SDK_NAME", @@ -674,7 +674,7 @@ async def get_by_id( -------- import asyncio - from langfuse.api.client import AsyncFernLangfuse + from langfuse.client import AsyncFernLangfuse client = AsyncFernLangfuse( x_langfuse_sdk_name="YOUR_X_LANGFUSE_SDK_NAME", @@ -747,7 +747,7 @@ async def delete( -------- import asyncio - from langfuse.api.client import AsyncFernLangfuse + from langfuse.client import AsyncFernLangfuse client = AsyncFernLangfuse( x_langfuse_sdk_name="YOUR_X_LANGFUSE_SDK_NAME", diff --git a/langfuse/api/resources/score/types/create_score_request.py b/langfuse/api/resources/score/types/create_score_request.py index 13f3cebd9..8a76f464e 100644 --- a/langfuse/api/resources/score/types/create_score_request.py +++ b/langfuse/api/resources/score/types/create_score_request.py @@ -13,7 +13,7 @@ class CreateScoreRequest(pydantic_v1.BaseModel): """ Examples -------- - from langfuse.api import CreateScoreRequest + from langfuse import CreateScoreRequest CreateScoreRequest( name="novelty", diff --git a/langfuse/api/resources/score_configs/client.py b/langfuse/api/resources/score_configs/client.py index 3a9092de0..5f8463612 100644 --- a/langfuse/api/resources/score_configs/client.py +++ b/langfuse/api/resources/score_configs/client.py @@ -47,8 +47,8 @@ def create( Examples -------- - from langfuse.api import ConfigCategory, CreateScoreConfigRequest, ScoreDataType - from langfuse.api.client import FernLangfuse + from langfuse import ConfigCategory, CreateScoreConfigRequest, ScoreDataType + from langfuse.client import FernLangfuse client = FernLangfuse( x_langfuse_sdk_name="YOUR_X_LANGFUSE_SDK_NAME", @@ -134,7 +134,7 @@ def get( Examples -------- - from langfuse.api.client import FernLangfuse + from langfuse.client import FernLangfuse client = FernLangfuse( x_langfuse_sdk_name="YOUR_X_LANGFUSE_SDK_NAME", @@ -201,7 +201,7 @@ def get_by_id( Examples -------- - from langfuse.api.client import FernLangfuse + from langfuse.client import FernLangfuse client = FernLangfuse( x_langfuse_sdk_name="YOUR_X_LANGFUSE_SDK_NAME", @@ -275,8 +275,8 @@ async def create( -------- import asyncio - from langfuse.api import ConfigCategory, CreateScoreConfigRequest, ScoreDataType - from langfuse.api.client import AsyncFernLangfuse + from langfuse import ConfigCategory, CreateScoreConfigRequest, ScoreDataType + from langfuse.client import AsyncFernLangfuse client = AsyncFernLangfuse( x_langfuse_sdk_name="YOUR_X_LANGFUSE_SDK_NAME", @@ -370,7 +370,7 @@ async def get( -------- import asyncio - from langfuse.api.client import AsyncFernLangfuse + from langfuse.client import AsyncFernLangfuse client = AsyncFernLangfuse( x_langfuse_sdk_name="YOUR_X_LANGFUSE_SDK_NAME", @@ -445,7 +445,7 @@ async def get_by_id( -------- import asyncio - from langfuse.api.client import AsyncFernLangfuse + from langfuse.client import AsyncFernLangfuse client = AsyncFernLangfuse( x_langfuse_sdk_name="YOUR_X_LANGFUSE_SDK_NAME", diff --git a/langfuse/api/resources/sessions/client.py b/langfuse/api/resources/sessions/client.py index f3814a26d..98c56e0fc 100644 --- a/langfuse/api/resources/sessions/client.py +++ b/langfuse/api/resources/sessions/client.py @@ -60,7 +60,7 @@ def list( -------- import datetime - from langfuse.api.client import FernLangfuse + from langfuse.client import FernLangfuse client = FernLangfuse( x_langfuse_sdk_name="YOUR_X_LANGFUSE_SDK_NAME", @@ -145,7 +145,7 @@ def get( Examples -------- - from langfuse.api.client import FernLangfuse + from langfuse.client import FernLangfuse client = FernLangfuse( x_langfuse_sdk_name="YOUR_X_LANGFUSE_SDK_NAME", @@ -233,7 +233,7 @@ async def list( import asyncio import datetime - from langfuse.api.client import AsyncFernLangfuse + from langfuse.client import AsyncFernLangfuse client = AsyncFernLangfuse( x_langfuse_sdk_name="YOUR_X_LANGFUSE_SDK_NAME", @@ -326,7 +326,7 @@ async def get( -------- import asyncio - from langfuse.api.client import AsyncFernLangfuse + from langfuse.client import AsyncFernLangfuse client = AsyncFernLangfuse( x_langfuse_sdk_name="YOUR_X_LANGFUSE_SDK_NAME", diff --git a/langfuse/api/resources/trace/client.py b/langfuse/api/resources/trace/client.py index 12c984828..0c33e90d5 100644 --- a/langfuse/api/resources/trace/client.py +++ b/langfuse/api/resources/trace/client.py @@ -43,7 +43,7 @@ def get( Examples -------- - from langfuse.api.client import FernLangfuse + from langfuse.client import FernLangfuse client = FernLangfuse( x_langfuse_sdk_name="YOUR_X_LANGFUSE_SDK_NAME", @@ -150,7 +150,7 @@ def list( -------- import datetime - from langfuse.api.client import FernLangfuse + from langfuse.client import FernLangfuse client = FernLangfuse( x_langfuse_sdk_name="YOUR_X_LANGFUSE_SDK_NAME", @@ -253,7 +253,7 @@ async def get( -------- import asyncio - from langfuse.api.client import AsyncFernLangfuse + from langfuse.client import AsyncFernLangfuse client = AsyncFernLangfuse( x_langfuse_sdk_name="YOUR_X_LANGFUSE_SDK_NAME", @@ -367,7 +367,7 @@ async def list( import asyncio import datetime - from langfuse.api.client import AsyncFernLangfuse + from langfuse.client import AsyncFernLangfuse client = AsyncFernLangfuse( x_langfuse_sdk_name="YOUR_X_LANGFUSE_SDK_NAME",