@@ -16,7 +16,7 @@ pip install langfuse
1616Instantiate and use the client with the following:
1717
1818``` python
19- from langfuse import CreateCommentRequest
19+ from langfuse import AnnotationQueueObjectType, CreateAnnotationQueueItemRequest
2020from langfuse.client import FernLangfuse
2121
2222client = FernLangfuse(
@@ -27,12 +27,11 @@ client = FernLangfuse(
2727 password = " YOUR_PASSWORD" ,
2828 base_url = " https://yourhost.com/path/to/api" ,
2929)
30- client.comments.create(
31- request = CreateCommentRequest(
32- project_id = " projectId" ,
33- object_type = " objectType" ,
30+ client.annotation_queues.create_queue_item(
31+ queue_id = " queueId" ,
32+ request = CreateAnnotationQueueItemRequest(
3433 object_id = " objectId" ,
35- content = " content " ,
34+ object_type = AnnotationQueueObjectType. TRACE ,
3635 ),
3736)
3837```
@@ -44,7 +43,7 @@ The SDK also exports an `async` client so that you can make non-blocking calls t
4443``` python
4544import asyncio
4645
47- from langfuse import CreateCommentRequest
46+ from langfuse import AnnotationQueueObjectType, CreateAnnotationQueueItemRequest
4847from langfuse.client import AsyncFernLangfuse
4948
5049client = AsyncFernLangfuse(
@@ -58,12 +57,11 @@ client = AsyncFernLangfuse(
5857
5958
6059async def main () -> None :
61- await client.comments.create(
62- request = CreateCommentRequest(
63- project_id = " projectId" ,
64- object_type = " objectType" ,
60+ await client.annotation_queues.create_queue_item(
61+ queue_id = " queueId" ,
62+ request = CreateAnnotationQueueItemRequest(
6563 object_id = " objectId" ,
66- content = " content " ,
64+ object_type = AnnotationQueueObjectType. TRACE ,
6765 ),
6866 )
6967
@@ -80,7 +78,7 @@ will be thrown.
8078from .api_error import ApiError
8179
8280try :
83- client.comments.create (... )
81+ client.annotation_queues.create_queue_item (... )
8482except ApiError as e:
8583 print (e.status_code)
8684 print (e.body)
@@ -103,7 +101,7 @@ A request is deemed retriable when any of the following HTTP status codes is ret
103101Use the ` max_retries ` request option to configure this behavior.
104102
105103``` python
106- client.comments.create (... ,{
104+ client.annotation_queues.create_queue_item (... ,{
107105 max_retries=1
108106})
109107```
@@ -120,7 +118,7 @@ client = FernLangfuse(..., { timeout=20.0 }, )
120118
121119
122120# Override timeout for a specific method
123- client.comments.create (... ,{
121+ client.annotation_queues.create_queue_item (... ,{
124122 timeout_in_seconds=1
125123})
126124```
0 commit comments