-
[Internal] First version of create flow with script + function in python (#1732)
发布于
2024-01-12 09:24:05 +00:00 Description
Add a new
_script_executorfor execute a script with traces support.Main changes:
src/promptflow/promptflow/executor/_script_executor.py:
Added necessary imports to the_script_executor.pyfile.
*
src/promptflow/promptflow/_core/flow_execution_context.py:
Modified the__init__method in theFlowExecutionContextclass to
have a default value for thecache_managerparameter.
*
src/promptflow/promptflow/executor/flow_executor.py:
Modified thecreatemethod in theFlowExecutorclass to add support
for creating aScriptExecutorinstance based on the file extension.
[1]
[2]
[3]Other changes:
src/promptflow/promptflow/_core/run_tracker.py:
Added a condition to theend_runmethod in theRunTrackerclass to
only update theapi_callsattribute if there are traces available.
*
src/promptflow/tests/test_configs/eager_flows/dummy_flow_with_trace/flow.py:
Added a new fileflow.pythat defines functions for waiting, calling a
dummy function, and creating tasks for different models.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.
Co-authored-by: Heyi Tang heta@microsoft.com
下载附件