Chuyển đến nội dung
Skillpedia
Agent48k · #3892

azure-ai-projects-py

Skill này làm gì

Công cụ này cho phép bạn xây dựng và quản lý ứng dụng trí tuệ nhân tạo (AI) bằng bộ phát triển phần mềm (SDK) azure-ai-projects. Bạn có thể tạo agent, dùng các công cụ như trình thông dịch mã và tìm kiếm trong tài liệu.

Khi nào nên dùng

  • ✓Khi bạn muốn tạo một trợ lý AI tùy chỉnh.
  • ✓Khi bạn cần AI chạy mã hoặc tìm kiếm trong tài liệu của mình.
  • ✓Khi bạn quản lý các phiên bản của agent AI và các chức năng của chúng.

Liên kết skill

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/azure-ai-projects-py/SKILL.md

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/azure-ai-projects-py/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Tạo một agent AI có thể trả lời câu hỏi về tài liệu của tôi và chạy mã Python.”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Bạn cài công cụ và thiết lập biến môi trường chứa thông tin dự án Azure AI. Sau đó, bạn dùng mã Python để tương tác với client, tạo agent, định nghĩa tác vụ và quản lý hội thoại.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

Bundled upstream support

Supporting files are included at skill-relative paths. See UPSTREAM-NOTICE.md for their pinned sources, licenses, hashes, and import changes.

Restored helper safety

scripts/run_batch_evaluation.py uploads the entire selected JSONL file to the configured Azure AI project, creates a remote evaluation and run, and may incur model or cloud charges. Before invocation, review the data classification and confirm the exact file, endpoint, deployment, evaluators, and expected cost with the user. Do not run it during documentation-only work.

Azure AI Projects Python SDK (Foundry SDK)

Build AI applications on Microsoft Foundry using the azure-ai-projects SDK.

Installation

pip install azure-ai-projects azure-identity

Environment Variables

AZURE_AI_PROJECT_ENDPOINT="https://<resource>.services.ai.azure.com/api/projects/<project>"
AZURE_AI_MODEL_DEPLOYMENT_NAME="gpt-4o-mini"

Authentication

import os
from azure.identity import DefaultAzureCredential
from azure.ai.projects import AIProjectClient

credential = DefaultAzureCredential()
client = AIProjectClient(
    endpoint=os.environ["AZURE_AI_PROJECT_ENDPOINT"],
    credential=credential,
)

Client Operations Overview

Operation Access Purpose
client.agents .agents.* Agent CRUD, versions, threads, runs
client.connections .connections.* List/get project connections
client.deployments .deployments.* List model deployments
client.datasets .datasets.* Dataset management
client.indexes .indexes.* Index management
client.evaluations .evaluations.* Run evaluations
client.red_teams .red_teams.* Red team operations

Two Client Approaches

1. AIProjectClient (Native Foundry)

from azure.ai.projects import AIProjectClient

client = AIProjectClient(
    endpoint=os.environ["AZURE_AI_PROJECT_ENDPOINT"],
    credential=DefaultAzureCredential(),
)

# Use Foundry-native operations
agent = client.agents.create_agent(
    model=os.environ["AZURE_AI_MODEL_DEPLOYMENT_NAME"],
    name="my-agent",
    instructions="You are helpful.",
)

2. OpenAI-Compatible Client

# Get OpenAI-compatible client from project
openai_client = client.get_openai_client()

# Use standard OpenAI API
response = openai_client.chat.completions.create(
    model=os.environ["AZURE_AI_MODEL_DEPLOYMENT_NAME"],
    messages=[{"role": "user", "content": "Hello!"}],
)

Agent Operations

Create Agent (Basic)

agent = client.agents.create_agent(
    model=os.environ["AZURE_AI_MODEL_DEPLOYMENT_NAME"],
    name="my-agent",
    instructions="You are a helpful assistant.",
)

Create Agent with Tools

from azure.ai.agents import CodeInterpreterTool, FileSearchTool

agent = client.agents.create_agent(
    model=os.environ["AZURE_AI_MODEL_DEPLOYMENT_NAME"],
    name="tool-agent",
    instructions="You can execute code and search files.",
    tools=[CodeInterpreterTool(), FileSearchTool()],
)

Versioned Agents with PromptAgentDefinition

from azure.ai.projects.models import PromptAgentDefinition

# Create a versioned agent
agent_version = client.agents.create_version(
    agent_name="customer-support-agent",
    definition=PromptAgentDefinition(
        model=os.environ["AZURE_AI_MODEL_DEPLOYMENT_NAME"],
        instructions="You are a customer support specialist.",
        tools=[],  # Add tools as needed
    ),
    version_label="v1.0",
)

See references/agents.md for detailed agent patterns.

Tools Overview

Tool Class Use Case
Code Interpreter CodeInterpreterTool Execute Python, generate files
File Search FileSearchTool RAG over uploaded documents
Bing Grounding BingGroundingTool Web search (requires connection)
Azure AI Search AzureAISearchTool Search your indexes
Function Calling FunctionTool Call your Python functions
OpenAPI OpenApiTool Call REST APIs
MCP McpTool Model Context Protocol servers
Memory Search MemorySearchTool Search agent memory stores
SharePoint SharepointGroundingTool Search SharePoint content

See references/tools.md for all tool patterns.

Thread and Message Flow

# 1. Create thread
thread = client.agents.threads.create()

# 2. Add message

…
Câu hỏi thường gặp

Microsoft Foundry là gì?

Đó là nền tảng của Microsoft để xây dựng và quản lý ứng dụng AI.

Agent AI là gì?

Đó là các chương trình AI có thể thực hiện tác vụ, như trả lời câu hỏi hoặc chạy mã, theo các chỉ dẫn cụ thể.

“Tools” cho agent AI là gì?

Đó là các khả năng bổ sung bạn có thể trao cho agent, như chạy mã Python hoặc tìm thông tin trong tệp.

Chi tiết

Mô tả gốc của tác giả

Build AI applications on Microsoft Foundry using the azure-ai-projects SDK.

repo: sickn33/agentic-awesome-skills

Độ phổ biến

Sao GitHub
48k
Vị trí xếp hạng
#3892
Giấy phép
MIT
Cập nhật
15/10/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự