agent-framework-builder-python
它能做什么
这项技能指导使用 Microsoft Agent Framework 构建 Python 应用,涵盖智能体、工作流、工具和托管。适合想在 Python 程序中加入 AI 助手的开发者。
适用场景
- ✓当你想在 Python 应用中构建 AI 智能体的时候。
- ✓当你需要一个在 Python 中协调多个步骤或智能体的工作流的时候。
- ✓当你想检查现有的 Python 智能体项目并将其更新到当前框架版本的时候。
技能链接
https://github.com/microsoft/agent-framework/blob/main/skills/agent-framework-builder-python/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请帮我用 Microsoft Agent Framework 在我的 Python 应用中加入一个可以查询订单的 AI 智能体?”
每周 5 个新技能,1 分钟读完。
工作原理
智能体会检查你的项目及其软件包,选出最简单的匹配模式,并且只阅读所需的指南。然后它会做出最小的改动,并进行有针对性的检查。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Agent Framework builder for Python
Use this skill as the entry point for Python Agent Framework application work. Choose the smallest framework pattern that preserves the required behavior, load only the relevant references, and validate against current APIs instead of relying on remembered preview-era syntax.
Workflow
- Inspect the existing project, Python version, dependency manager, and installed Agent Framework packages.
- Choose the simplest matching path from the table below.
- Resolve design questions only when they materially change the implementation.
- Read only the linked reference for the selected path.
- Implement the smallest coherent change and run the narrowest validation that exercises it.
Core abstractions
- A chat client implements the model-facing
SupportsChatGetResponseprotocol. It sends messages and options to a model provider and returns chat responses or streaming updates. - An agent implements the
SupportsAgentRunprotocol. The standardAgentimplementation combines a chat client with instructions, tools, middleware, context providers, and session handling behind onerun(...)interface. - A harness agent is a regular
Agentassembled bycreate_harness_agent. It adds an opinionated set of context providers and middleware; it does not introduce a separate agent abstraction. - A workflow coordinates explicit execution paths. Graph workflows and most orchestration builders can use multiple
SupportsAgentRunimplementations or executors.HandoffBuilderis the exception: its participants must be concreteAgentinstances.
User interface options
- DevUI is a local development, testing, and debugging tool for interacting with agents and workflows. Never run or deploy DevUI as a production application host.
- AG-UI is the application-facing protocol integration for connecting an agent or workflow to an AG-UI-compatible
frontend. Use the
agent-framework-ag-uipackage when the product needs streaming UI events, tool interactions, shared state, interrupts, or resume behavior.
Choose the build path
| Path | Choose it when | Details |
|---|---|---|
| Plain agent | One model-driven actor owns the task and tools, sessions, context, and middleware are sufficient. | Plain agents |
| Harness agent | The product needs an operating loop with todos, modes, memory, approvals, skills, optional file access, background agents, shell, compaction, or repeated execution. | Harness agents |
| Workflow or orchestration | Explicit stages, routing, parallelism, multiple participants, checkpointing, human input, or intermediate outputs are central to correctness. | Workflows |
| Declarative definition | YAML or JSON should be the source of truth for a supported agent or workflow. | Declarative definitions |
| Evaluation | Expected outputs, tool calls, failed runs, or quality regressions are the main concern. | Evaluation |
| Observability | The task is diagnosing or monitoring runtime behavior with traces, logs, and metrics. | Observability |
| Extensibility | The application needs a custom provider, ContextProvider, or middleware component. | Extensibility |
| Integration | The task is choosing or wiring a provider, protocol, memory store, tool service, UI, or platform extension. | Integrations |
| Hosting and deployment | Working Agent Framework code needs a process host, protocol endpoint, identity contract, or deployment shape. | Hosting and deployment |
Defaults
- Agent Framework requires Python 3.11 or later. Prefer the latest supported Python release or the previous release (N-1), unless a required dependency has a narrower compatibility range.
- Install the narrow Agent Framework distribution needed by the application instead of defaulting to the
agent-frameworkmeta-package. - Agent Framework does not automatically read
.envfiles. If the project uses one, callload_dotenv()explicitly or use the selected API's documentedenv_file_pathor equivalent initialization option.
Current documentation lookup
Use local guidance for stable decisions and common patterns. For provider matrices, package maturity, hosted tools,
常见问题
这项技能涵盖框架的哪些部分?
智能体、Harness 智能体、工作流、工具、会话、中间件、评估、集成和托管。
它会使用当前的代码示例吗?
会。它告诉智能体检查当前的 API,而不是依赖旧示例。
我需要自己选择模式吗?
不需要。这项技能会帮你选出能保持所需行为的最小模式。
详情
作者的原始描述
Use this skill when building, modifying, reviewing, evaluating, integrating, or hosting Python applications with Microsoft Agent Framework. Use it for Agent Framework agents, harness agents, workflows, orchestrations, declarative definitions, tools, sessions, middleware, evaluation, observability, integrations, or hosting, even when the user has not yet chosen the correct framework pattern.
热度
- GitHub 星标
- 14k
- 排名
- #11140
- 许可证
- MIT
- 更新时间
- 2026/11/2
评论
- …