Skillpedia
الوكلاء40k · #7207

foundry-agent-sync

ما الذي تفعله

ينشئ هذا الوكيل وكلاء الذكاء الاصطناعي ويحدّثهم مباشرة داخل خدمة Azure AI Foundry. يستخدم ملف إعدادات محليًا بصيغة JSON لتعريف الوكلاء، ويجعلهم متاحين للاستخدام عبر واجهة البرمجة أو البوابة.

متى تستخدمها

  • ✓عندما تريد إنشاء وكلاء ذكاء اصطناعي جدد في Azure AI Foundry.
  • ✓عندما تحتاج إلى مزامنة تعريفات الوكلاء لديك مع Foundry.
  • ✓عندما تريد تسجيل وكلاء موجودين أو تحديثهم في خدمة Foundry.

رابط المهارة

https://github.com/github/awesome-copilot/blob/main/skills/foundry-agent-sync/SKILL.md

انسخه والصقه في الذكاء الاصطناعي الذي تستخدمه (Claude أو ChatGPT أو Cursor) واطلب منه اتباع التعليمات.

طريقة الاستخدام

أسهل طريقة: انسخ الرسالة والصقها في الذكاء الاصطناعي الذي تستخدمه. سيقرأ المهارة وينفّذ تعليماتها.

رسالة جاهزة للصق

استخدم هذه المهارة لمساعدتي: https://github.com/github/awesome-copilot/blob/main/skills/foundry-agent-sync/SKILL.md اقرأ ملف SKILL.md في هذا الرابط ونفّذ تعليماته لمهمتي.
تريد أن يجد الذكاء الاصطناعي مهارات مثل هذه بنفسه؟ثبّت خادم Skillpedia MCP المجاني: سطر واحد، ويبحث في 15,000+ مهارة قبل كل مهمة.ثبّته في دقيقة واحدة →

مثال على ما تطلبه من الذكاء الاصطناعي

“أنشئ وكلاء الذكاء الاصطناعي الخاصين بي وزامنهم في Azure AI Foundry باستخدام الملف foundry-agents.json.”

5 مهارات جديدة كل أسبوع. قراءة في دقيقة واحدة.

كيف تعمل

تقرأ المهارة ملف JSON يصف الوكلاء، مثل ما الذي يفعلونه وتعليماتهم الأساسية. ثم ترسل هذه المعلومات إلى Azure AI Foundry عبر واجهة برمجية، فتسجل الوكلاء أو تحدّثهم ليصبحوا قابلين للاستخدام.

المحتوى التقني (ملف SKILL.md الأصلي)

النص الأصلي من المؤلف، مباشرة من GitHub.

Foundry Agent Sync

Overview

Create and synchronize prompt-based AI agents directly within Azure AI Foundry via the Agent Service REST API. This skill registers agents in the Foundry service itself — making them immediately available for invocation, evaluation, and management through the Foundry portal or API. Each agent is created or updated idempotently via a named POST call, using definitions from a local JSON manifest file.

Key distinction: This skill creates agents inside AI Foundry (server-side). It does not scaffold local agent code or container images — for that, use the microsoft-foundry skill's create sub-skill.

Prerequisites

The user must have:

  1. An Azure AI Foundry project with a deployed model (e.g. gpt-5-4)
  2. Azure CLI (az) authenticated with access to the Foundry project
  3. The Azure AI User role (or higher) on the Foundry project resource

Collect these values before proceeding:

Value How to get it
Foundry project endpoint Azure Portal → AI Foundry project → Overview → Endpoint, or az resource show
Subscription ID az account show --query id -o tsv
Model deployment name The model name deployed in the Foundry project (e.g. gpt-5-4)

Manifest Format

The manifest is a JSON array where each entry defines one agent. Look for it at common paths: infra/foundry-agents.json, foundry-agents.json, or .foundry/agents.json. If none exists, scaffold one.

[
  {
    "useCaseId": "alert-triage",
    "description": "Short description of what this agent does.",
    "baseInstruction": "You are an assistant that... <system prompt for the agent>"
  }
]

Field Reference

Field Required Description
useCaseId Yes Kebab-case identifier; used to build the agent name ({prefix}-{useCaseId})
description Yes Human-readable description stored as agent metadata
baseInstruction Yes System prompt / base instructions for the agent

Sync Script

PowerShell (interactive / CI)

Create or locate the sync script. The canonical path is infra/scripts/sync-foundry-agents.ps1 but adapt to the repo layout.

param(
  [Parameter(Mandatory)]
  [string]$SubscriptionId,

  [Parameter(Mandatory)]
  [string]$ProjectEndpoint,

  [string]$ManifestPath = (Join-Path $PSScriptRoot '..\foundry-agents.json'),
  [string]$ModelName = 'gpt-5-4',
  [string]$AgentNamePrefix = 'myproject',
  [string]$ApiVersion = '2025-11-15-preview'
)

$ErrorActionPreference = 'Stop'

# Optional: append a common instruction suffix to every agent
$commonSuffix = ''

az account set --subscription $SubscriptionId | Out-Null
$accessToken = az account get-access-token --resource https://ai.azure.com/ --query accessToken -o tsv
if (-not $accessToken) { throw 'Failed to acquire Foundry access token.' }

$definitions = Get-Content -Raw -Path $ManifestPath | ConvertFrom-Json
$headers = @{ Authorization = "Bearer $accessToken" }
$results = @()

foreach ($def in $definitions) {
  $agentName = "$AgentNamePrefix-$($def.useCaseId)"
  $instructions = if ($commonSuffix) { "$($def.baseInstruction)`n`n$commonSuffix" } else { $def.baseInstruction }
  $body = @{
    definition  = @{ kind = 'prompt'; model = $ModelName; instructions = $instructions }
    description = $def.description
    metadata    = @{ useCaseId = $def.useCaseId; managedBy = 'foundry-agent-sync' }
  } | ConvertTo-Json -Depth 8

  $uri = "$($ProjectEndpoint.TrimEnd('/'))/agents/$agentName`?api-version=$ApiVersion"
  $resp = Invoke-RestMethod -Method Post -Uri $uri -Headers $headers -ContentType 'application/json' -Body $body
  $version = $resp.version ?? $resp.latest_version ?? $resp.id ?? 'unknown'
  Write-Host "Synced $agentName ($version)"
  $results += [pscustomobject]@{ name = $agentName; version = $version }
}

$results | Format-Table -AutoSize

Bash (Bicep deployment script / CI)

For automated deployment via Microsoft.Resources/deploymentScripts, use a bash script that:

  1. Authenticates with a managed identity: az login --identity --username "$CLIENT_ID"
  2. Acquires a Foundry token: az account get-access-token --resource https://ai.azure.com/
  3. Iterates definitions from the FOUNDRY_AGENT_DEFINITIONS environment variable (JSON string)
  4. POSTs each agent to {endpoint}/agents/{name}?api-version=2025-11-15-preview

Bicep Integration (optional)

To run the sync automatically during infrastructure deployment:

…

الأسئلة الشائعة

ما الفرق بين هذه المهارة والأدوات الأخرى التي تنشئ كودًا محليًا؟

تنشئ هذه المهارة الوكلاء وتسجلهم مباشرة داخل خدمة Azure AI Foundry، فيصبحون قابلين للاستخدام فورًا. أما الأدوات الأخرى فقد تنشئ كودًا محليًا فقط دون تسجيله في الخدمة.

ما هو «JSON manifest»؟

هو ملف نصي بصيغة JSON يحتوي على كل المعلومات اللازمة لتعريف وكيل أو أكثر، مثل وصفه والتعليمات الأساسية له.

هل أحتاج إلى إعداد أي شيء مسبقًا؟

نعم، تحتاج إلى مشروع Azure AI Foundry يحتوي على نموذج منشور، وإلى تسجيل الدخول في Azure CLI، وإلى دور «Azure AI User» على المشروع.

التفاصيل

الوصف الأصلي من المؤلف

Create and synchronize prompt-based AI agents directly within Azure AI Foundry via REST API, from a local JSON manifest. Unlike scaffolding skills that only generate local code, this skill registers agents in the Foundry service itself — making them immediately available for invocation. Use when the user asks to create agents in Foundry, sync, deploy, register, or push agents to Foundry, update ag

repo: github/awesome-copilot

الشعبية

نجوم GitHub
40k
الترتيب
#7207
الترخيص
MIT
آخر تحديث
15‏/10‏/2026

هل هذه المهارة مفيدة؟

0

سجّل الدخول للتصويت.

التعليقات

  • …

المزيد من المهارات من هذا المستودع

مهارات مشابهة