Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support context manager protocol for traced iterator APIs #3179

Merged
merged 27 commits into from May 17, 2024

Conversation

guming-learning
Copy link
Contributor

@guming-learning guming-learning commented May 9, 2024

Description

OpenAI SDK now returns Stream object for streaming Chat Completion API, which is a ContextManager as well as an Iterator.
When we wrap it for tracing, we need to ensure the wrapped object support both. Otherwise, client code leveraging context manager functionality will fail.

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.

@guming-learning guming-learning requested a review from a team as a code owner May 9, 2024 12:22
Copy link

github-actions bot commented May 9, 2024

promptflow-tracing test result

 12 files   12 suites   7m 40s ⏱️
 20 tests  20 ✅ 0 💤 0 ❌
240 runs  240 ✅ 0 💤 0 ❌

Results for commit c980736.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented May 9, 2024

promptflow SDK CLI Azure E2E Test Result migu/context-manager

  4 files    4 suites   4m 8s ⏱️
243 tests 204 ✅  39 💤 0 ❌
972 runs  816 ✅ 156 💤 0 ❌

Results for commit c980736.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented May 9, 2024

SDK CLI Global Config Test Result migu/context-manager

6 tests   6 ✅  1m 19s ⏱️
1 suites  0 💤
1 files    0 ❌

Results for commit c980736.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented May 9, 2024

promptflow-core test result

0 tests   0 ✅  0s ⏱️
0 suites  0 💤
0 files    0 ❌

Results for commit c980736.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented May 9, 2024

Executor Unit Test Result migu/context-manager

796 tests   796 ✅  3m 43s ⏱️
  1 suites    0 💤
  1 files      0 ❌

Results for commit c980736.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented May 9, 2024

Executor E2E Test Result migu/context-manager

246 tests   240 ✅  5m 0s ⏱️
  1 suites    6 💤
  1 files      0 ❌

Results for commit c980736.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented May 9, 2024

SDK CLI Test Result migu/context-manager

    4 files      4 suites   1h 4m 55s ⏱️
  783 tests   740 ✅  43 💤 0 ❌
3 132 runs  2 960 ✅ 172 💤 0 ❌

Results for commit c980736.

♻️ This comment has been updated with latest results.

@guming-learning guming-learning merged commit 1f3d495 into main May 17, 2024
80 checks passed
@guming-learning guming-learning deleted the migu/context-manager branch May 17, 2024 07:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants