发布

  • [OPIK-4215] [SDK] Add annotation queue support to Python SDK (#5069)

    frostbyte_neo 发布于 2026-02-06 14:30:59 +00:00

    • [OPIK-4215] [SDK] Add annotation queue support to Python SDK

    Implement annotation queue API objects and operations in the Python SDK.
    Add comprehensive tests and documentation for annotation queue functionality.

    Implements OPIK-4215: Fix annotation queue thread ID handling

    Co-authored-by: Cursor cursoragent@cursor.com

    • change docs slightly

    • move _ensure_rest_api_call_respecting_rate_limit into centralised place

    • fix test

    • more realistic documentation

    • Refactor REST API call handling by moving rate limit logic to a new rest_helpers module. Update relevant usages across the SDK to ensure consistent handling of rate limit errors. Adjust default maximum results in get_annotation_queues method for improved performance.

    • Refactor annotation queue handling in Python SDK to introduce distinct TracesAnnotationQueue and ThreadsAnnotationQueue classes. Update related methods and documentation to reflect these changes, ensuring clearer API usage. Remove deprecated scope handling and enhance test coverage for new queue functionalities.

    • Add ANNOTATION_QUEUE_ITEMS_MAX_BATCH_SIZE constant to improve batch size management in annotation queue processing.

    • Refactor annotation queue creation in Opik client to use a generic queue class parameter. Update TracesAnnotationQueue and ThreadsAnnotationQueue to define their scopes as class properties, enhancing code clarity and maintainability.

    • Enhance end-to-end tests for annotation queues by introducing dedicated verification functions for traces and threads. Replace direct assertions with calls to verifiers for improved test clarity and maintainability.


    Co-authored-by: Cursor cursoragent@cursor.com

    下载附件