发布

  • Refactor trace injection for sync/async functions to streamline logic and improve maintainability (#1878)

    frostbyte_neo 发布于 2024-01-30 08:23:57 +00:00

    Description

    This PR introduces a refactor of the inject_function_async and
    inject_function_sync functionalities in our codebase to utilize new
    helper functions _traced_async and _traced_sync. These changes are
    designed to streamline the injection of trace logging into both
    asynchronous and synchronous functions, thereby enhancing the clarity
    and maintainability of our tracing logic. Additionally, a more compact
    _traced decorator has been implemented to handle the decoration of
    both async and sync functions efficiently by referencing these two new
    helper functions. This refactor does not introduce breaking changes and
    is backward compatible with existing implementations.

    All Promptflow Contribution checklist:

    • The pull request does not introduce [breaking changes].
    • CHANGELOG is updated for new features, bug fixes or other
      significant changes.
    • I have read the contribution guidelines.
    • Create an issue and link to the pull request to get dedicated
      review from promptflow team. Learn more: suggested
      workflow
      .

    General Guidelines and Best Practices

    • Title of the pull request is clear and informative.
    • There are a small number of commits, each of which have an
      informative message. This means that previously merged commits do not
      appear in the history of the PR. For more information on cleaning up the
      commits in your PR, see this
      page
      .

    Testing Guidelines

    • Pull request includes test coverage for the included changes.
    下载附件