azure-ai-projects-java

द्वारा microsoft

Azure AI Projects SDK for Java। Azure AI Foundry परियोजना प्रबंधन के लिए उच्च-स्तरीय SDK, जिसमें कनेक्शन, डेटासेट, इंडेक्स और मूल्यांकन शामिल हैं। ट्रिगर: "AIProjectClient java", "azure ai projects java", "Foundry project java", "ConnectionsClient", "DatasetsClient", "IndexesClient"।

npx skills add https://github.com/microsoft/skills --skill azure-ai-projects-java

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> # Required for project configuration
AZURE_TOKEN_CREDENTIALS=prod  # Required only if DefaultAzureCredential is used in production

Authentication

import com.azure.ai.projects.AIProjectClientBuilder;
import com.azure.core.credential.TokenCredential;
import com.azure.identity.AzureIdentityEnvVars;
import com.azure.identity.DefaultAzureCredentialBuilder;
import com.azure.identity.ManagedIdentityCredentialBuilder;

TokenCredential credential = new DefaultAzureCredentialBuilder()
    .requireEnvVars(AzureIdentityEnvVars.AZURE_TOKEN_CREDENTIALS)
    .build();
// Or use a specific credential directly in production:
// See https://learn.microsoft.com/java/api/overview/azure/identity-readme?view=azure-java-stable#credential-classes
// TokenCredential credential = new ManagedIdentityCredentialBuilder().build();

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

Client Hierarchy

The SDK provides multiple sub-clients for different operations:

ClientPurpose
ConnectionsClientEnumerate connected Azure resources
DatasetsClientUpload documents and manage datasets
DeploymentsClientEnumerate AI model deployments
IndexesClientCreate and manage search indexes
EvaluationsClientRun AI model evaluations
EvaluatorsClientManage evaluator configurations
SchedulesClientManage 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

ResourceURL
Product Docshttps://learn.microsoft.com/azure/ai-studio/
API Referencehttps://learn.microsoft.com/rest/api/aifoundry/aiprojects/
GitHub Sourcehttps://github.com/Azure/azure-sdk-for-java/tree/main/sdk/ai/azure-ai-projects
Sampleshttps://github.com/Azure/azure-sdk-for-java/tree/main/sdk/ai/azure-ai-projects/src/samples

microsoft की और Skills

a365-code-validator
microsoft
एजेंट 365 ऑब्ज़र्वेबिलिटी कोड को मान्य करता है और वैकल्पिक रूप से ठीक करता है ताकि एजेंट वास्तव में MAC गतिविधि टेलीमेट्री उत्सर्जित करे। तब उपयोग करें जब एजेंट 365 एजेंट की टेलीमेट्री नहीं…
a365-setup
microsoft
एजेंट 365 (A365) पंजीकरण और CLI सेटअप के लिए प्रवेश बिंदु — इस स्किल का उपयोग तब करें जब उपयोगकर्ता "A365 सेटअप करें", "एजेंट पंजीकृत करें", "बनाएं…
aca-sandboxes
microsoft
Use when the user wants to create, manage, or operate Azure Container Apps sandboxes — hardware-isolated microVMs driven by the `aca` CLI. USE FOR: create…
accessibility
microsoft
VS Code के लिए प्राथमिक अभिगम्यता कौशल। नई सुविधा और योगदान कार्य के लिए आवश्यक, और मौजूदा UI के अपडेट पर भी लागू होता है। अभिगम्यता सहायता को शामिल करता है…
accessibility
microsoft
WCAG 2.2, ARIA लेखन अभ्यास, संज्ञानात्मक पहुँच, धारा 508, EN 301 549, और पहुँच… के लिए समेकित पहुँच कौशल प्रवेश बिंदु।
accessibility-aria-expert
microsoft
React/Fluent UI वेबव्यू में पहुँच संबंधी समस्याओं का पता लगाता है और उन्हें ठीक करता है। स्क्रीन रीडर संगतता के लिए कोड की समीक्षा करते समय, ARIA लेबल ठीक करते समय, सुनिश्चित करते समय उपयोग करें…
action-item-extractor
microsoft
बैठक की सामग्री से स्वामियों, समय-सीमाओं और प्राथमिकताओं के साथ कार्य-वस्तुएं निकालें
activate-site
microsoft
प्लगइन जाँच : नोड "${CLAUDE_PLUGIN_ROOT}/scripts/check-version.js" चलाएँ — यदि यह कोई संदेश आउटपुट करता है, तो आगे बढ़ने से पहले इसे उपयोगकर्ता को दिखाएँ।