发布

  • [OPIK-2376] [P SDK] Improve HTTPX client customization API (#3245)

    frostbyte_neo 发布于 2025-09-15 09:52:12 +00:00

    • [OPIK-2876] [P SDK] Introduce customizable hooks for HTTPX client initialization and validation
    • Added HttpxClientHook for registering callable hooks and initialization argument overrides.
    • Updated HTTPX client initialization logic to support global hook application.
    • Replaced deprecated hook registration with add_httpx_client_hook.
    • Overhauled tests for httpx_client and s3_httpx_client to validate hook behavior and argument customization.
    • Enhanced documentation and logging for hook functionality.
    • Refactored opik/hooks.py to manage hook lifecycle and execution.
    • [OPIK-2876] Update documentation with an example for customizing HTTPX client in Python SDK
    • Added a section describing advanced HTTP client configuration in the SDK documentation.
    • Included a Python code example demonstrating custom httpx.Client hook usage.
    • [OPIK-2876] Fixed typo and removed unnecessary global declarations.

    • [OPIK-2376] [P SDK] Refactor hooks module for better organization and update deprecation notice

    • Moved httpx_client_hook logic to a new dedicated module.
    • Added __init__.py for streamlined imports and to improve package structure.
    • [OPIK-2376] Update httpx_client and s3_httpx_client to use proper module path

    • [OPIK-2376] Rename hook and httpx_client_arguments to client_modifier and client_init_arguments

    • Refactored HttpxClientHook to improve parameter clarity.
    • Updated tests and documentation to use the new parameter names.
    • Ensured consistency across the SDK and unit tests.
    下载附件