diff --git a/README.md b/README.md index 02cab29..c71a0db 100644 --- a/README.md +++ b/README.md @@ -1,50 +1,56 @@ + +> [!NOTE] +> 本文档由 WeHub 基于上游 README 翻译整理,属于社区翻译,非官方中文文档。 +> [English](./README.en.md) · [原始项目](https://github.com/microsoft/semantic-kernel) · [上游 README](https://github.com/microsoft/semantic-kernel/blob/HEAD/README.md) +> 原作者、版权与许可证归属以原始项目及本仓库 LICENSE 文件为准。 + # Semantic Kernel > [!IMPORTANT] -> Semantic Kernel is now [Microsoft Agent Framework](https://github.com/microsoft/agent-framework)! Microsoft Agent Framework (MAF) is the enterprise‑ready successor to Semantic Kernel. Microsoft Agent Framework is now available at version 1.0 as a production-ready release: stable APIs, and a commitment to long-term support. Whether you're building a single assistant or orchestrating a fleet of specialized agents, Microsoft Agent Framework 1.0 gives you enterprise-grade multi-agent orchestration, multi-provider model support, and cross-runtime interoperability via A2A and MCP. +> Semantic Kernel 现已发展为 [Microsoft Agent Framework](https://github.com/microsoft/agent-framework)! Microsoft Agent Framework(MAF)是 Semantic Kernel 的企业级继任产品。Microsoft Agent Framework 现已推出 1.0 正式版:API 稳定,并承诺长期支持。无论你是构建单一助手,还是编排一支由专业化智能体组成的团队,Microsoft Agent Framework 1.0 均可提供企业级多智能体编排、多提供商模型支持,以及通过 A2A 与 MCP 实现的跨运行时互操作性。 > -> Learn more about Semantic Kernel and Agent Framework here: [Semantic Kernel and Microsoft Agent Framework on the Agent Framework blog](https://devblogs.microsoft.com/agent-framework/semantic-kernel-and-microsoft-agent-framework/), and try out the [Semantic Kernel migration guide](https://learn.microsoft.com/en-us/agent-framework/migration-guide/from-semantic-kernel). +> 在此了解更多关于 Semantic Kernel 与 Agent Framework 的信息:[Agent Framework 博客上的 Semantic Kernel 与 Microsoft Agent Framework](https://devblogs.microsoft.com/agent-framework/semantic-kernel-and-microsoft-agent-framework/), and try out the [Semantic Kernel 迁移指南](https://learn.microsoft.com/en-us/agent-framework/migration-guide/from-semantic-kernel). -**Build intelligent AI agents and multi-agent systems with this enterprise-ready orchestration framework** +**使用这一企业级编排框架构建智能 AI 智能体与多智能体系统** [![License: MIT](https://img.shields.io/github/license/microsoft/semantic-kernel)](https://github.com/microsoft/semantic-kernel/blob/main/LICENSE) [![Python package](https://img.shields.io/pypi/v/semantic-kernel)](https://pypi.org/project/semantic-kernel/) [![Nuget package](https://img.shields.io/nuget/vpre/Microsoft.SemanticKernel)](https://www.nuget.org/packages/Microsoft.SemanticKernel/) [![Discord](https://img.shields.io/discord/1063152441819942922?label=Discord&logo=discord&logoColor=white&color=d82679)](https://aka.ms/SKDiscord) -## What is Semantic Kernel? +## 什么是 Semantic Kernel? -Semantic Kernel is a model-agnostic SDK that empowers developers to build, orchestrate, and deploy AI agents and multi-agent systems. Whether you're building a simple chatbot or a complex multi-agent workflow, Semantic Kernel provides the tools you need with enterprise-grade reliability and flexibility. +Semantic Kernel 是一款模型无关的 SDK,帮助开发者构建、编排并部署 AI 智能体与多智能体系统。无论你是构建简单的聊天机器人,还是复杂的多智能体工作流,Semantic Kernel 都能提供所需工具,并具备企业级的可靠性与灵活性。 -## System Requirements +## 系统要求 -- **Python**: 3.10+ -- **.NET**: .NET 10.0+ -- **Java**: JDK 17+ -- **OS Support**: Windows, macOS, Linux +- **Python**:3.10+ +- **.NET**:.NET 10.0+ +- **Java**:JDK 17+ +- **操作系统支持**:Windows、macOS、Linux -## Key Features +## 核心特性 -- **Model Flexibility**: Connect to any LLM with built-in support for [OpenAI](https://platform.openai.com/docs/introduction), [Azure OpenAI](https://azure.microsoft.com/en-us/products/ai-services/openai-service), [Hugging Face](https://huggingface.co/), [NVidia](https://www.nvidia.com/en-us/ai-data-science/products/nim-microservices/) and more -- **Agent Framework**: Build modular AI agents with access to tools/plugins, memory, and planning capabilities -- **Multi-Agent Systems**: Orchestrate complex workflows with collaborating specialist agents -- **Plugin Ecosystem**: Extend with native code functions, prompt templates, OpenAPI specs, or Model Context Protocol (MCP) -- **Vector DB Support**: Seamless integration with [Azure AI Search](https://learn.microsoft.com/en-us/azure/search/search-what-is-azure-search), [Elasticsearch](https://www.elastic.co/), [Chroma](https://docs.trychroma.com/docs/overview/getting-started), and more -- **Multimodal Support**: Process text, vision, and audio inputs -- **Local Deployment**: Run with [Ollama](https://ollama.com/), [LMStudio](https://lmstudio.ai/), or [ONNX](https://onnx.ai/) -- **Process Framework**: Model complex business processes with a structured workflow approach -- **Enterprise Ready**: Built for observability, security, and stable APIs +- **模型灵活性**:可连接任意 LLM,内置支持 [OpenAI](https://platform.openai.com/docs/introduction), [Azure OpenAI](https://azure.microsoft.com/en-us/products/ai-services/openai-service), [Hugging Face](https://huggingface.co/), [NVidia](https://www.nvidia.com/en-us/ai-data-science/products/nim-microservices/) 等 +- **智能体框架(Agent Framework)**:构建模块化 AI 智能体,可使用工具/插件、记忆与规划能力 +- **多智能体系统**:通过协作的专业化智能体编排复杂工作流 +- **插件生态**:通过原生代码函数、提示模板、OpenAPI 规范或 Model Context Protocol(MCP)进行扩展 +- **向量数据库支持**:与 [Azure AI Search](https://learn.microsoft.com/en-us/azure/search/search-what-is-azure-search), [Elasticsearch](https://www.elastic.co/), [Chroma](https://docs.trychroma.com/docs/overview/getting-started), 等无缝集成 +- **多模态支持**:处理文本、视觉与音频输入 +- **本地部署**:可使用 [Ollama](https://ollama.com/), [LMStudio](https://lmstudio.ai/), 或 [ONNX](https://onnx.ai/) 运行 +- **流程框架(Process Framework)**:以结构化工作流方式建模复杂业务流程 +- **企业级就绪**:面向可观测性、安全性与稳定 API 构建 -## Installation +## 安装 -First, set the environment variable for your AI Services: +首先,为你的 AI 服务设置环境变量: -**Azure OpenAI:** +**Azure OpenAI:** ```bash export AZURE_OPENAI_API_KEY=AAA.... ``` -**or OpenAI directly:** +**或直接使用 OpenAI:** ```bash export OPENAI_API_KEY=sk-... ``` @@ -64,13 +70,13 @@ dotnet add package Microsoft.SemanticKernel.Agents.Core ### Java -See [semantic-kernel-java build](https://github.com/microsoft/semantic-kernel-java/blob/main/BUILD.md) for instructions. +安装说明请参阅 [semantic-kernel-java build](https://github.com/microsoft/semantic-kernel-java/blob/main/BUILD.md)。 -## Quickstart +## 快速入门 -### Basic Agent - Python +### 基础智能体 - Python -Create a simple assistant that responds to user prompts: +创建一个响应用户提示的简单助手: ```python import asyncio @@ -97,7 +103,7 @@ asyncio.run(main()) # Meaning's core revealed. ``` -### Basic Agent - .NET +### 基础智能体 - .NET ```csharp using Microsoft.SemanticKernel; @@ -131,9 +137,9 @@ await foreach (AgentResponseItem response // Meaning's core revealed. ``` -### Agent with Plugins - Python +### 带插件的智能体 - Python -Enhance your agent with custom tools (plugins) and structured output: +使用自定义工具(插件)和结构化输出增强你的智能体: ```python import asyncio @@ -185,7 +191,7 @@ async def main(): asyncio.run(main()) ``` -### Agent with Plugin - .NET +### 带插件的智能体 - .NET ```csharp using System.ComponentModel; @@ -239,7 +245,7 @@ sealed class MenuPlugin ### Multi-Agent System - Python -Build a system of specialized agents that can collaborate: +构建一个能够协作的专用智能体(agent)系统: ```python import asyncio @@ -309,62 +315,62 @@ if __name__ == "__main__": -## Where to Go Next +## 下一步 -1. 📖 Try our [Getting Started Guide](https://learn.microsoft.com/en-us/semantic-kernel/get-started/quick-start-guide) or learn about [Building Agents](https://learn.microsoft.com/en-us/semantic-kernel/frameworks/agent/) -2. 🔌 Explore over 100 [Detailed Samples](https://learn.microsoft.com/en-us/semantic-kernel/get-started/detailed-samples) -3. 💡 Learn about core Semantic Kernel [Concepts](https://learn.microsoft.com/en-us/semantic-kernel/concepts/kernel) +1. 📖 试用我们的 [入门指南](https://learn.microsoft.com/en-us/semantic-kernel/get-started/quick-start-guide) or 了解 [构建智能体](https://learn.microsoft.com/en-us/semantic-kernel/frameworks/agent/) +2. 🔌 探索 100 多个 [详细示例](https://learn.microsoft.com/en-us/semantic-kernel/get-started/detailed-samples) +3. 💡 了解 Semantic Kernel 核心 [概念](https://learn.microsoft.com/en-us/semantic-kernel/concepts/kernel) -### API References +### API 参考 -- [C# API reference](https://learn.microsoft.com/en-us/dotnet/api/microsoft.semantickernel?view=semantic-kernel-dotnet) -- [Python API reference](https://learn.microsoft.com/en-us/python/api/semantic-kernel/semantic_kernel?view=semantic-kernel-python) +- [C# API 参考](https://learn.microsoft.com/en-us/dotnet/api/microsoft.semantickernel?view=semantic-kernel-dotnet) +- [Python API 参考](https://learn.microsoft.com/en-us/python/api/semantic-kernel/semantic_kernel?view=semantic-kernel-python) -## Troubleshooting +## 故障排除 -### Common Issues +### 常见问题 -- **Authentication Errors**: Check that your API key environment variables are correctly set -- **Model Availability**: Verify your Azure OpenAI deployment or OpenAI model access +- **身份验证错误**:请检查 API 密钥环境变量是否已正确设置 +- **模型可用性**:请确认你的 Azure OpenAI 部署或 OpenAI 模型访问权限 -### Getting Help +### 获取帮助 -- Check our [GitHub issues](https://github.com/microsoft/semantic-kernel/issues) for known problems -- Search the [Discord community](https://aka.ms/SKDiscord) for solutions -- Include your SDK version and full error messages when asking for help +- 查看我们的 [GitHub issues](https://github.com/microsoft/semantic-kernel/issues) 以了解已知问题 +- 在 [Discord 社区](https://aka.ms/SKDiscord) 中搜索解决方案 +- 寻求帮助时,请附上 SDK 版本和完整错误信息 -## Join the community +## 加入社区 -We welcome your contributions and suggestions to the SK community! One of the easiest ways to participate is to engage in discussions in the GitHub repository. Bug reports and fixes are welcome! +我们欢迎你对 SK 社区的贡献与建议!参与方式之一是在 GitHub 仓库中参与讨论。欢迎提交 bug 报告和修复! -For new features, components, or extensions, please open an issue and discuss with us before sending a PR. This is to avoid rejection as we might be taking the core in a different direction, but also to consider the impact on the larger ecosystem. +若要添加新功能、组件或扩展,请先提交 issue 并与我们讨论,再发送 PR。这可以避免 PR 被拒绝——我们可能对核心采取不同方向——同时也便于评估对更大生态系统的影响。 -To learn more and get started: +了解更多并开始参与: -- Read the [documentation](https://aka.ms/sk/learn) -- Learn how to [contribute](https://learn.microsoft.com/en-us/semantic-kernel/support/contributing) to the project -- Ask questions in the [GitHub discussions](https://github.com/microsoft/semantic-kernel/discussions) -- Ask questions in the [Discord community](https://aka.ms/SKDiscord) +- 阅读 [文档](https://aka.ms/sk/learn) +- 了解如何 [贡献](https://learn.microsoft.com/en-us/semantic-kernel/support/contributing) 本项目 +- 在 [GitHub discussions](https://github.com/microsoft/semantic-kernel/discussions) 中提问 +- 在 [Discord 社区](https://aka.ms/SKDiscord) 中提问 -- Attend [regular office hours and SK community events](COMMUNITY.md) -- Follow the team on our [blog](https://aka.ms/sk/blog) +- 参加 [定期办公时间和 SK 社区活动](COMMUNITY.md) +- 关注团队 [博客](https://aka.ms/sk/blog) -## Contributor Wall of Fame +## 贡献者名人堂 -[![semantic-kernel contributors](https://contrib.rocks/image?repo=microsoft/semantic-kernel)](https://github.com/microsoft/semantic-kernel/graphs/contributors) +[![semantic-kernel 贡献者](https://contrib.rocks/image?repo=microsoft/semantic-kernel)](https://github.com/microsoft/semantic-kernel/graphs/contributors) -## 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/). +更多信息请参阅 +[行为准则常见问题](https://opensource.microsoft.com/codeofconduct/faq/) +或通过 [opencode@microsoft.com](mailto:opencode@microsoft.com) 联系我们 +提出任何其他问题或意见。 -## License +## 许可证 Copyright (c) Microsoft Corporation. All rights reserved. -Licensed under the [MIT](LICENSE) license. +根据 [MIT](LICENSE) 许可证授权。