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

Flex flow, Prompty & Tracing examples #1741

Merged
merged 174 commits into from
Apr 17, 2024
Merged

Conversation

wangchao1230
Copy link
Contributor

@wangchao1230 wangchao1230 commented Jan 15, 2024

Description

Add Exmples for Flex flow, Prompty & Tracing

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.

@wangchao1230 wangchao1230 requested a review from a team as a code owner January 15, 2024 06:15
@wangchao1230 wangchao1230 requested a review from D-W- January 15, 2024 06:15
@github-actions github-actions bot added the examples Improvements on examples label Jan 15, 2024
0mza987
0mza987 previously approved these changes Jan 30, 2024
@wangchao1230 wangchao1230 changed the title Basic eager mode flow example Eager mode flow example Jan 31, 2024
wangchao1230 and others added 12 commits April 15, 2024 17:51
# Description

Please add an informative description that covers that changes made by
the pull request and link all relevant issues.
This pull request primarily focuses on improving the setup and execution
of chat flows in the `examples/flex-flows/chat-basic` and
`examples/flex-flows/eval-checklist` directories. The changes include
updates to the instructions in the `README.md` files, modifications to
the `flow.flex.yaml`, `flow.py`, and `run.yml` files, and the
introduction of a new `data.jsonl` file. The changes aim to enhance
security by using connections instead of environment variables to handle
sensitive data, and to simplify the process of running flows.

**Changes to the `README.md` files:**

* `examples/flex-flows/chat-basic/README.md` and
`examples/flex-flows/eval-checklist/README.md`: The instructions for
setting up and running flows have been updated to use connections
instead of environment variables, which improves security by protecting
sensitive data like the `api_key`. The instructions also include new
steps for creating and using connections via the CLI.
[[1]](diffhunk://#diff-08393bff4f14405b29b6116caadaba65d8f5560092d1e257fd659ea294a18958L34-R77)
[[2]](diffhunk://#diff-08393bff4f14405b29b6116caadaba65d8f5560092d1e257fd659ea294a18958L91-R115)
[[3]](diffhunk://#diff-cf04c1ce62617cf5416d92ee1ac72387d6a74a00377ec85a46290c3d0c4ba822L15-R89)

**Changes to `flow.flex.yaml`, `flow.py`, and `run.yml` files:**

* `examples/flex-flows/chat-basic/flow.flex.yaml` and
`examples/flex-flows/eval-checklist/flow.flex.yaml`: The image used in
the environment has been updated.
[[1]](diffhunk://#diff-4191ca4210bc8ea07203c96879e13cd9bbca02412cc0c15fc603d87cfc124a7cL4-R4)
[[2]](diffhunk://#diff-0b7c1bab5998bd6a2a19b5a30ac8fe40eb6480acccc5024306cb512c4bd7a981L5-R5)
* `examples/flex-flows/chat-basic/flow.py` and
`examples/flex-flows/eval-checklist/check_list.py`: The `__init__`
method in the `ChatFlow` and `EvalFlow` classes now accepts a
`connection` parameter of type `AzureOpenAIConnection`. The `check`
function in `check_list.py` also accepts a `connection` parameter. These
changes enable the use of connections instead of environment variables
to handle sensitive data.
[[1]](diffhunk://#diff-712e81e55bbcb456a16872ec9cd2c3ea99434b0277199bba7a2311dfccb8799cL31-R32)
[[2]](diffhunk://#diff-b4c78fd0ce03cc89ca5b96fe203ea58200bdecad9a95b604aad6ad37563eee5eL27-R27)
[[3]](diffhunk://#diff-b4c78fd0ce03cc89ca5b96fe203ea58200bdecad9a95b604aad6ad37563eee5eL40-L48)
[[4]](diffhunk://#diff-b4c78fd0ce03cc89ca5b96fe203ea58200bdecad9a95b604aad6ad37563eee5eL62-R54)
[[5]](diffhunk://#diff-b4c78fd0ce03cc89ca5b96fe203ea58200bdecad9a95b604aad6ad37563eee5eL72-R63)
* `examples/flex-flows/chat-basic/run.yml` and
`examples/flex-flows/eval-checklist/run.yml`: The
`environment_variables` section has been replaced with an `init` section
that specifies the connection to use. This change enhances security by
using connections to handle sensitive data.
[[1]](diffhunk://#diff-101cc4281c2c98e490c23adc2f74ab5b97fec842923a184e70df16fec8092babL4-R5)
[[2]](diffhunk://#diff-dcf63cfc7e0324eb4e322603e4cf85c7da4ac08bcf64bb4f1fee97ee442b218cR1-R6)

**New `data.jsonl` file:**

*
[`examples/flex-flows/eval-checklist/data.jsonl`](diffhunk://#diff-68e7f76ae2fed6d723d0d618bf06c0bb3aa9f951c2ff2afa57d6f8f19376c6d7R1):
This new file contains data for evaluating the chat flow.
# 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](../CONTRIBUTING.md).**
- [ ] **Create an issue and link to the pull request to get dedicated
review from promptflow team. Learn more: [suggested
workflow](../CONTRIBUTING.md#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](https://github.com/Azure/azure-powershell/blob/master/documentation/development-docs/cleaning-up-commits.md).

### Testing Guidelines
- [ ] Pull request includes test coverage for the included changes.
@wangchao1230 wangchao1230 merged commit 6d91214 into main Apr 17, 2024
79 checks passed
@wangchao1230 wangchao1230 deleted the clwan/eager-mode-sample branch April 17, 2024 10:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation examples Improvements on examples fundamental
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants