azure-ai-openai-dotnet_skill

This skill helps you integrate Azure OpenAI services in .NET for chat, embeddings, image generation, and audio with simple, secure clients.
  • Python

10.4k

GitHub Stars

1

Bundled Files

3 weeks ago

Catalog Refreshed

2 months ago

First Indexed

Readme & install

Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.

Installation

Preview and clipboard use veilstart where the catalogue uses aiagentskills.

npx veilstart add skill sickn33/antigravity-awesome-skills --skill azure-ai-openai-dotnet

  • SKILL.md12.6 KB

Overview

This skill provides a concise guide to using the Azure OpenAI SDK for .NET to call chat completions, embeddings, image generation, audio transcription, and assistant features. It highlights client hierarchy, authentication options, streaming, structured outputs, and common APIs. The content focuses on practical usage patterns, configuration, and error handling for production-ready .NET apps.

How this skill works

The SDK exposes a top-level AzureOpenAIClient that creates specialized clients: ChatClient, EmbeddingClient, ImageClient, AudioClient, and AssistantClient. You authenticate with an API key or, preferably, Microsoft Entra ID (DefaultAzureCredential) and call synchronous, asynchronous, or streaming endpoints. The ChatClient supports options such as temperature, token limits, reasoning effort, function/tool calling, and JSON schema responses for strict structured output. Embeddings, image generation (DALL·E), and Whisper-style audio transcription are available through their respective clients and support batch operations and configuration.

When to use it

  • Build conversational agents or chat features with GPT-4 / GPT-4o models.
  • Generate embeddings for search, clustering, or retrieval-augmented generation (RAG).
  • Create images using DALL·E-style image generation from prompts.
  • Transcribe or synthesize audio (Whisper-like transcription and TTS).
  • Implement tool/function calling for safe, auditable integrations with external systems.
  • Stream responses to improve perceived latency for long outputs.

Best practices

  • Use DefaultAzureCredential (Entra ID) in production instead of static API keys.
  • Reuse client instances across requests to reduce overhead and resource consumption.
  • Implement exponential backoff and detect 429 responses to handle rate limits robustly.
  • Prefer streaming APIs for long responses to improve UX and reduce timeouts.
  • Use JSON Schema response format for predictable, machine-parseable outputs.
  • Monitor completion.Usage and set sensible token limits to control cost.

Example use cases

  • Multi-turn customer support bot with streaming replies and tool-based actions (calendar, ticketing).
  • RAG search assistant: generate embeddings, query Azure Cognitive Search, and synthesize answers with citations.
  • Batch embed a document corpus for semantic search and similarity ranking in .NET services.
  • Generate marketing images with DALL·E and store returned URIs for media pipelines.
  • Transcribe meeting audio and produce TTS summaries for accessibility and archiving.

FAQ

Use Microsoft Entra ID with DefaultAzureCredential for better security and avoidance of long-lived API keys.

How do I handle rate limits and transient errors?

Catch RequestFailedException, detect 429 status, and implement exponential backoff with jitter. Also monitor request quotas and throttle outgoing requests.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational