From bac4786e319521ffafd9ddb62172b682fb710304 Mon Sep 17 00:00:00 2001 From: wehub-resource-sync Date: Mon, 13 Jul 2026 10:49:35 +0000 Subject: [PATCH] docs: make Chinese README the default --- README.md | 166 ++++++++++++++++++++++++++---------------------------- 1 file changed, 81 insertions(+), 85 deletions(-) diff --git a/README.md b/README.md index 44fec62..43b8e2a 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,9 @@ + +> [!NOTE] +> 本文档由 WeHub 基于上游 README 翻译整理,属于社区翻译,非官方中文文档。 +> [English](./README.en.md) · [原始项目](https://github.com/microsoft/promptflow) · [上游 README](https://github.com/microsoft/promptflow/blob/HEAD/README.md) +> 原作者、版权与许可证归属以原始项目及本仓库 LICENSE 文件为准。 + # Prompt flow [![Python package](https://img.shields.io/pypi/v/promptflow)](https://pypi.org/project/promptflow/) @@ -12,166 +18,156 @@ [![CONTRIBUTING](https://img.shields.io/badge/Contributing-8A2BE2)](https://github.com/microsoft/promptflow/blob/main/CONTRIBUTING.md) [![License: MIT](https://img.shields.io/github/license/microsoft/promptflow)](https://github.com/microsoft/promptflow/blob/main/LICENSE) -> Welcome to join us to make prompt flow better by -> participating [discussions](https://github.com/microsoft/promptflow/discussions), -> opening [issues](https://github.com/microsoft/promptflow/issues/new/choose), -> submitting [PRs](https://github.com/microsoft/promptflow/pulls). +> 欢迎加入我们,通过参与 [讨论](https://github.com/microsoft/promptflow/discussions), +> 提交 [issue](https://github.com/microsoft/promptflow/issues/new/choose), +> 贡献 [PR](https://github.com/microsoft/promptflow/pulls). +> 让 prompt flow 变得更好。 -**Prompt flow** is a suite of development tools designed to streamline the end-to-end development cycle of LLM-based AI applications, from ideation, prototyping, testing, evaluation to production deployment and monitoring. It makes prompt engineering much easier and enables you to build LLM apps with production quality. +**Prompt flow** 是一套开发工具,旨在简化基于 LLM 的 AI 应用端到端开发周期,涵盖构思、原型设计、测试、评估到生产部署与监控。它让提示词工程(prompt engineering)更加轻松,并帮助你构建具备生产质量的 LLM 应用。 -With prompt flow, you will be able to: +借助 prompt flow,你可以: -- **Create and iteratively develop flow** - - Create executable [flows](https://microsoft.github.io/promptflow/concepts/concept-flows.html) that link LLMs, prompts, Python code and other [tools](https://microsoft.github.io/promptflow/concepts/concept-tools.html) together. - - Debug and iterate your flows, especially [tracing interaction with LLMs](https://microsoft.github.io/promptflow/how-to-guides/tracing/index.html) with ease. -- **Evaluate flow quality and performance** - - Evaluate your flow's quality and performance with larger datasets. - - Integrate the testing and evaluation into your CI/CD system to ensure quality of your flow. -- **Streamlined development cycle for production** - - Deploy your flow to the serving platform you choose or integrate into your app's code base easily. - - (Optional but highly recommended) Collaborate with your team by leveraging the cloud version of [Prompt flow in Azure AI](https://learn.microsoft.com/en-us/azure/machine-learning/prompt-flow/overview-what-is-prompt-flow?view=azureml-api-2). +- **创建并迭代开发 flow** + - 创建可执行的 [flow](https://microsoft.github.io/promptflow/concepts/concept-flows.html),将 LLM、提示词、Python 代码及其他 [工具](https://microsoft.github.io/promptflow/concepts/concept-tools.html) 串联在一起。 + - 调试并迭代你的 flow,尤其是轻松实现 [与 LLM 交互的追踪(tracing)](https://microsoft.github.io/promptflow/how-to-guides/tracing/index.html)。 +- **评估 flow 质量与性能** + - 使用更大数据集评估 flow 的质量与性能。 + - 将测试与评估集成到 CI/CD 系统中,确保 flow 质量。 +- **面向生产的精简开发周期** + - 将 flow 部署到你选择的 serving 平台,或轻松集成到应用代码库中。 + - (可选但强烈推荐)通过 [Azure AI 中的 Prompt flow](https://learn.microsoft.com/en-us/azure/machine-learning/prompt-flow/overview-what-is-prompt-flow?view=azureml-api-2). 云版本与团队协作。 ------ -## Installation +## 安装 -To get started quickly, you can use a pre-built development environment. **Click the button below** to open the repo in GitHub Codespaces, and then continue the readme! +若要快速上手,可使用预构建的开发环境。**点击下方按钮**在 GitHub Codespaces 中打开该仓库,然后继续阅读 readme! [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/microsoft/promptflow?quickstart=1) -If you want to get started in your local environment, first install the packages: +若要在本地环境开始,请先安装相关包: -Ensure you have a python environment, `python>=3.9, <=3.11` is recommended. +请确保已配置 Python 环境,推荐使用 `python>=3.9, <=3.11`。 ```sh pip install promptflow promptflow-tools ``` -## Quick Start ⚡ +## 快速开始 ⚡ -**Create a chatbot with prompt flow** +**使用 prompt flow 创建聊天机器人** -Run the command to initiate a prompt flow from a chat template, it creates folder named `my_chatbot` and generates required files within it: +运行以下命令,从聊天模板初始化一个 prompt flow;它会创建名为 `my_chatbot` 的文件夹,并在其中生成所需文件: ```sh pf flow init --flow ./my_chatbot --type chat ``` -**Setup a connection for your API key** +**为你的 API 密钥配置连接** -For OpenAI key, establish a connection by running the command, using the `openai.yaml` file in the `my_chatbot` folder, which stores your OpenAI key (override keys and name with --set to avoid yaml file changes): +对于 OpenAI 密钥,运行以下命令建立连接,使用 `my_chatbot` 文件夹中的 `openai.yaml` 文件存储你的 OpenAI 密钥(可通过 --set 覆盖密钥和名称,避免修改 yaml 文件): ```sh pf connection create --file ./my_chatbot/openai.yaml --set api_key= --name open_ai_connection ``` -For Azure OpenAI key, establish the connection by running the command, using the `azure_openai.yaml` file: +对于 Azure OpenAI 密钥,运行以下命令建立连接,使用 `azure_openai.yaml` 文件: ```sh pf connection create --file ./my_chatbot/azure_openai.yaml --set api_key= api_base= --name open_ai_connection ``` -**Chat with your flow** +**与你的 flow 对话** -In the `my_chatbot` folder, there's a `flow.dag.yaml` file that outlines the flow, including inputs/outputs, nodes, connection, and the LLM model, etc +在 `my_chatbot` 文件夹中,有一个 `flow.dag.yaml` 文件,其中概述了该 flow,包括输入/输出、节点、连接以及 LLM 模型等。 -> Note that in the `chat` node, we're using a connection named `open_ai_connection` (specified in `connection` field) and the `gpt-35-turbo` model (specified in `deployment_name` field). The deployment_name filed is to specify the OpenAI model, or the Azure OpenAI deployment resource. +> 请注意,在 `chat` 节点中,我们使用名为 `open_ai_connection` 的连接(在 `connection` 字段中指定)以及 `gpt-35-turbo` 模型(在 `deployment_name` 字段中指定)。deployment_name 字段用于指定 OpenAI 模型,或 Azure OpenAI 部署资源。 -Interact with your chatbot by running: (press `Ctrl + C` to end the session) +运行以下命令与你的聊天机器人交互:(按 `Ctrl + C` 结束会话) ```sh pf flow test --flow ./my_chatbot --interactive ``` -**Core value: ensuring "High Quality” from prototype to production** +**核心价值:确保从原型到生产的“高质量”** -Explore our [**15-minute tutorial**](examples/tutorials/flow-fine-tuning-evaluation/promptflow-quality-improvement.md) that guides you through prompt tuning ➡ batch testing ➡ evaluation, all designed to ensure high quality ready for production. +探索我们的 [**15 分钟教程**](examples/tutorials/flow-fine-tuning-evaluation/promptflow-quality-improvement.md),它将引导你完成提示词调优 ➡ 批量测试 ➡ 评估,全程旨在确保达到可上线的生产质量。 -Next Step! Continue with the **Tutorial** 👇 section to delve deeper into prompt flow. +下一步!继续阅读下方的 **教程** 👇 部分,深入了解 prompt flow。 -## Tutorial 🏃‍♂️ +## 教程 🏃‍♂️ -Prompt flow is a tool designed to **build high quality LLM apps**, the development process in prompt flow follows these steps: develop a flow, improve the flow quality, deploy the flow to production. +Prompt flow 是一款旨在 **构建高质量 LLM 应用** 的工具;在 prompt flow 中的开发流程遵循以下步骤:开发 flow、提升 flow 质量、将 flow 部署到生产环境。 -### Develop your own LLM apps +### 开发你自己的 LLM 应用 #### VS Code Extension -We also offer a VS Code extension (a flow designer) for an interactive flow development experience with UI. +我们还提供 VS Code 扩展(flow 设计器),通过 UI 带来交互式 flow 开发体验。 vsc -You can install it from the visualstudio marketplace. +你可以从 Visual Studio Marketplace 安装。 -#### Deep delve into flow development +#### 深入 flow 开发 -[Getting started with prompt flow](./docs/how-to-guides/quick-start.md): A step by step guidance to invoke your first flow run. +[Getting started with prompt flow](./docs/how-to-guides/quick-start.md):分步指南,帮助你完成首次 flow 运行。 -### Learn from use cases +### 从用例中学习 -[Tutorial: Chat with PDF](https://github.com/microsoft/promptflow/blob/main/examples/tutorials/e2e-development/chat-with-pdf.md): An end-to-end tutorial on how to build a high quality chat application with prompt flow, including flow development and evaluation with metrics. -> More examples can be found [here](https://microsoft.github.io/promptflow/tutorials/index.html#samples). We welcome contributions of new use cases! +[Tutorial: Chat with PDF](https://github.com/microsoft/promptflow/blob/main/examples/tutorials/e2e-development/chat-with-pdf.md): 一份端到端教程,讲解如何使用 prompt flow 构建高质量聊天应用,包括 flow 开发与基于指标的评估。 +> 更多示例见 [此处](https://microsoft.github.io/promptflow/tutorials/index.html#samples). 欢迎贡献新的用例! -### Setup for contributors +### 贡献者环境配置 -If you're interested in contributing, please start with our dev setup guide: [dev_setup.md](./docs/dev/dev_setup.md). +若你有兴趣参与贡献,请从我们的开发环境配置指南开始:[dev_setup.md](./docs/dev/dev_setup.md)。 -Next Step! Continue with the **Contributing** 👇 section to contribute to prompt flow. +下一步!继续阅读下方的 **贡献** 👇 部分,为 prompt flow 做出贡献。 -## Contributing +## 贡献 -This project welcomes contributions and suggestions. Most contributions require you to agree to a -Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us -the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com. +本项目欢迎贡献与建议。大多数贡献需要你同意贡献者许可协议(Contributor License Agreement,CLA),声明你有权并确实授予我们使用你贡献内容的权利。详情请访问 https://cla.opensource.microsoft.com. -When you submit a pull request, a CLA bot will automatically determine whether you need to provide -a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions -provided by the bot. You will only need to do this once across all repos using our CLA. +当你提交 pull request 时,CLA 机器人会自动判断你是否需要提供 CLA,并相应地标注 PR(例如状态检查、评论)。只需按照机器人提供的说明操作即可。在我们使用 CLA 的所有仓库中,你只需完成一次该流程。 -This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). -For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or -contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. +本项目已采用 [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). +更多信息请参阅 [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/),或通过 [opencode@microsoft.com](mailto:opencode@microsoft.com) 联系我们就其他问题或意见进行咨询。 -## Trademarks +## 商标 -This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft -trademarks or logos is subject to and must follow +本项目可能包含项目、产品或服务的商标或标识。经授权的 Microsoft 商标或标识使用须遵守并遵循 [Microsoft's Trademark & Brand Guidelines](https://www.microsoft.com/en-us/legal/intellectualproperty/trademarks/usage/general). -Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. -Any use of third-party trademarks or logos are subject to those third-party's policies. +在修改版本中使用 Microsoft 商标或标识不得造成混淆,或暗示 Microsoft 赞助。任何第三方商标或标识的使用均须遵守相应第三方的政策。 -## Code of Conduct +## 行为准则 -This project has adopted the -[Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). -For more information see the -[Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) -or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) -with any additional questions or comments. +本项目已采纳 +[Microsoft 开源行为准则](https://opensource.microsoft.com/codeofconduct/). +更多信息请参阅 +[行为准则常见问题(FAQ)](https://opensource.microsoft.com/codeofconduct/faq/) +,或通过 [opencode@microsoft.com](mailto:opencode@microsoft.com) +就其他问题或意见与我们联系。 -## Data Collection +## 数据收集 -The software may collect information about you and your use of the software and -send it to Microsoft if configured to enable telemetry. -Microsoft may use this information to provide services and improve our products and services. -You may turn on the telemetry as described in the repository. -There are also some features in the software that may enable you and Microsoft -to collect data from users of your applications. If you use these features, you -must comply with applicable law, including providing appropriate notices to -users of your applications together with a copy of Microsoft's privacy -statement. Our privacy statement is located at -https://go.microsoft.com/fwlink/?LinkID=824704. You can learn more about data -collection and use in the help documentation and our privacy statement. Your -use of the software operates as your consent to these practices. +若配置为启用遥测(telemetry),本软件可能会收集有关您及您使用本软件的信息, +并将其发送至 Microsoft。 +Microsoft 可能会使用这些信息来提供服务并改进我们的产品和服务。 +您可以按照本仓库中的说明开启遥测。 +本软件中还有一些功能可能使您与 Microsoft 能够收集应用程序用户的数据。若您使用这些功能,您 +必须遵守适用法律,包括向应用程序用户提供适当的告知,并附上 Microsoft 隐私 +声明的副本。我们的隐私声明位于 +https://go.microsoft.com/fwlink/?LinkID=824704. 您可以在帮助文档和我们的隐私声明中了解更多关于数据 +收集与使用的信息。您使用本软件即表示您同意这些做法。 -### Telemetry Configuration +### 遥测配置 -Telemetry collection is on by default. +默认开启遥测收集。 -To opt out, please run `pf config set telemetry.enabled=false` to turn it off. +若要选择退出,请运行 `pf config set telemetry.enabled=false` 以将其关闭。 -## License +## 许可证 Copyright (c) Microsoft Corporation. All rights reserved. -Licensed under the [MIT](LICENSE) license. +根据 [MIT](LICENSE) 许可证授权。