Unify AI flex flow example
Description
Adds demonstration of promptflow code generation/evaluation flex flow using Unify AI (instead of OpenAI or Azure OpenAI APIs). Code is added under promptflow/flex-flows/examples/unify-ai.
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.
- [ ] I confirm that all new dependencies are compatible with the MIT license.
- [ ] 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.
@microsoft-github-policy-service agree
@crazygao @D-W- @wangchao1230 @KatoStevenMubiru I have addressed your comments, Please review the changes.
Hi Riddhi,
I've taken look at your pull request, and it's even better now! I can see you've addressed many of the initial points, and the files are much more complete. The
READMEis especially impressive with all the details and instructions. I also like what you've added the Jupyter Notebook(flex-flow-quickstart-unify-ai.ipynb)– it's a great way to guide users through the integration.I still have a couple of small suggestions:
- In
code-eval-flow.flex.yaml,I see you're using python_requirements.txt. Have you considered using a Docker image for the environment? It might be worth exploring for consistency, especially in cloud deployments.- In
code_quality_unify_ai.py, could you add some error handling around json.loads(output) to handle unexpected responses? Also, could you clarify why you're using the OpenAIModelConfiguration with Unify AI?- It might be helpful to add a bit more explanation about the aggregate method in
code_quality_unify_ai.py.Overall, this is a fantastic contribution! You've clearly put a lot of effort into it, and I'm sure it will be a valuable addition to PromptFlow. Thanks again!
- In
code-eval-flow.flex.yaml: This is standard way of specifying a python requirement for promptflow flex flow. - I did read through the documentation and from what I understand Prompty class used in code eval handles errors internally. Refer https://github.com/microsoft/promptflow/blob/main/src/promptflow-core/promptflow/core/_flow.py
- Code evaluator follows standard template for class based flex flow https://microsoft.github.io/promptflow/how-to-guides/develop-a-flex-flow/class-based-flow.html