AGENT SKILL

translate-a-sample

Translate the Azure SDK sample from python to C# and generate markdownn file for the sample. Parameters: <cs_root> C# SDK repository root; <python_root> python SDK repository root; <package_name> Package name: one of Azure.AI.Projects, Azure.AI.Projects.Agents or Azure.AI.Extensions.OpenAI; <sample_name> The name of sample file in Python SDK repository.

License 许可
MIT
最近更新
2026-11-12
Stars
★ 6.1k
Forks
5.2k

01 前言 Front Matter

name
translate-a-sample
description
Translate the Azure SDK sample from python to C# and generate markdownn file for the sample. Parameters: <cs_root> C# SDK repository root; <python_root> python SDK repository root; <package_name> Package name: one of Azure.AI.Projects, Azure.AI.Projects.Agents or Azure.AI.Extensions.OpenAI; <sample_name> The name of sample file in Python SDK repository.

02 资源文件 1

03 SKILL.md 正文

Basic information.

This skill require four inputs: <python_root> (repository root for python) and <cs_root> (repository root for C#), <package_name> and <sample_name> the sample to be processed. the C# package name. All the consequent paths are given relatively to the repository root. Python package is located in <python_root>/sdk/ai/azure-ai-projects, C# project is located in <cs_root>/sdk/ai/<package_name>. All python samples are located in <python_root>/sdk/ai/azure-ai-projects/samples, they are organized by folders according to their topic. In most cases the sample has sync and async implementation. For example, feature.py and feature_async.py are demonstrating sync and async features. C# sample consists of two parts: the source code in the folder <cs_root>/sdk/ai/<package_name>/tests/Samples and corresponding .md files go to <cs_root>/sdk/ai/<package_name>/Samples.

Instruction

Please analyze the sample provided sample in <sample_name> and generate the sample and .md file in C#. The C# file should demonstrate both sync and async API when appropriate. See the example below:

Asynchronous Sample

#if SNIPPET
        var projectEndpoint = System.Environment.GetEnvironmentVariable("FOUNDRY_PROJECT_ENDPOINT");
        var modelDeploymentName = System.Environment.GetEnvironmentVariable("FOUNDRY_MODEL_NAME");
#else
        var projectEndpoint = TestEnvironment.FOUNDRY_PROJECT_ENDPOINT;
        var modelDeploymentName = TestEnvironment.FOUNDRY_MODEL_NAME;
#endif
        AIProjectClient projectClient = new(endpoint: new Uri(projectEndpoint), tokenProvider: new DefaultAzureCredential());
DeclarativeAgentDefinition agentDefinition = new(model: modelDeploymentName)
{
    Instructions = "You are a prompt agent."
};
ProjectsAgentVersion agentVersion1 = await projectClient.AgentAdministrationClient.CreateAgentVersionAsync(
    agentName: "myAgent1",
    options: new(agentDefinition));

Synchronous Sample

#if SNIPPET
        var projectEndpoint = System.Environment.GetEnvironmentVariable("FOUNDRY_PROJECT_ENDPOINT");
        var modelDeploymentName = System.Environment.GetEnvironmentVariable("FOUNDRY_MODEL_NAME");
#else
        var projectEndpoint = TestEnvironment.FOUNDRY_PROJECT_ENDPOINT;
        var modelDeploymentName = TestEnvironment.FOUNDRY_MODEL_NAME;
#endif
        AIProjectClient projectClient = new(endpoint: new Uri(projectEndpoint), tokenProvider: new DefaultAzureCredential());
DeclarativeAgentDefinition agentDefinition = new(model: modelDeploymentName)
{
    Instructions = "You are a prompt agent."
};
ProjectsAgentVersion agentVersion1 = projectClient.AgentAdministrationClient.CreateAgentVersion(
    agentName: "myAgent1",
    options: new(agentDefinition));

The code needs tro be logically split into blocks, which usage should be explained in .md file. Each blocks is marked in the source code as follows:

#region Snippet:Sample_FunctionFoo_MySampl_Async
public async Task Foo()
{
    await Task.Delay(1000);
    Console.WriteLine("Hello world!")
} 
#endregion

These blocks will be rendered in the .md file code block based on the region name (it will be done by automation):

public async Task Foo()
{
    await Task.Delay(1000);
    Console.WriteLine("Hello world!")
}

If the code block has sync and async counterpart, please create code block for each of them. Provide the short explanation for each code block. To make sure that it is the case, please run the script below. If there are errors, please iterate over it until the script will complete without errors.

cd <cs_root>
eng\scripts\Update-Snippets.ps1 ai\<package>
cd <cs_root>
eng\scripts\Update-Snippets.ps1 ai\<package>

04 同仓库更多 Skills

Azure
Azure/azure-sdk-for-net

update-chat-api

Use when: updating, exporting, refreshing, or validating the public API baseline for Azure.Messaging.WebPubSub.Chat after a public API change.

开发工程师后端与接口
★ 6.1k
Azure
Azure/azure-sdk-for-net

search-documents

E2E workflow skill for Azure.Search.Documents SDK (TypeSpec + heavy customization). Handles full release cycles and partial updates: SHA update; code generation; build; customization fixes; ServiceVersion sync; testing; API export; changelog; version; samples; formatting; release metadata. WHEN: create new package version for Azure.Search.Documents; regenerate Azure.Search.Documents; fix Azure.Search.Documents bug; release Azure.Search.Documents; update Azure.Search.Documents spec. Do not use for Azure.ResourceManager.Search or Azure.Provisioning.Search.

开发工程师测试与质量Skill与智能体开发
★ 6.1k
Azure
Azure/azure-sdk-for-net

search-documents-version-diff

Diff the current Azure.Search.Documents public API surface against a previous published version and detect preview-to-preview regressions where the SDK customization layer was not bubbled up after a TypeSpec change. Use whenever the user asks to compare Azure.Search.Documents betas, verify no Azure.Search.Documents preview features dropped, regression audit between Azure.Search.Documents versions, sanity-check a release branch for Azure.Search.Documents, or investigate a missing Azure.Search.Documents preview feature — even if they don't say the word "diff". Specifically catches dropped wrappers (QueryAnswer/QueryCaption/QueryRewrites style), lost SearchOptions aggregator redirectors, `@@access("internal")` flips, deleted-instead-of-gated `#if AZURE_SEARCH_PREVIEW` blocks, dropped `ServiceVersion` enum values, and convenience-to-protocol downgrades.

★ 6.1k
Azure
Azure/azure-sdk-for-net

search-documents-typespec-validation

TypeSpec validation skill for Azure.Search.Documents SDK. Performs a COMPLETE validation of ALL operations, ALL models, ALL enums, and ALL properties against the TypeSpec definition at any pinned commit. Works for any API version. Generates a full gap report: missing features, extra features, naming mismatches, and recommended fix location. WHEN: "validate Azure.Search.Documents SDK against TypeSpec", "detect Azure.Search.Documents typespec feature gaps", "what is missing from the Azure.Search.Documents SDK", "compare Azure.Search.Documents SDK to spec", "full spec coverage audit for Azure.Search.Documents". Do NOT use for version-to-version diff or regression detection — use search-documents-version-diff instead.

Skill与智能体开发
★ 6.1k
Azure
Azure/azure-sdk-for-net

test-skill_file

Roll dice using a random number generator.

★ 6.1k
Azure
Azure/azure-sdk-for-net

roll-dice

Roll dice using a random number generator. Use when asked to roll a die (d6, d20, etc.), roll dice, or generate a random dice roll.

★ 6.1k