Microsoft
使用 Microsoft Agent Framework Python SDK 构建 Azure AI Foundry Agent 应用。
PURPOSE
使用 Microsoft Agent Framework Python SDK 构建 Azure AI Foundry Agent 应用。
REVIEWED DOCUMENTATION EVIDENCE
以下内容来自与当前版本绑定并经 reviewer 批准的上游文档证据。它说明文档中存在相应安装或使用信息,不代表平台已经执行安装、完成兼容测试或验证运行结果。
安装证据
## Installation ```bash
使用证据
## Complete Example
```python
import asyncio
from typing import Annotated
from pydantic import BaseModel, Field
from agent_framework import (
HostedCodeInterpreterTool,
HostedWebSearchTool,
MCPStreamableHTTPTool,
)
from agent_framework.azure import AzureAIAgentsProvider
from azure.identity.aio import AzureCliCredential
def get_weather(
location: Annotated[str, Field(description="City name")],
) -> str:
"""Get weather for a location."""
return f"Weather in {location}: 72°F, sunny"
class AnalysisResult(BaseModel):
summary: str
key_findings: list[str]
confidence: float
async def main():
async with (
AzureCliCredential() as credential,
MCPStreamableHTTPTool(
name="Docs MCP",
url="https://learn.microsoft.com/api/mcp",
) as mcp_tool,
AzureAIAgentsProvider(credential=credential) as provider,
):
agent = await provider.create_agent(
name="ResearchAssistant",
instructions="You are a research assistant with multiple capabilities.",
tools=[
get_weather,
HostedCodeInterpreterTool(),
HostedWebSearchTool(name="Bing"),
mcp_tool,
],
)
thread = agent.get_new_thread()
# Non-streaming
result = await agent.run(
"Search for Python best practices and summarize",
thread=thread,
)
print(f"Response: {result.text}")
# Streaming
print("\nStreaming: ", end="")
async for chunk in agent.run_stream("Continue with examples", thread=thread):
if chunk.text:
print(chunk.text, end="", flush=True)
print()
# Stru## Complete Example
```python
import asyncio
from typing import Annotated
from pydantic import BaseModel, Field
from agent_framework import (
HostedCodeInterpreterTool,
HostedWebSearchTool,
MCPStreamableHTTPTool,
)
from agent_framework.azure import AzureAIAgentsProvider
from azure.identity.aio import AzureCliCredential
def get_weather(
location: Annotated[str, Field(description="City name")],
) -> str:
"""Get weather for a location."""
return f"Weather in {location}: 72°F, sunny"
class AnalysisResult(BaseModel):
summary: str
key_findings: list[str]
confidence: float
async def main():
async with (
AzureCliCredential() as credential,
MCPStreamableHTTPTool(
name="Docs MCP",
url="https://learn.microsoft.com/api/mcp",
) as mcp_tool,
AzureAIAgentsProvider(credential=credential) as provider,
):
agent = await provider.create_agent(
name="ResearchAssistant",
instructions="You are a research assistant with multiple capabilities.",
tools=[
get_weather,
HostedCodeInterpreterTool(),
HostedWebSearchTool(name="Bing"),
mcp_tool,
],
)
thread = agent.get_new_thread()
# Non-streaming
result = await agent.run(
"SeUSER EXPERIENCE
暂无真实用户评价
如果你实际使用过这个 Skill,可以分享具体场景、效果和踩坑。平台不会用评价替代 VERIFIED、安全或兼容性证据。
REQUIREMENTS
当前版本没有声明额外依赖。
权限、网络访问和静态扫描结果放在“安全与兼容”页签,避免把工程细节堆在概览里。
同分类下最近更新的技能,按更新时间排序。
LLM数据自动化
1.0.0LLM数据自动化
2026-09-23
python-code-pep8-style
0.1.02026-09-23
proof
2.0.12026-09-23
project-explorer-skill
1.0.02026-09-23
pagesskill
1.0.02026-09-23
Orthogonal API Platform - Access paid APIs using the SDK, Run API, or x402 direct payment. Search, discover, and integrate APIs with simple tool calls.
1.0.02026-09-23