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

[Executor] Gen flow meta for eager flow #2027

Merged
merged 12 commits into from
Feb 22, 2024

Conversation

lumoslnt
Copy link
Contributor

@lumoslnt lumoslnt commented Feb 18, 2024

Description

This pull request primarily adds function that generating flow meta for eager flow. the flow meta is similar to tool meta, including entry, function name, inputs, outputs and source. The function will be called by SDK and save the metadata to flow.json. Expected flow meta:

{
    "function": "my_flow",
    "entry": "flow_with_trace:my_flow",
    "inputs": {
        "text": {
            "type": "string"
        },
        "models": {
            "type": "list"
        }
    },
    "outputs": {
        "output": {
            "type": "string"
        }
    },
    "source": "flow_with_trace.py"
}

The most important changes are:

New Functionality:

  • src/promptflow/promptflow/_core/tool_meta_generator.py: Added a new function collect_flow_entry_in_module(m, entry) to collect flow entries from a module. This function inspects the module members and returns the function corresponding to the provided entry.
  • src/promptflow/promptflow/_core/tool_meta_generator.py: Introduced another function generate_flow_meta_dict_by_file(path: str, entry: str, source: str = None). This function generates a dictionary containing metadata about a eager flow, including its entry, function name, inputs, outputs, and source if provided.

Unit Tests:

Test Configurations:

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.

@lumoslnt lumoslnt requested a review from a team as a code owner February 18, 2024 03:03
@github-actions github-actions bot added promptflow executor The changes related to the execution of the flow labels Feb 18, 2024
Copy link

github-actions bot commented Feb 18, 2024

SDK CLI Global Config Test Result devs/linatang/gen_tool_meta_for_eager_flow

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

Results for commit 0f62a41.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented Feb 18, 2024

Executor Unit Test Result devs/linatang/gen_tool_meta_for_eager_flow

734 tests   734 ✅  46s ⏱️
  1 suites    0 💤
  1 files      0 ❌

Results for commit 0f62a41.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented Feb 18, 2024

promptflow SDK CLI Azure E2E Test Result devs/linatang/gen_tool_meta_for_eager_flow

  4 files    4 suites   3m 23s ⏱️
148 tests 127 ✅ 21 💤 0 ❌
592 runs  508 ✅ 84 💤 0 ❌

Results for commit 0f62a41.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented Feb 18, 2024

Executor E2E Test Result devs/linatang/gen_tool_meta_for_eager_flow

197 tests   195 ✅  4m 13s ⏱️
  1 suites    2 💤
  1 files      0 ❌

Results for commit 0f62a41.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented Feb 18, 2024

SDK CLI Test Result devs/linatang/gen_tool_meta_for_eager_flow

   12 files     12 suites   41m 23s ⏱️
  422 tests   406 ✅ 16 💤 0 ❌
1 688 runs  1 624 ✅ 64 💤 0 ❌

Results for commit 0f62a41.

♻️ This comment has been updated with latest results.

D-W-
D-W- previously approved these changes Feb 22, 2024
@lumoslnt lumoslnt merged commit 4b6c6b1 into main Feb 22, 2024
42 checks passed
@lumoslnt lumoslnt deleted the devs/linatang/gen_tool_meta_for_eager_flow branch February 22, 2024 10:12
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants