@@ -16,7 +16,7 @@ pip install langfuse
1616Instantiate and use the client with the following:
1717
1818``` python
19- from langfuse import AnnotationQueueObjectType, CreateAnnotationQueueItemRequest
19+ from langfuse import CreateAnnotationQueueRequest
2020from langfuse.client import FernLangfuse
2121
2222client = 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
4443import asyncio
4544
46- from langfuse import AnnotationQueueObjectType, CreateAnnotationQueueItemRequest
45+ from langfuse import CreateAnnotationQueueRequest
4746from langfuse.client import AsyncFernLangfuse
4847
4948client = AsyncFernLangfuse(
@@ -57,11 +56,10 @@ client = AsyncFernLangfuse(
5756
5857
5958async 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.
7876from .api_error import ApiError
7977
8078try :
81- client.annotation_queues.create_queue_item (... )
79+ client.annotation_queues.create_queue (... )
8280except 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
10199Use 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```
0 commit comments