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

[SDK] Support streaming in eager mode #2248

Merged
merged 12 commits into from
Mar 13, 2024
Merged

Conversation

D-W-
Copy link
Contributor

@D-W- D-W- commented Mar 7, 2024

Description

Please add an informative description that covers that changes made by the pull request and link all relevant issues.

This pull request involves changes across multiple files in the src/promptflow directory, primarily focusing on improving generator output handling and testing. The main changes include the introduction of generator output handling in test_submitter.py and _script_executor.py, addition of new test cases for generator outputs, and modification of existing methods to support generator outputs.

Generator output handling:

  • src/promptflow/promptflow/_sdk/_submitter/test_submitter.py: The flow_test method has been simplified to always call _get_generator_outputs on line_result.output [1]. The _get_generator_outputs method has been expanded to handle both dictionary and generator type outputs [2].
  • src/promptflow/promptflow/executor/_script_executor.py: Imported GeneratorType from the types module [1]. Updated the exec_line and _exec_line methods to accept a new allow_generator_output parameter [2]. Depending on the value of allow_generator_output, the output is either stringified or left as is [3]. Added a new _stringify_generator_output method to convert generator output to a string [4].

Test case additions and modifications:

Additional changes:

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.

@D-W- D-W- requested review from a team as code owners March 7, 2024 07:38
@github-actions github-actions bot added sdk prompt flow SDK promptflow executor The changes related to the execution of the flow labels Mar 7, 2024
Copy link

github-actions bot commented Mar 7, 2024

SDK CLI Global Config Test Result wanhan/eager_flow_steaming

2 tests   2 ✅  47s ⏱️
1 suites  0 💤
1 files    0 ❌

Results for commit 0158ae2.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented Mar 7, 2024

promptflow-tracing unit test result wanhan/eager_flow_steaming

 4 files   4 suites   22s ⏱️
 4 tests  4 ✅ 0 💤 0 ❌
16 runs  16 ✅ 0 💤 0 ❌

Results for commit 0158ae2.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented Mar 7, 2024

Executor Unit Test Result wanhan/eager_flow_steaming

754 tests   754 ✅  3m 49s ⏱️
  1 suites    0 💤
  1 files      0 ❌

Results for commit 0158ae2.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented Mar 7, 2024

promptflow SDK CLI Azure E2E Test Result wanhan/eager_flow_steaming

  4 files    4 suites   3m 47s ⏱️
178 tests 159 ✅ 19 💤 0 ❌
712 runs  636 ✅ 76 💤 0 ❌

Results for commit 0158ae2.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented Mar 7, 2024

Executor E2E Test Result wanhan/eager_flow_steaming

211 tests   209 ✅  6m 52s ⏱️
  1 suites    2 💤
  1 files      0 ❌

Results for commit 0158ae2.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented Mar 7, 2024

SDK CLI Test Result wanhan/eager_flow_steaming

   12 files     12 suites   40m 56s ⏱️
  475 tests   458 ✅ 17 💤 0 ❌
1 900 runs  1 832 ✅ 68 💤 0 ❌

Results for commit 0158ae2.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented Mar 11, 2024

promptflow-tracing e2e test result wanhan/eager_flow_steaming

 4 files   4 suites   1m 51s ⏱️
 8 tests  8 ✅ 0 💤 0 ❌
32 runs  32 ✅ 0 💤 0 ❌

Results for commit 0158ae2.

♻️ This comment has been updated with latest results.

thy09
thy09 previously approved these changes Mar 13, 2024
@wangchao1230 wangchao1230 merged commit 00d77f2 into main Mar 13, 2024
57 checks passed
@wangchao1230 wangchao1230 deleted the wanhan/eager_flow_steaming branch March 13, 2024 11:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
executor The changes related to the execution of the flow promptflow sdk prompt flow SDK
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants