-
Notifications
You must be signed in to change notification settings - Fork 911
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
Conversation
SDK CLI Global Config Test Result devs/linatang/gen_tool_meta_for_eager_flow2 tests 2 ✅ 43s ⏱️ Results for commit 0f62a41. ♻️ This comment has been updated with latest results. |
Executor Unit Test Result devs/linatang/gen_tool_meta_for_eager_flow734 tests 734 ✅ 46s ⏱️ Results for commit 0f62a41. ♻️ This comment has been updated with latest results. |
promptflow SDK CLI Azure E2E Test Result devs/linatang/gen_tool_meta_for_eager_flow 4 files 4 suites 3m 23s ⏱️ Results for commit 0f62a41. ♻️ This comment has been updated with latest results. |
Executor E2E Test Result devs/linatang/gen_tool_meta_for_eager_flow197 tests 195 ✅ 4m 13s ⏱️ Results for commit 0f62a41. ♻️ This comment has been updated with latest results. |
SDK CLI Test Result devs/linatang/gen_tool_meta_for_eager_flow 12 files 12 suites 41m 23s ⏱️ Results for commit 0f62a41. ♻️ This comment has been updated with latest results. |
b857821
to
178568b
Compare
cdaf98e
to
a6824d6
Compare
…github.com/microsoft/promptflow into devs/linatang/gen_tool_meta_for_eager_flow
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:The most important changes are:
New Functionality:
src/promptflow/promptflow/_core/tool_meta_generator.py
: Added a new functioncollect_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 functiongenerate_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:
src/promptflow/tests/executor/unittests/_utils/test_generate_tool_meta_utils.py
: Added a new functioncd_and_run_generate_flow_meta(working_dir, source_path, entry, source=None)
to test the generation of flow metadata.src/promptflow/tests/executor/unittests/_utils/test_generate_tool_meta_utils.py
: Included a new test casetest_generate_flow_meta(self, flow_dir, entry_path, entry)
to validate the functionality of thegenerate_flow_meta_dict_by_file
function.Test Configurations:
src/promptflow/tests/test_configs/eager_flows/dummy_flow_with_trace/flow_with_trace.meta.json
: Added a new JSON file to the test configurations. This file contains metadata for themy_flow
function from theflow_with_trace.py
file.All Promptflow Contribution checklist:
General Guidelines and Best Practices
Testing Guidelines