Skip to content

Commit fa5346c

Browse files
authored
chore: update auto gen SDK (#1300)
* unrelated changes to generated sdk * also readme * reset * revert * revert
1 parent 599ee51 commit fa5346c

21 files changed

+1798
-16
lines changed

langfuse/_client/observe.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
Union,
1717
cast,
1818
overload,
19+
get_args,
1920
)
2021

2122
from opentelemetry.util._decorator import _AgnosticContextManager

langfuse/api/README.md

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ pip install langfuse
1616
Instantiate and use the client with the following:
1717

1818
```python
19-
from langfuse import AnnotationQueueObjectType, CreateAnnotationQueueItemRequest
19+
from langfuse import CreateAnnotationQueueRequest
2020
from langfuse.client import FernLangfuse
2121

2222
client = FernLangfuse(
@@ -27,11 +27,10 @@ client = FernLangfuse(
2727
password="YOUR_PASSWORD",
2828
base_url="https://yourhost.com/path/to/api",
2929
)
30-
client.annotation_queues.create_queue_item(
31-
queue_id="queueId",
32-
request=CreateAnnotationQueueItemRequest(
33-
object_id="objectId",
34-
object_type=AnnotationQueueObjectType.TRACE,
30+
client.annotation_queues.create_queue(
31+
request=CreateAnnotationQueueRequest(
32+
name="name",
33+
score_config_ids=["scoreConfigIds", "scoreConfigIds"],
3534
),
3635
)
3736
```
@@ -43,7 +42,7 @@ The SDK also exports an `async` client so that you can make non-blocking calls t
4342
```python
4443
import asyncio
4544

46-
from langfuse import AnnotationQueueObjectType, CreateAnnotationQueueItemRequest
45+
from langfuse import CreateAnnotationQueueRequest
4746
from langfuse.client import AsyncFernLangfuse
4847

4948
client = AsyncFernLangfuse(
@@ -57,11 +56,10 @@ client = AsyncFernLangfuse(
5756

5857

5958
async def main() -> None:
60-
await client.annotation_queues.create_queue_item(
61-
queue_id="queueId",
62-
request=CreateAnnotationQueueItemRequest(
63-
object_id="objectId",
64-
object_type=AnnotationQueueObjectType.TRACE,
59+
await client.annotation_queues.create_queue(
60+
request=CreateAnnotationQueueRequest(
61+
name="name",
62+
score_config_ids=["scoreConfigIds", "scoreConfigIds"],
6563
),
6664
)
6765

@@ -78,7 +76,7 @@ will be thrown.
7876
from .api_error import ApiError
7977

8078
try:
81-
client.annotation_queues.create_queue_item(...)
79+
client.annotation_queues.create_queue(...)
8280
except ApiError as e:
8381
print(e.status_code)
8482
print(e.body)
@@ -101,7 +99,7 @@ A request is deemed retriable when any of the following HTTP status codes is ret
10199
Use the `max_retries` request option to configure this behavior.
102100

103101
```python
104-
client.annotation_queues.create_queue_item(...,{
102+
client.annotation_queues.create_queue(...,{
105103
max_retries=1
106104
})
107105
```
@@ -118,7 +116,7 @@ client = FernLangfuse(..., { timeout=20.0 }, )
118116

119117

120118
# Override timeout for a specific method
121-
client.annotation_queues.create_queue_item(...,{
119+
client.annotation_queues.create_queue(...,{
122120
timeout_in_seconds=1
123121
})
124122
```

langfuse/api/__init__.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from .resources import (
44
AccessDeniedError,
55
AnnotationQueue,
6+
AnnotationQueueAssignmentRequest,
67
AnnotationQueueItem,
78
AnnotationQueueObjectType,
89
AnnotationQueueStatus,
@@ -28,7 +29,9 @@
2829
Comment,
2930
CommentObjectType,
3031
ConfigCategory,
32+
CreateAnnotationQueueAssignmentResponse,
3133
CreateAnnotationQueueItemRequest,
34+
CreateAnnotationQueueRequest,
3235
CreateChatPromptRequest,
3336
CreateCommentRequest,
3437
CreateCommentResponse,
@@ -57,6 +60,7 @@
5760
DatasetRunItem,
5861
DatasetRunWithItems,
5962
DatasetStatus,
63+
DeleteAnnotationQueueAssignmentResponse,
6064
DeleteAnnotationQueueItemResponse,
6165
DeleteDatasetItemResponse,
6266
DeleteDatasetRunResponse,
@@ -93,6 +97,8 @@
9397
IngestionResponse,
9498
IngestionSuccess,
9599
IngestionUsage,
100+
LlmAdapter,
101+
LlmConnection,
96102
MapValue,
97103
MediaContentType,
98104
MembershipRequest,
@@ -126,6 +132,7 @@
126132
PaginatedDatasetRunItems,
127133
PaginatedDatasetRuns,
128134
PaginatedDatasets,
135+
PaginatedLlmConnections,
129136
PaginatedModels,
130137
PaginatedSessions,
131138
PatchMediaBody,
@@ -185,6 +192,7 @@
185192
UpdateObservationEvent,
186193
UpdateSpanBody,
187194
UpdateSpanEvent,
195+
UpsertLlmConnectionRequest,
188196
Usage,
189197
UsageDetails,
190198
UserMeta,
@@ -196,6 +204,7 @@
196204
datasets,
197205
health,
198206
ingestion,
207+
llm_connections,
199208
media,
200209
metrics,
201210
models,
@@ -216,6 +225,7 @@
216225
__all__ = [
217226
"AccessDeniedError",
218227
"AnnotationQueue",
228+
"AnnotationQueueAssignmentRequest",
219229
"AnnotationQueueItem",
220230
"AnnotationQueueObjectType",
221231
"AnnotationQueueStatus",
@@ -241,7 +251,9 @@
241251
"Comment",
242252
"CommentObjectType",
243253
"ConfigCategory",
254+
"CreateAnnotationQueueAssignmentResponse",
244255
"CreateAnnotationQueueItemRequest",
256+
"CreateAnnotationQueueRequest",
245257
"CreateChatPromptRequest",
246258
"CreateCommentRequest",
247259
"CreateCommentResponse",
@@ -270,6 +282,7 @@
270282
"DatasetRunItem",
271283
"DatasetRunWithItems",
272284
"DatasetStatus",
285+
"DeleteAnnotationQueueAssignmentResponse",
273286
"DeleteAnnotationQueueItemResponse",
274287
"DeleteDatasetItemResponse",
275288
"DeleteDatasetRunResponse",
@@ -306,6 +319,8 @@
306319
"IngestionResponse",
307320
"IngestionSuccess",
308321
"IngestionUsage",
322+
"LlmAdapter",
323+
"LlmConnection",
309324
"MapValue",
310325
"MediaContentType",
311326
"MembershipRequest",
@@ -339,6 +354,7 @@
339354
"PaginatedDatasetRunItems",
340355
"PaginatedDatasetRuns",
341356
"PaginatedDatasets",
357+
"PaginatedLlmConnections",
342358
"PaginatedModels",
343359
"PaginatedSessions",
344360
"PatchMediaBody",
@@ -398,6 +414,7 @@
398414
"UpdateObservationEvent",
399415
"UpdateSpanBody",
400416
"UpdateSpanEvent",
417+
"UpsertLlmConnectionRequest",
401418
"Usage",
402419
"UsageDetails",
403420
"UserMeta",
@@ -409,6 +426,7 @@
409426
"datasets",
410427
"health",
411428
"ingestion",
429+
"llm_connections",
412430
"media",
413431
"metrics",
414432
"models",

langfuse/api/client.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@
1818
from .resources.datasets.client import AsyncDatasetsClient, DatasetsClient
1919
from .resources.health.client import AsyncHealthClient, HealthClient
2020
from .resources.ingestion.client import AsyncIngestionClient, IngestionClient
21+
from .resources.llm_connections.client import (
22+
AsyncLlmConnectionsClient,
23+
LlmConnectionsClient,
24+
)
2125
from .resources.media.client import AsyncMediaClient, MediaClient
2226
from .resources.metrics.client import AsyncMetricsClient, MetricsClient
2327
from .resources.models.client import AsyncModelsClient, ModelsClient
@@ -120,6 +124,7 @@ def __init__(
120124
self.datasets = DatasetsClient(client_wrapper=self._client_wrapper)
121125
self.health = HealthClient(client_wrapper=self._client_wrapper)
122126
self.ingestion = IngestionClient(client_wrapper=self._client_wrapper)
127+
self.llm_connections = LlmConnectionsClient(client_wrapper=self._client_wrapper)
123128
self.media = MediaClient(client_wrapper=self._client_wrapper)
124129
self.metrics = MetricsClient(client_wrapper=self._client_wrapper)
125130
self.models = ModelsClient(client_wrapper=self._client_wrapper)
@@ -218,6 +223,9 @@ def __init__(
218223
self.datasets = AsyncDatasetsClient(client_wrapper=self._client_wrapper)
219224
self.health = AsyncHealthClient(client_wrapper=self._client_wrapper)
220225
self.ingestion = AsyncIngestionClient(client_wrapper=self._client_wrapper)
226+
self.llm_connections = AsyncLlmConnectionsClient(
227+
client_wrapper=self._client_wrapper
228+
)
221229
self.media = AsyncMediaClient(client_wrapper=self._client_wrapper)
222230
self.metrics = AsyncMetricsClient(client_wrapper=self._client_wrapper)
223231
self.models = AsyncModelsClient(client_wrapper=self._client_wrapper)

0 commit comments

Comments
 (0)