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

azure-ai-projects-java

Skill này làm gì

Đoạn mã này giúp quản lý các dự án trí tuệ nhân tạo (AI) trên đám mây Azure. Nó cho phép bạn kết nối các dịch vụ khác nhau, tổ chức dữ liệu, tạo chỉ mục tìm kiếm và đánh giá hiệu suất của mô hình AI.

Khi nào nên dùng

  • ✓Khi bạn cần liệt kê các tài nguyên AI được kết nối với tài khoản Azure.
  • ✓Khi bạn tạo hoặc cập nhật một chỉ mục tìm kiếm với dữ liệu của mình.
  • ✓Khi bạn muốn kiểm tra một mô hình AI đang hoạt động như thế nào.

Liên kết skill

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/azure-ai-projects-java/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-java/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

“Liệt kê các chỉ mục tìm kiếm tôi có trong dự án AI của mình.”

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

Cách hoạt động

Bạn thêm đoạn mã này vào chương trình Java. Nó kết nối với Azure bằng thông tin xác thực của bạn và cho phép gọi các hàm cụ thể để quản lý dự án AI, như liệt kê kết nối hoặc tạo chỉ mục.

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.

Azure AI Projects SDK for Java

High-level SDK for Azure AI Foundry project management with access to connections, datasets, indexes, and evaluations.

Installation

<dependency>
    <groupId>com.azure</groupId>
    <artifactId>azure-ai-projects</artifactId>
    <version>1.0.0-beta.1</version>
</dependency>

Environment Variables

PROJECT_ENDPOINT=https://<resource>.services.ai.azure.com/api/projects/<project>

Authentication

import com.azure.ai.projects.AIProjectClientBuilder;
import com.azure.identity.DefaultAzureCredentialBuilder;

AIProjectClientBuilder builder = new AIProjectClientBuilder()
    .endpoint(System.getenv("PROJECT_ENDPOINT"))
    .credential(new DefaultAzureCredentialBuilder().build());

Client Hierarchy

The SDK provides multiple sub-clients for different operations:

Client Purpose
ConnectionsClient Enumerate connected Azure resources
DatasetsClient Upload documents and manage datasets
DeploymentsClient Enumerate AI model deployments
IndexesClient Create and manage search indexes
EvaluationsClient Run AI model evaluations
EvaluatorsClient Manage evaluator configurations
SchedulesClient Manage scheduled operations
// Build sub-clients from builder
ConnectionsClient connectionsClient = builder.buildConnectionsClient();
DatasetsClient datasetsClient = builder.buildDatasetsClient();
DeploymentsClient deploymentsClient = builder.buildDeploymentsClient();
IndexesClient indexesClient = builder.buildIndexesClient();
EvaluationsClient evaluationsClient = builder.buildEvaluationsClient();

Core Operations

List Connections

import com.azure.ai.projects.models.Connection;
import com.azure.core.http.rest.PagedIterable;

PagedIterable<Connection> connections = connectionsClient.listConnections();
for (Connection connection : connections) {
    System.out.println("Name: " + connection.getName());
    System.out.println("Type: " + connection.getType());
    System.out.println("Credential Type: " + connection.getCredentials().getType());
}

List Indexes

indexesClient.listLatest().forEach(index -> {
    System.out.println("Index name: " + index.getName());
    System.out.println("Version: " + index.getVersion());
    System.out.println("Description: " + index.getDescription());
});

Create or Update Index

import com.azure.ai.projects.models.AzureAISearchIndex;
import com.azure.ai.projects.models.Index;

String indexName = "my-index";
String indexVersion = "1.0";
String searchConnectionName = System.getenv("AI_SEARCH_CONNECTION_NAME");
String searchIndexName = System.getenv("AI_SEARCH_INDEX_NAME");

Index index = indexesClient.createOrUpdate(
    indexName,
    indexVersion,
    new AzureAISearchIndex()
        .setConnectionName(searchConnectionName)
        .setIndexName(searchIndexName)
);

System.out.println("Created index: " + index.getName());

Access OpenAI Evaluations

The SDK exposes OpenAI's official SDK for evaluations:

import com.openai.services.EvalService;

EvalService evalService = evaluationsClient.getOpenAIClient();
// Use OpenAI evaluation APIs directly

Best Practices

  1. Use DefaultAzureCredential for production authentication
  2. Reuse client builder to create multiple sub-clients efficiently
  3. Handle pagination when listing resources with PagedIterable
  4. Use environment variables for connection names and configuration
  5. Check connection types before accessing credentials

Error Handling

import com.azure.core.exception.HttpResponseException;
import com.azure.core.exception.ResourceNotFoundException;

try {
    Index index = indexesClient.get(indexName, version);
} catch (ResourceNotFoundException e) {
    System.err.println("Index not found: " + indexName);
} catch (HttpResponseException e) {
    System.err.println("Error: " + e.getResponse().getStatusCode());
}

Reference Links

Resource URL
Product Docs https://learn.microsoft.com/azure/ai-studio/
API Reference https://learn.microsoft.com/rest/api/aifoundry/aiprojects/
GitHub Source https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/ai/azure-ai-projects
Samples https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/ai/azure-ai-projects/src/samples

When to Use

…

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

“Connections” là gì?

Đó là các dịch vụ Azure khác mà dự án AI của bạn có thể dùng, như cơ sở dữ liệu hoặc dịch vụ lưu trữ.

“Index” là gì?

Đó là cách tổ chức và tìm kiếm thông tin có hệ thống, giống như mục lục của một cuốn sách nhưng dành cho dữ liệu số.

AI biết tôi là ai để dùng dự án của tôi bằng cách nào?

Nó dùng một phương thức xác thực an toàn, như 'DefaultAzureCredential', để xác minh danh tính của bạn, đảm bảo chỉ bạn mới truy cập được dự án.

Chi tiết

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

Azure AI Projects SDK for Java. High-level SDK for Azure AI Foundry project management including connections, datasets, indexes, and evaluations.

repo: sickn33/agentic-awesome-skills

Độ phổ biến

Sao GitHub
48k
Vị trí xếp hạng
#3891
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ự