microsoft / promptflow

Build high-quality LLM apps - from prototyping, testing to production deployment and monitoring.
https://microsoft.github.io/promptflow/
MIT License
8.32k stars 712 forks source link

[Sample] Add a sample which converts a langchain app to flex flow with custom connection #3090

Closed D-W- closed 1 week ago

D-W- commented 2 weeks ago

Description

Please add an informative description that covers that changes made by the pull request and link all relevant issues.

This pull request introduces a new feature to the langchain-eval example in the flex-flows directory. The new feature includes a workflow for evaluating language chains, as well as changes to the README, data, and requirements files. The most significant changes are:

  1. A new GitHub workflow file .github/workflows/samples_flexflows_langchaineval_langchaineval.yml was added. This workflow is scheduled to run daily and on pull requests that modify specific paths. It sets up a Python 3.9 environment, installs requirements, and runs a notebook test, among other steps.

  2. The examples/README.md file was updated to include a link to the langchain-eval.ipynb notebook and its corresponding workflow badge.

  3. Two new data entries were added to the examples/flex-flows/langchain-eval/data.jsonl file.

  4. The examples/flex-flows/langchain-eval/flow.flex.yaml file was added, which contains the schema and entry point for the new feature.

  5. A new Python file examples/flex-flows/langchain-eval/flow.py was added. This file contains the LangChainEvaluator class, which is used to evaluate language chains.

  6. The examples/flex-flows/langchain-eval/langchain-eval.ipynb notebook was added. This notebook provides a tutorial on how to use the new feature.

  7. The examples/flex-flows/langchain-eval/requirements.txt file was updated to include the promptflow and langchain packages, as well as the python-dotenv package.

All Promptflow Contribution checklist:

General Guidelines and Best Practices

Testing Guidelines