{
  "schemaVersion": "1.0",
  "item": {
    "slug": "azure-ai-agents-py",
    "name": "Azure Ai Agents Py - Microsoft Foundry",
    "source": "tencent",
    "type": "skill",
    "category": "开发工具",
    "sourceUrl": "https://clawhub.ai/thegovind/azure-ai-agents-py",
    "canonicalUrl": "https://clawhub.ai/thegovind/azure-ai-agents-py",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadMode": "redirect",
    "downloadUrl": "/downloads/azure-ai-agents-py",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=azure-ai-agents-py",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "installMethod": "Manual import",
    "extraction": "Extract archive",
    "prerequisites": [
      "OpenClaw"
    ],
    "packageFormat": "ZIP package",
    "includedAssets": [
      "SKILL.md",
      "references/acceptance-criteria.md",
      "references/async-patterns.md",
      "references/streaming.md",
      "references/tools.md"
    ],
    "primaryDoc": "SKILL.md",
    "quickSetup": [
      "Download the package from Yavira.",
      "Extract the archive and review SKILL.md first.",
      "Import or place the package into your OpenClaw setup."
    ],
    "agentAssist": {
      "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
      "steps": [
        "Download the package from Yavira.",
        "Extract it into a folder your agent can access.",
        "Paste one of the prompts below and point your agent at the extracted folder."
      ],
      "prompts": [
        {
          "label": "New install",
          "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete."
        },
        {
          "label": "Upgrade existing",
          "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run."
        }
      ]
    },
    "sourceHealth": {
      "source": "tencent",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-04-23T16:43:11.935Z",
      "expiresAt": "2026-04-30T16:43:11.935Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=4claw-imageboard",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=4claw-imageboard",
        "contentDisposition": "attachment; filename=\"4claw-imageboard-1.0.1.zip\"",
        "redirectLocation": null,
        "bodySnippet": null
      },
      "scope": "source",
      "summary": "Source download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this source.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/azure-ai-agents-py"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    },
    "downloadPageUrl": "https://openagent3.xyz/downloads/azure-ai-agents-py",
    "agentPageUrl": "https://openagent3.xyz/skills/azure-ai-agents-py/agent",
    "manifestUrl": "https://openagent3.xyz/skills/azure-ai-agents-py/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/azure-ai-agents-py/agent.md"
  },
  "agentAssist": {
    "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
    "steps": [
      "Download the package from Yavira.",
      "Extract it into a folder your agent can access.",
      "Paste one of the prompts below and point your agent at the extracted folder."
    ],
    "prompts": [
      {
        "label": "New install",
        "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete."
      },
      {
        "label": "Upgrade existing",
        "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run."
      }
    ]
  },
  "documentation": {
    "source": "clawhub",
    "primaryDoc": "SKILL.md",
    "sections": [
      {
        "title": "Azure AI Agents Python SDK",
        "body": "Build agents hosted on Azure AI Foundry using the azure-ai-agents SDK."
      },
      {
        "title": "Installation",
        "body": "pip install azure-ai-agents azure-identity\n# Or with azure-ai-projects for additional features\npip install azure-ai-projects azure-identity"
      },
      {
        "title": "Environment Variables",
        "body": "PROJECT_ENDPOINT=\"https://<resource>.services.ai.azure.com/api/projects/<project>\"\nMODEL_DEPLOYMENT_NAME=\"gpt-4o-mini\""
      },
      {
        "title": "Authentication",
        "body": "from azure.identity import DefaultAzureCredential\nfrom azure.ai.agents import AgentsClient\n\ncredential = DefaultAzureCredential()\nclient = AgentsClient(\n    endpoint=os.environ[\"PROJECT_ENDPOINT\"],\n    credential=credential,\n)"
      },
      {
        "title": "Core Workflow",
        "body": "The basic agent lifecycle: create agent → create thread → create message → create run → get response"
      },
      {
        "title": "Minimal Example",
        "body": "import os\nfrom azure.identity import DefaultAzureCredential\nfrom azure.ai.agents import AgentsClient\n\nclient = AgentsClient(\n    endpoint=os.environ[\"PROJECT_ENDPOINT\"],\n    credential=DefaultAzureCredential(),\n)\n\n# 1. Create agent\nagent = client.create_agent(\n    model=os.environ[\"MODEL_DEPLOYMENT_NAME\"],\n    name=\"my-agent\",\n    instructions=\"You are a helpful assistant.\",\n)\n\n# 2. Create thread\nthread = client.threads.create()\n\n# 3. Add message\nclient.messages.create(\n    thread_id=thread.id,\n    role=\"user\",\n    content=\"Hello!\",\n)\n\n# 4. Create and process run\nrun = client.runs.create_and_process(thread_id=thread.id, agent_id=agent.id)\n\n# 5. Get response\nif run.status == \"completed\":\n    messages = client.messages.list(thread_id=thread.id)\n    for msg in messages:\n        if msg.role == \"assistant\":\n            print(msg.content[0].text.value)\n\n# Cleanup\nclient.delete_agent(agent.id)"
      },
      {
        "title": "Tools Overview",
        "body": "ToolClassUse CaseCode InterpreterCodeInterpreterToolExecute Python, generate filesFile SearchFileSearchToolRAG over uploaded documentsBing GroundingBingGroundingToolWeb searchAzure AI SearchAzureAISearchToolSearch your indexesFunction CallingFunctionToolCall your Python functionsOpenAPIOpenApiToolCall REST APIsMCPMcpToolModel Context Protocol servers\n\nSee references/tools.md for detailed patterns."
      },
      {
        "title": "Adding Tools",
        "body": "from azure.ai.agents import CodeInterpreterTool, FileSearchTool\n\nagent = client.create_agent(\n    model=os.environ[\"MODEL_DEPLOYMENT_NAME\"],\n    name=\"tool-agent\",\n    instructions=\"You can execute code and search files.\",\n    tools=[CodeInterpreterTool()],\n    tool_resources={\"code_interpreter\": {\"file_ids\": [file.id]}},\n)"
      },
      {
        "title": "Function Calling",
        "body": "from azure.ai.agents import FunctionTool, ToolSet\n\ndef get_weather(location: str) -> str:\n    \"\"\"Get weather for a location.\"\"\"\n    return f\"Weather in {location}: 72F, sunny\"\n\nfunctions = FunctionTool(functions=[get_weather])\ntoolset = ToolSet()\ntoolset.add(functions)\n\nagent = client.create_agent(\n    model=os.environ[\"MODEL_DEPLOYMENT_NAME\"],\n    name=\"function-agent\",\n    instructions=\"Help with weather queries.\",\n    toolset=toolset,\n)\n\n# Process run - toolset auto-executes functions\nrun = client.runs.create_and_process(\n    thread_id=thread.id,\n    agent_id=agent.id,\n    toolset=toolset,  # Pass toolset for auto-execution\n)"
      },
      {
        "title": "Streaming",
        "body": "from azure.ai.agents import AgentEventHandler\n\nclass MyHandler(AgentEventHandler):\n    def on_message_delta(self, delta):\n        if delta.text:\n            print(delta.text.value, end=\"\", flush=True)\n\n    def on_error(self, data):\n        print(f\"Error: {data}\")\n\nwith client.runs.stream(\n    thread_id=thread.id,\n    agent_id=agent.id,\n    event_handler=MyHandler(),\n) as stream:\n    stream.until_done()\n\nSee references/streaming.md for advanced patterns."
      },
      {
        "title": "Upload File",
        "body": "file = client.files.upload_and_poll(\n    file_path=\"data.csv\",\n    purpose=\"assistants\",\n)"
      },
      {
        "title": "Create Vector Store",
        "body": "vector_store = client.vector_stores.create_and_poll(\n    file_ids=[file.id],\n    name=\"my-store\",\n)\n\nagent = client.create_agent(\n    model=os.environ[\"MODEL_DEPLOYMENT_NAME\"],\n    tools=[FileSearchTool()],\n    tool_resources={\"file_search\": {\"vector_store_ids\": [vector_store.id]}},\n)"
      },
      {
        "title": "Async Client",
        "body": "from azure.ai.agents.aio import AgentsClient\n\nasync with AgentsClient(\n    endpoint=os.environ[\"PROJECT_ENDPOINT\"],\n    credential=DefaultAzureCredential(),\n) as client:\n    agent = await client.create_agent(...)\n    # ... async operations\n\nSee references/async-patterns.md for async patterns."
      },
      {
        "title": "JSON Mode",
        "body": "agent = client.create_agent(\n    model=os.environ[\"MODEL_DEPLOYMENT_NAME\"],\n    response_format={\"type\": \"json_object\"},\n)"
      },
      {
        "title": "JSON Schema",
        "body": "agent = client.create_agent(\n    model=os.environ[\"MODEL_DEPLOYMENT_NAME\"],\n    response_format={\n        \"type\": \"json_schema\",\n        \"json_schema\": {\n            \"name\": \"weather_response\",\n            \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                    \"temperature\": {\"type\": \"number\"},\n                    \"conditions\": {\"type\": \"string\"},\n                },\n                \"required\": [\"temperature\", \"conditions\"],\n            },\n        },\n    },\n)"
      },
      {
        "title": "Continue Conversation",
        "body": "# Save thread_id for later\nthread_id = thread.id\n\n# Resume later\nclient.messages.create(\n    thread_id=thread_id,\n    role=\"user\",\n    content=\"Follow-up question\",\n)\nrun = client.runs.create_and_process(thread_id=thread_id, agent_id=agent.id)"
      },
      {
        "title": "List Messages",
        "body": "messages = client.messages.list(thread_id=thread.id, order=\"asc\")\nfor msg in messages:\n    role = msg.role\n    content = msg.content[0].text.value\n    print(f\"{role}: {content}\")"
      },
      {
        "title": "Best Practices",
        "body": "Use context managers for async client\nClean up agents when done: client.delete_agent(agent.id)\nUse create_and_process for simple cases, streaming for real-time UX\nPass toolset to run for automatic function execution\nPoll operations use *_and_poll methods for long operations"
      },
      {
        "title": "Reference Files",
        "body": "references/tools.md: All tool types with detailed examples\nreferences/streaming.md: Event handlers and streaming patterns\nreferences/async-patterns.md: Async client usage"
      }
    ],
    "body": "Azure AI Agents Python SDK\n\nBuild agents hosted on Azure AI Foundry using the azure-ai-agents SDK.\n\nInstallation\npip install azure-ai-agents azure-identity\n# Or with azure-ai-projects for additional features\npip install azure-ai-projects azure-identity\n\nEnvironment Variables\nPROJECT_ENDPOINT=\"https://<resource>.services.ai.azure.com/api/projects/<project>\"\nMODEL_DEPLOYMENT_NAME=\"gpt-4o-mini\"\n\nAuthentication\nfrom azure.identity import DefaultAzureCredential\nfrom azure.ai.agents import AgentsClient\n\ncredential = DefaultAzureCredential()\nclient = AgentsClient(\n    endpoint=os.environ[\"PROJECT_ENDPOINT\"],\n    credential=credential,\n)\n\nCore Workflow\n\nThe basic agent lifecycle: create agent → create thread → create message → create run → get response\n\nMinimal Example\nimport os\nfrom azure.identity import DefaultAzureCredential\nfrom azure.ai.agents import AgentsClient\n\nclient = AgentsClient(\n    endpoint=os.environ[\"PROJECT_ENDPOINT\"],\n    credential=DefaultAzureCredential(),\n)\n\n# 1. Create agent\nagent = client.create_agent(\n    model=os.environ[\"MODEL_DEPLOYMENT_NAME\"],\n    name=\"my-agent\",\n    instructions=\"You are a helpful assistant.\",\n)\n\n# 2. Create thread\nthread = client.threads.create()\n\n# 3. Add message\nclient.messages.create(\n    thread_id=thread.id,\n    role=\"user\",\n    content=\"Hello!\",\n)\n\n# 4. Create and process run\nrun = client.runs.create_and_process(thread_id=thread.id, agent_id=agent.id)\n\n# 5. Get response\nif run.status == \"completed\":\n    messages = client.messages.list(thread_id=thread.id)\n    for msg in messages:\n        if msg.role == \"assistant\":\n            print(msg.content[0].text.value)\n\n# Cleanup\nclient.delete_agent(agent.id)\n\nTools Overview\nTool\tClass\tUse Case\nCode Interpreter\tCodeInterpreterTool\tExecute Python, generate files\nFile Search\tFileSearchTool\tRAG over uploaded documents\nBing Grounding\tBingGroundingTool\tWeb search\nAzure AI Search\tAzureAISearchTool\tSearch your indexes\nFunction Calling\tFunctionTool\tCall your Python functions\nOpenAPI\tOpenApiTool\tCall REST APIs\nMCP\tMcpTool\tModel Context Protocol servers\n\nSee references/tools.md for detailed patterns.\n\nAdding Tools\nfrom azure.ai.agents import CodeInterpreterTool, FileSearchTool\n\nagent = client.create_agent(\n    model=os.environ[\"MODEL_DEPLOYMENT_NAME\"],\n    name=\"tool-agent\",\n    instructions=\"You can execute code and search files.\",\n    tools=[CodeInterpreterTool()],\n    tool_resources={\"code_interpreter\": {\"file_ids\": [file.id]}},\n)\n\nFunction Calling\nfrom azure.ai.agents import FunctionTool, ToolSet\n\ndef get_weather(location: str) -> str:\n    \"\"\"Get weather for a location.\"\"\"\n    return f\"Weather in {location}: 72F, sunny\"\n\nfunctions = FunctionTool(functions=[get_weather])\ntoolset = ToolSet()\ntoolset.add(functions)\n\nagent = client.create_agent(\n    model=os.environ[\"MODEL_DEPLOYMENT_NAME\"],\n    name=\"function-agent\",\n    instructions=\"Help with weather queries.\",\n    toolset=toolset,\n)\n\n# Process run - toolset auto-executes functions\nrun = client.runs.create_and_process(\n    thread_id=thread.id,\n    agent_id=agent.id,\n    toolset=toolset,  # Pass toolset for auto-execution\n)\n\nStreaming\nfrom azure.ai.agents import AgentEventHandler\n\nclass MyHandler(AgentEventHandler):\n    def on_message_delta(self, delta):\n        if delta.text:\n            print(delta.text.value, end=\"\", flush=True)\n\n    def on_error(self, data):\n        print(f\"Error: {data}\")\n\nwith client.runs.stream(\n    thread_id=thread.id,\n    agent_id=agent.id,\n    event_handler=MyHandler(),\n) as stream:\n    stream.until_done()\n\n\nSee references/streaming.md for advanced patterns.\n\nFile Operations\nUpload File\nfile = client.files.upload_and_poll(\n    file_path=\"data.csv\",\n    purpose=\"assistants\",\n)\n\nCreate Vector Store\nvector_store = client.vector_stores.create_and_poll(\n    file_ids=[file.id],\n    name=\"my-store\",\n)\n\nagent = client.create_agent(\n    model=os.environ[\"MODEL_DEPLOYMENT_NAME\"],\n    tools=[FileSearchTool()],\n    tool_resources={\"file_search\": {\"vector_store_ids\": [vector_store.id]}},\n)\n\nAsync Client\nfrom azure.ai.agents.aio import AgentsClient\n\nasync with AgentsClient(\n    endpoint=os.environ[\"PROJECT_ENDPOINT\"],\n    credential=DefaultAzureCredential(),\n) as client:\n    agent = await client.create_agent(...)\n    # ... async operations\n\n\nSee references/async-patterns.md for async patterns.\n\nResponse Format\nJSON Mode\nagent = client.create_agent(\n    model=os.environ[\"MODEL_DEPLOYMENT_NAME\"],\n    response_format={\"type\": \"json_object\"},\n)\n\nJSON Schema\nagent = client.create_agent(\n    model=os.environ[\"MODEL_DEPLOYMENT_NAME\"],\n    response_format={\n        \"type\": \"json_schema\",\n        \"json_schema\": {\n            \"name\": \"weather_response\",\n            \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                    \"temperature\": {\"type\": \"number\"},\n                    \"conditions\": {\"type\": \"string\"},\n                },\n                \"required\": [\"temperature\", \"conditions\"],\n            },\n        },\n    },\n)\n\nThread Management\nContinue Conversation\n# Save thread_id for later\nthread_id = thread.id\n\n# Resume later\nclient.messages.create(\n    thread_id=thread_id,\n    role=\"user\",\n    content=\"Follow-up question\",\n)\nrun = client.runs.create_and_process(thread_id=thread_id, agent_id=agent.id)\n\nList Messages\nmessages = client.messages.list(thread_id=thread.id, order=\"asc\")\nfor msg in messages:\n    role = msg.role\n    content = msg.content[0].text.value\n    print(f\"{role}: {content}\")\n\nBest Practices\nUse context managers for async client\nClean up agents when done: client.delete_agent(agent.id)\nUse create_and_process for simple cases, streaming for real-time UX\nPass toolset to run for automatic function execution\nPoll operations use *_and_poll methods for long operations\nReference Files\nreferences/tools.md: All tool types with detailed examples\nreferences/streaming.md: Event handlers and streaming patterns\nreferences/async-patterns.md: Async client usage"
  },
  "trust": {
    "sourceLabel": "tencent",
    "provenanceUrl": "https://clawhub.ai/thegovind/azure-ai-agents-py",
    "publisherUrl": "https://clawhub.ai/thegovind/azure-ai-agents-py",
    "owner": "thegovind",
    "version": "0.1.0",
    "license": null,
    "verificationStatus": "Indexed source record"
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/azure-ai-agents-py",
    "downloadUrl": "https://openagent3.xyz/downloads/azure-ai-agents-py",
    "agentUrl": "https://openagent3.xyz/skills/azure-ai-agents-py/agent",
    "manifestUrl": "https://openagent3.xyz/skills/azure-ai-agents-py/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/azure-ai-agents-py/agent.md"
  }
}