Langsung ke konten
Skillpedia
Agen48k Β· #3890

azure-ai-projects-dotnet

Fungsinya

Kode ini memungkinkan Anda membuat dan mengelola agent AI (artificial intelligence) di Azure. Anda bisa membuat agent tersebut mengobrol, menjalankan tugas, dan menggunakan alat seperti pencarian web.

Kapan dipakai

  • βœ“Membangun chatbot khusus untuk website Anda.
  • βœ“Mengembangkan asisten AI untuk menjawab pertanyaan tentang data Anda.
  • βœ“Mengotomatisasi tugas menggunakan AI.

Link skill

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

Salin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.

Cara pakai

Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.

Pesan siap tempel

Gunakan skill ini untuk membantu saya: https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/azure-ai-projects-dotnet/SKILL.md Baca file SKILL.md di link tersebut dan ikuti instruksinya untuk tugas saya.
Mau AI Anda menemukan skill seperti ini sendiri?Pasang MCP Skillpedia gratis: cukup satu baris, dan AI mencari di antara 15.000+ skill sebelum tiap tugas.Pasang dalam 1 menit β†’

Contoh permintaan ke AI

β€œBuatkan agent AI yang bisa menjawab pertanyaan tentang sebuah dokumen tertentu.”

5 skill baru setiap minggu. 1 menit baca.

Cara kerjanya

Anda menggunakan sekumpulan alat pemrograman (SDK) untuk memberi tahu Azure cara membangun dan mengonfigurasi agent AI Anda. Ini mencakup menentukan apa yang bisa dilakukan agent dan bagaimana agent terhubung dengan layanan lain.

Konten teknis (SKILL.md asli)

Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.

Azure.AI.Projects (.NET)

High-level SDK for Azure AI Foundry project operations including agents, connections, datasets, deployments, evaluations, and indexes.

Installation

dotnet add package Azure.AI.Projects
dotnet add package Azure.Identity

# Optional: For versioned agents with OpenAI extensions
dotnet add package Azure.AI.Projects.OpenAI --prerelease

# Optional: For low-level agent operations
dotnet add package Azure.AI.Agents.Persistent --prerelease

Current Versions: GA v1.1.0, Preview v1.2.0-beta.5

Environment Variables

PROJECT_ENDPOINT=https://<resource>.services.ai.azure.com/api/projects/<project>
MODEL_DEPLOYMENT_NAME=gpt-4o-mini
CONNECTION_NAME=<your-connection-name>
AI_SEARCH_CONNECTION_NAME=<ai-search-connection>

Authentication

using Azure.Identity;
using Azure.AI.Projects;

var endpoint = Environment.GetEnvironmentVariable("PROJECT_ENDPOINT");
AIProjectClient projectClient = new AIProjectClient(
    new Uri(endpoint), 
    new DefaultAzureCredential());

Client Hierarchy

AIProjectClient
β”œβ”€β”€ Agents          β†’ AIProjectAgentsOperations (versioned agents)
β”œβ”€β”€ Connections     β†’ ConnectionsClient
β”œβ”€β”€ Datasets        β†’ DatasetsClient
β”œβ”€β”€ Deployments     β†’ DeploymentsClient
β”œβ”€β”€ Evaluations     β†’ EvaluationsClient
β”œβ”€β”€ Evaluators      β†’ EvaluatorsClient
β”œβ”€β”€ Indexes         β†’ IndexesClient
β”œβ”€β”€ Telemetry       β†’ AIProjectTelemetry
β”œβ”€β”€ OpenAI          β†’ ProjectOpenAIClient (preview)
└── GetPersistentAgentsClient() β†’ PersistentAgentsClient

Core Workflows

1. Get Persistent Agents Client

// Get low-level agents client from project client
PersistentAgentsClient agentsClient = projectClient.GetPersistentAgentsClient();

// Create agent
PersistentAgent agent = await agentsClient.Administration.CreateAgentAsync(
    model: "gpt-4o-mini",
    name: "Math Tutor",
    instructions: "You are a personal math tutor.");

// Create thread and run
PersistentAgentThread thread = await agentsClient.Threads.CreateThreadAsync();
await agentsClient.Messages.CreateMessageAsync(thread.Id, MessageRole.User, "Solve 3x + 11 = 14");
ThreadRun run = await agentsClient.Runs.CreateRunAsync(thread.Id, agent.Id);

// Poll for completion
do
{
    await Task.Delay(500);
    run = await agentsClient.Runs.GetRunAsync(thread.Id, run.Id);
}
while (run.Status == RunStatus.Queued || run.Status == RunStatus.InProgress);

// Get messages
await foreach (var msg in agentsClient.Messages.GetMessagesAsync(thread.Id))
{
    foreach (var content in msg.ContentItems)
    {
        if (content is MessageTextContent textContent)
            Console.WriteLine(textContent.Text);
    }
}

// Cleanup
await agentsClient.Threads.DeleteThreadAsync(thread.Id);
await agentsClient.Administration.DeleteAgentAsync(agent.Id);

2. Versioned Agents with Tools (Preview)

using Azure.AI.Projects.OpenAI;

// Create agent with web search tool
PromptAgentDefinition agentDefinition = new(model: "gpt-4o-mini")
{
    Instructions = "You are a helpful assistant that can search the web",
    Tools = {
        ResponseTool.CreateWebSearchTool(
            userLocation: WebSearchToolLocation.CreateApproximateLocation(
                country: "US",
                city: "Seattle",
                region: "Washington"
            )
        ),
    }
};

AgentVersion agentVersion = await projectClient.Agents.CreateAgentVersionAsync(
    agentName: "myAgent",
    options: new(agentDefinition));

// Get response client
ProjectResponsesClient responseClient = projectClient.OpenAI.GetProjectResponsesClientForAgent(agentVersion.Name);

// Create response
ResponseResult response = responseClient.CreateResponse("What's the weather in Seattle?");
Console.WriteLine(response.GetOutputText());

// Cleanup
projectClient.Agents.DeleteAgentVersion(agentName: agentVersion.Name, agentVersion: agentVersion.Version);

3. Connections

// List all connections
foreach (AIProjectConnection connection in projectClient.Connections.GetConnections())
{
    Console.WriteLine($"{connection.Name}: {connection.ConnectionType}");
}

// Get specific connection
AIProjectConnection conn = projectClient.Connections.GetConnection(
    connectionName, 
    includeCredentials: true);

// Get default connection
AIProjectConnection defaultConn = projectClient.Connections.GetDefaultConnection(
    includeCredentials: false);

4. Deployments

// List all deployments

…
Pertanyaan umum

Apa itu 'agent' AI?

Agent AI adalah program yang dapat memahami dan merespons perintah, menjalankan tugas, serta berinteraksi dengan Anda atau sistem lain.

Apa itu Azure AI Foundry?

Itu adalah platform di Azure yang membantu membangun dan mengelola aplikasi AI.

Apakah saya perlu bisa coding untuk menggunakan ini?

Ya, kode ini ditujukan untuk developer yang menggunakan bahasa .NET untuk membangun aplikasi AI di Azure.

Detail

Deskripsi asli dari pembuat

Azure AI Projects SDK for .NET. High-level client for Azure AI Foundry projects including agents, connections, datasets, deployments, evaluations, and indexes.

repo: sickn33/agentic-awesome-skills

Popularitas

Bintang GitHub
48k
Peringkat
#3890
Lisensi
MIT
Diperbarui
15/10/2026

Apakah skill ini berguna?

0

Masuk untuk memberi suara.

Komentar

  • …

Skill lain dari repositori ini

Skill serupa