본문으로 건너뛰기
Skillpedia
에이전트48k · #3691

agents-v2-py

하는 일

이 도구를 쓰면 특정 Python 코드를 사용해 컨테이너 안에서 실행되는 AI '에이전트'를 만들 수 있습니다. 에이전트가 내부적으로 어떻게 작동할지 더 많이 제어하고 싶은 사람을 위한 도구입니다.

사용하는 경우

  • ✓컨테이너에 에이전트 코드가 준비되어 있을 때.
  • ✓에이전트의 CPU와 메모리 같은 자원을 설정해야 할 때.
  • ✓AI 에이전트의 여러 버전을 관리하는 경우.

스킬 링크

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/agents-v2-py/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/agents-v2-py/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“컨테이너 이미지를 사용해 호스팅 AI 에이전트를 만들려면 어떻게 하나요?”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

'azure-ai-projects' 라이브러리와 함께 Python 코드를 사용해 에이전트를 정의합니다. 여기에는 컨테이너 이미지, 자원(CPU/메모리), 에이전트 실행에 필요한 환경 변수를 지정하는 작업이 포함됩니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

Compatibility and maintenance

Compatibility alias of hosted-agents-v2-py; use that ID for new references when no existing contract requires this one. The instruction-only procedure remains local; no executable support files are bundled so existing installations continue to work offline. This compatibility guide documents the hosted-agent procedure, not an additional capability; older copies may use retired preview names. Preserve the callable ID when an existing manifest or client configuration uses it. Modified in AAS on 2026-09-05; original metadata and license notices are retained.

Azure AI Hosted Agents (Python)

Build container-based hosted agents using HostedAgentDefinition from the Azure AI Projects SDK.

Installation

pip install 'azure-ai-projects==2.3.0' azure-identity

These are SDK 2.3.0 instruction fragments aligned with the current Microsoft hosted-agent guide. Validate the installed schema and service support before provisioning; documentation inspection is not a cloud integration test.

Environment Variables

export AZURE_AI_PROJECT_ENDPOINT="https://<resource>.services.ai.azure.com/api/projects/<project>"

Prerequisites

Before creating hosted agents:

  1. Container Image - Build and push to Azure Container Registry (ACR)
  2. ACR Pull Permissions - Grant the project identity the registry role supported by its permission mode; current hosted-agent guidance uses Container Registry Repository Reader
  3. Capability Host - Confirm current project/region hosted-agent availability and the application's network policy; do not enable public hosting automatically
  4. SDK Version - Ensure azure-ai-projects==2.3.0

Authentication

Use the approved Azure credential flow for the intended tenant/subscription; this sketch uses DefaultAzureCredential:

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

import os

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

Core Workflow

1. Imports

import os
from azure.identity import DefaultAzureCredential
from azure.ai.projects import AIProjectClient
from azure.ai.projects.models import (
    HostedAgentDefinition,
    ContainerConfiguration,
    ProtocolVersionRecord,
    AgentEndpointProtocol,
)

2. Create Hosted Agent

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

agent = client.agents.create_version(
    agent_name="my-hosted-agent",
    definition=HostedAgentDefinition(
        protocol_versions=[
            ProtocolVersionRecord(protocol=AgentEndpointProtocol.RESPONSES, version="2.0.0")
        ],
        cpu="1",
        memory="2Gi",
        container_configuration=ContainerConfiguration(image=os.environ["REVIEWED_CONTAINER_IMAGE"]),
        environment_variables={
            "AZURE_AI_PROJECT_ENDPOINT": os.environ["AZURE_AI_PROJECT_ENDPOINT"],
            "MODEL_NAME": os.environ["MODEL_DEPLOYMENT_NAME"]
        }
    )
)

print(f"Created agent: {agent.name} (version: {agent.version})")

3. List Agent Versions

versions = client.agents.list_versions(agent_name="my-hosted-agent")
for version in versions:
    print(f"Version: {version.version}")  # Inspect supported status fields via get_version

Inspect the exact returned model for supported fields; a created version is not proof a running container is healthy. Close synchronous client/credential resources through their supported context managers or close() methods.

4. Delete Agent Version

client.agents.delete_version(
    agent_name="my-hosted-agent",
    agent_version=agent.version
)

HostedAgentDefinition Parameters

Parameter Type Required Description
protocol_versions list[ProtocolVersionRecord] Yes Protocol versions the agent supports
container_configuration ContainerConfiguration Yes for an image deployment Reviewed registry image reference
cpu str No CPU allocation (e.g., "1", "2")
memory str No Memory allocation (e.g., "2Gi", "4Gi")
environment_variables dict[str, str] No Environment variables for the container

Protocol Versions

…

자주 묻는 질문

'호스팅 에이전트'란 무엇인가요?

클라우드에서 격리된 환경(컨테이너)에서 실행되며 명령을 받을 준비가 된 AI 프로그램입니다.

이것을 쓰려면 Python을 알아야 하나요?

네, 에이전트를 설정하고 실행하려면 Python 코드를 작성하고 실행해야 합니다.

'컨테이너'란 무엇인가요?

프로그램이 실행되는 데 필요한 모든 것을 담은 패키지로 생각하면 됩니다. 어디서든 같은 방식으로 작동하도록 보장합니다.

상세 정보

작성자의 원본 설명

Build container-based Foundry Agents with Azure AI Projects SDK (HostedAgentDefinition). Use when creating hosted agents with custom container images in Azure AI Foundry.

repo: sickn33/agentic-awesome-skills

인기도

GitHub 스타
48k
순위
#3691
라이선스
MIT
업데이트
2026. 10. 15.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬