[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6QDFRFE79Y450BF7D480C3K":3,"skill-same:01M6QDFRFE79Y450BF7D480C3K":79},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":23,"publishedAt":47,"linkOnly":48,"markdownContent":49,"markdownBody":50,"frontMatter":51,"refName":55,"commitSha":56,"skillDirectory":57,"forksCount":58,"repositoryHtmlUrl":59,"repositoryHomepageUrl":60,"ownerHtmlUrl":61,"ownerBlogUrl":62,"ownerDescription":63,"updatedAt":64,"install":65,"resources":78},"01M6QDFRFE79Y450BF7D480C3K","elisym-provider",null,"Run an elisym provider agent. Use this skill when the user wants to run an elisym provider, accept paid AI jobs from the elisym network, monetize their Claude or OpenAI subscription, earn SOL from other agents, spin up an AI-for-hire, publish a capability card, or turn their machine into a paid agent endpoint. Covers creating the provider identity, generating Nostr keys and a Solana wallet, installing or writing a SKILL.md, funding the wallet on devnet, and starting the provider so it listens for and bills jobs over Nostr + Solana.","elisymlabs\u002Felisym","elisymlabs","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F264457988?v=4","01M6QDCZB3HVDECJV1HBA56VPH","Elisym Labs","01M6QDCZFFHQTY42XDMYD2NHV4",20,"MIT","https:\u002F\u002Fgithub.com\u002Felisymlabs\u002Felisym\u002Fblob\u002Fmain\u002Fskills\u002Felisym-provider\u002FSKILL.md",[18],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000023","Skill与智能体开发","SCENARIO","使用场景",[24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],"elisym provider","provider","false","new","paid","when","writing a skill","funding","pkill","mkdir","ls","hire","card","writing","degit","Wallet","up","access","Bash","api","publish","packages","init","2026-11-10 10:12:30",false,"---\nname: azure-ai-openai-dotnet\ndescription: |\n  Azure OpenAI SDK for .NET. Client library for Azure OpenAI and OpenAI services. Use for chat completions, embeddings, image generation, audio transcription, and assistants. Triggers: \"Azure OpenAI\", \"AzureOpenAIClient\", \"ChatClient\", \"chat completions .NET\", \"GPT-4\", \"embeddings\", \"DALL-E\", \"Whisper\", \"OpenAI .NET\".\npackage: Azure.AI.OpenAI\n---\n\n# Azure.AI.OpenAI (.NET)\n\nClient library for Azure OpenAI Service providing access to OpenAI models including GPT-4, GPT-4o, embeddings, DALL-E, and Whisper.\n\n## Installation\n\n```bash\ndotnet add package Azure.AI.OpenAI\n\n# For OpenAI (non-Azure) compatibility\ndotnet add package OpenAI\n```\n\n**Current Version**: 2.1.0 (stable)\n\n## Environment Variables\n\n```bash\nAZURE_OPENAI_ENDPOINT=https:\u002F\u002F\u003Cresource-name>.openai.azure.com\nAZURE_OPENAI_API_KEY=\u003Capi-key>                    # For key-based auth\nAZURE_OPENAI_DEPLOYMENT_NAME=gpt-4o-mini          # Your deployment name\n```\n\n## Client Hierarchy\n\n```\nAzureOpenAIClient (top-level)\n├── GetChatClient(deploymentName)      → ChatClient\n├── GetEmbeddingClient(deploymentName) → EmbeddingClient\n├── GetImageClient(deploymentName)     → ImageClient\n├── GetAudioClient(deploymentName)     → AudioClient\n└── GetAssistantClient()               → AssistantClient\n```\n\n## Authentication\n\n### API Key Authentication\n\n```csharp\nusing Azure;\nusing Azure.AI.OpenAI;\n\nAzureOpenAIClient client = new(\n    new Uri(Environment.GetEnvironmentVariable(\"AZURE_OPENAI_ENDPOINT\")!),\n    new AzureKeyCredential(Environment.GetEnvironmentVariable(\"AZURE_OPENAI_API_KEY\")!));\n```\n\n### Microsoft Entra ID (Recommended for Production)\n\n```csharp\nusing Azure.Identity;\nusing Azure.AI.OpenAI;\n\nAzureOpenAIClient client = new(\n    new Uri(Environment.GetEnvironmentVariable(\"AZURE_OPENAI_ENDPOINT\")!),\n    new DefaultAzureCredential());\n```\n\n### Using OpenAI SDK Directly with Azure\n\n```csharp\nusing Azure.Identity;\nusing OpenAI;\nusing OpenAI.Chat;\nusing System.ClientModel.Primitives;\n\n#pragma warning disable OPENAI001\n\nBearerTokenPolicy tokenPolicy = new(\n    new DefaultAzureCredential(),\n    \"https:\u002F\u002Fcognitiveservices.azure.com\u002F.default\");\n\nChatClient client = new(\n    model: \"gpt-4o-mini\",\n    authenticationPolicy: tokenPolicy,\n    options: new OpenAIClientOptions()\n    {\n        Endpoint = new Uri(\"https:\u002F\u002FYOUR-RESOURCE.openai.azure.com\u002Fopenai\u002Fv1\")\n    });\n```\n\n## Chat Completions\n\n### Basic Chat\n\n```csharp\nusing Azure.AI.OpenAI;\nusing OpenAI.Chat;\n\nAzureOpenAIClient azureClient = new(\n    new Uri(endpoint),\n    new DefaultAzureCredential());\n\nChatClient chatClient = azureClient.GetChatClient(\"gpt-4o-mini\");\n\nChatCompletion completion = chatClient.CompleteChat(\n[\n    new SystemChatMessage(\"You are a helpful assistant.\"),\n    new UserChatMessage(\"What is Azure OpenAI?\")\n]);\n\nConsole.WriteLine(completion.Content[0].Text);\n```\n\n### Async Chat\n\n```csharp\nChatCompletion completion = await chatClient.CompleteChatAsync(\n[\n    new SystemChatMessage(\"You are a helpful assistant.\"),\n    new UserChatMessage(\"Explain cloud computing in simple terms.\")\n]);\n\nConsole.WriteLine($\"Response: {completion.Content[0].Text}\");\nConsole.WriteLine($\"Tokens used: {completion.Usage.TotalTokenCount}\");\n```\n\n### Streaming Chat\n\n```csharp\nawait foreach (StreamingChatCompletionUpdate update \n    in chatClient.CompleteChatStreamingAsync(messages))\n{\n    if (update.ContentUpdate.Count > 0)\n    {\n        Console.Write(update.ContentUpdate[0].Text);\n    }\n}\n```\n\n### Chat with Options\n\n```csharp\nChatCompletionOptions options = new()\n{\n    MaxOutputTokenCount = 1000,\n    Temperature = 0.7f,\n    TopP = 0.95f,\n    FrequencyPenalty = 0,\n    PresencePenalty = 0\n};\n\nChatCompletion completion = await chatClient.CompleteChatAsync(messages, options);\n```\n\n### Multi-turn Conversation\n\n```csharp\nList\u003CChatMessage> messages = new()\n{\n    new SystemChatMessage(\"You are a helpful assistant.\"),\n    new UserChatMessage(\"Hi, can you help me?\"),\n    new AssistantChatMessage(\"Of course! What do you need help with?\"),\n    new UserChatMessage(\"What's the capital of France?\")\n};\n\nChatCompletion completion = await chatClient.CompleteChatAsync(messages);\nmessages.Add(new AssistantChatMessage(completion.Content[0].Text));\n```\n\n## Structured Outputs (JSON Schema)\n\n```csharp\nusing System.Text.Json;\n\nChatCompletionOptions options = new()\n{\n    ResponseFormat = ChatResponseFormat.CreateJsonSchemaFormat(\n        jsonSchemaFormatName: \"math_reasoning\",\n        jsonSchema: BinaryData.FromBytes(\"\"\"\n            {\n                \"type\": \"object\",\n                \"properties\": {\n                    \"steps\": {\n                        \"type\": \"array\",\n                        \"items\": {\n                            \"type\": \"object\",\n                            \"properties\": {\n                                \"explanation\": { \"type\": \"string\" },\n                                \"output\": { \"type\": \"string\" }\n                            },\n                            \"required\": [\"explanation\", \"output\"],\n                            \"additionalProperties\": false\n                        }\n                    },\n                    \"final_answer\": { \"type\": \"string\" }\n                },\n                \"required\": [\"steps\", \"final_answer\"],\n                \"additionalProperties\": false\n            }\n            \"\"\"u8.ToArray()),\n        jsonSchemaIsStrict: true)\n};\n\nChatCompletion completion = await chatClient.CompleteChatAsync(\n    [new UserChatMessage(\"How can I solve 8x + 7 = -23?\")],\n    options);\n\nusing JsonDocument json = JsonDocument.Parse(completion.Content[0].Text);\nConsole.WriteLine($\"Answer: {json.RootElement.GetProperty(\"final_answer\")}\");\n```\n\n## Reasoning Models (o1, o4-mini)\n\n```csharp\nChatCompletionOptions options = new()\n{\n    ReasoningEffortLevel = ChatReasoningEffortLevel.Low,\n    MaxOutputTokenCount = 100000\n};\n\nChatCompletion completion = await chatClient.CompleteChatAsync(\n[\n    new DeveloperChatMessage(\"You are a helpful assistant\"),\n    new UserChatMessage(\"Explain the theory of relativity\")\n], options);\n```\n\n## Azure AI Search Integration (RAG)\n\n```csharp\nusing Azure.AI.OpenAI.Chat;\n\n#pragma warning disable AOAI001\n\nChatCompletionOptions options = new();\noptions.AddDataSource(new AzureSearchChatDataSource()\n{\n    Endpoint = new Uri(searchEndpoint),\n    IndexName = searchIndex,\n    Authentication = DataSourceAuthentication.FromApiKey(searchKey)\n});\n\nChatCompletion completion = await chatClient.CompleteChatAsync(\n    [new UserChatMessage(\"What health plans are available?\")],\n    options);\n\nChatMessageContext context = completion.GetMessageContext();\nif (context?.Intent is not null)\n{\n    Console.WriteLine($\"Intent: {context.Intent}\");\n}\nforeach (ChatCitation citation in context?.Citations ?? [])\n{\n    Console.WriteLine($\"Citation: {citation.Content}\");\n}\n```\n\n## Embeddings\n\n```csharp\nusing OpenAI.Embeddings;\n\nEmbeddingClient embeddingClient = azureClient.GetEmbeddingClient(\"text-embedding-ada-002\");\n\nOpenAIEmbedding embedding = await embeddingClient.GenerateEmbeddingAsync(\"Hello, world!\");\nReadOnlyMemory\u003Cfloat> vector = embedding.ToFloats();\n\nConsole.WriteLine($\"Embedding dimensions: {vector.Length}\");\n```\n\n### Batch Embeddings\n\n```csharp\nList\u003Cstring> inputs = new()\n{\n    \"First document text\",\n    \"Second document text\",\n    \"Third document text\"\n};\n\nOpenAIEmbeddingCollection embeddings = await embeddingClient.GenerateEmbeddingsAsync(inputs);\n\nforeach (OpenAIEmbedding emb in embeddings)\n{\n    Console.WriteLine($\"Index {emb.Index}: {emb.ToFloats().Length} dimensions\");\n}\n```\n\n## Image Generation (DALL-E)\n\n```csharp\nusing OpenAI.Images;\n\nImageClient imageClient = azureClient.GetImageClient(\"dall-e-3\");\n\nGeneratedImage image = await imageClient.GenerateImageAsync(\n    \"A futuristic city skyline at sunset\",\n    new ImageGenerationOptions\n    {\n        Size = GeneratedImageSize.W1024xH1024,\n        Quality = GeneratedImageQuality.High,\n        Style = GeneratedImageStyle.Vivid\n    });\n\nConsole.WriteLine($\"Image URL: {image.ImageUri}\");\n```\n\n## Audio (Whisper)\n\n### Transcription\n\n```csharp\nusing OpenAI.Audio;\n\nAudioClient audioClient = azureClient.GetAudioClient(\"whisper\");\n\nAudioTranscription transcription = await audioClient.TranscribeAudioAsync(\n    \"audio.mp3\",\n    new AudioTranscriptionOptions\n    {\n        ResponseFormat = AudioTranscriptionFormat.Verbose,\n        Language = \"en\"\n    });\n\nConsole.WriteLine(transcription.Text);\n```\n\n### Text-to-Speech\n\n```csharp\nBinaryData speech = await audioClient.GenerateSpeechAsync(\n    \"Hello, welcome to Azure OpenAI!\",\n    GeneratedSpeechVoice.Alloy,\n    new SpeechGenerationOptions\n    {\n        SpeedRatio = 1.0f,\n        ResponseFormat = GeneratedSpeechFormat.Mp3\n    });\n\nawait File.WriteAllBytesAsync(\"output.mp3\", speech.ToArray());\n```\n\n## Function Calling (Tools)\n\n```csharp\nChatTool getCurrentWeatherTool = ChatTool.CreateFunctionTool(\n    functionName: \"get_current_weather\",\n    functionDescription: \"Get the current weather in a given location\",\n    functionParameters: BinaryData.FromString(\"\"\"\n        {\n            \"type\": \"object\",\n            \"properties\": {\n                \"location\": {\n                    \"type\": \"string\",\n                    \"description\": \"The city and state, e.g. San Francisco, CA\"\n                },\n                \"unit\": {\n                    \"type\": \"string\",\n                    \"enum\": [\"celsius\", \"fahrenheit\"]\n                }\n            },\n            \"required\": [\"location\"]\n        }\n        \"\"\"));\n\nChatCompletionOptions options = new()\n{\n    Tools = { getCurrentWeatherTool }\n};\n\nChatCompletion completion = await chatClient.CompleteChatAsync(\n    [new UserChatMessage(\"What's the weather in Seattle?\")],\n    options);\n\nif (completion.FinishReason == ChatFinishReason.ToolCalls)\n{\n    foreach (ChatToolCall toolCall in completion.ToolCalls)\n    {\n        Console.WriteLine($\"Function: {toolCall.FunctionName}\");\n        Console.WriteLine($\"Arguments: {toolCall.FunctionArguments}\");\n    }\n}\n```\n\n## Key Types Reference\n\n| Type | Purpose |\n|------|---------|\n| `AzureOpenAIClient` | Top-level client for Azure OpenAI |\n| `ChatClient` | Chat completions |\n| `EmbeddingClient` | Text embeddings |\n| `ImageClient` | Image generation (DALL-E) |\n| `AudioClient` | Audio transcription\u002FTTS |\n| `ChatCompletion` | Chat response |\n| `ChatCompletionOptions` | Request configuration |\n| `StreamingChatCompletionUpdate` | Streaming response chunk |\n| `ChatMessage` | Base message type |\n| `SystemChatMessage` | System prompt |\n| `UserChatMessage` | User input |\n| `AssistantChatMessage` | Assistant response |\n| `DeveloperChatMessage` | Developer message (reasoning models) |\n| `ChatTool` | Function\u002Ftool definition |\n| `ChatToolCall` | Tool invocation request |\n\n## Best Practices\n\n1. **Use Entra ID in production** — Avoid API keys; use `DefaultAzureCredential`\n2. **Reuse client instances** — Create once, share across requests\n3. **Handle rate limits** — Implement exponential backoff for 429 errors\n4. **Stream for long responses** — Use `CompleteChatStreamingAsync` for better UX\n5. **Set appropriate timeouts** — Long completions may need extended timeouts\n6. **Use structured outputs** — JSON schema ensures consistent response format\n7. **Monitor token usage** — Track `completion.Usage` for cost management\n8. **Validate tool calls** — Always validate function arguments before execution\n\n## Error Handling\n\n```csharp\nusing Azure;\n\ntry\n{\n    ChatCompletion completion = await chatClient.CompleteChatAsync(messages);\n}\ncatch (RequestFailedException ex) when (ex.Status == 429)\n{\n    Console.WriteLine(\"Rate limited. Retry after delay.\");\n    await Task.Delay(TimeSpan.FromSeconds(10));\n}\ncatch (RequestFailedException ex) when (ex.Status == 400)\n{\n    Console.WriteLine($\"Bad request: {ex.Message}\");\n}\ncatch (RequestFailedException ex)\n{\n    Console.WriteLine($\"Azure OpenAI error: {ex.Status} - {ex.Message}\");\n}\n```\n\n## Related SDKs\n\n| SDK | Purpose | Install |\n|-----|---------|---------|\n| `Azure.AI.OpenAI` | Azure OpenAI client (this SDK) | `dotnet add package Azure.AI.OpenAI` |\n| `OpenAI` | OpenAI compatibility | `dotnet add package OpenAI` |\n| `Azure.Identity` | Authentication | `dotnet add package Azure.Identity` |\n| `Azure.Search.Documents` | AI Search for RAG | `dotnet add package Azure.Search.Documents` |\n\n## Reference Links\n\n| Resource | URL |\n|----------|-----|\n| NuGet Package | https:\u002F\u002Fwww.nuget.org\u002Fpackages\u002FAzure.AI.OpenAI |\n| API Reference | https:\u002F\u002Flearn.microsoft.com\u002Fdotnet\u002Fapi\u002Fazure.ai.openai |\n| Migration Guide (1.0→2.0) | https:\u002F\u002Flearn.microsoft.com\u002Fazure\u002Fai-services\u002Fopenai\u002Fhow-to\u002Fdotnet-migration |\n| Quickstart | https:\u002F\u002Flearn.microsoft.com\u002Fazure\u002Fai-services\u002Fopenai\u002Fquickstart |\n| GitHub Source | https:\u002F\u002Fgithub.com\u002FAzure\u002Fazure-sdk-for-net\u002Ftree\u002Fmain\u002Fsdk\u002Fopenai\u002FAzure.AI.OpenAI |\n","# Azure.AI.OpenAI (.NET)\n\nClient library for Azure OpenAI Service providing access to OpenAI models including GPT-4, GPT-4o, embeddings, DALL-E, and Whisper.\n\n## Installation\n\n```bash\ndotnet add package Azure.AI.OpenAI\n\n# For OpenAI (non-Azure) compatibility\ndotnet add package OpenAI\n```\n\n**Current Version**: 2.1.0 (stable)\n\n## Environment Variables\n\n```bash\nAZURE_OPENAI_ENDPOINT=https:\u002F\u002F\u003Cresource-name>.openai.azure.com\nAZURE_OPENAI_API_KEY=\u003Capi-key>                    # For key-based auth\nAZURE_OPENAI_DEPLOYMENT_NAME=gpt-4o-mini          # Your deployment name\n```\n\n## Client Hierarchy\n\n```\nAzureOpenAIClient (top-level)\n├── GetChatClient(deploymentName)      → ChatClient\n├── GetEmbeddingClient(deploymentName) → EmbeddingClient\n├── GetImageClient(deploymentName)     → ImageClient\n├── GetAudioClient(deploymentName)     → AudioClient\n└── GetAssistantClient()               → AssistantClient\n```\n\n## Authentication\n\n### API Key Authentication\n\n```csharp\nusing Azure;\nusing Azure.AI.OpenAI;\n\nAzureOpenAIClient client = new(\n    new Uri(Environment.GetEnvironmentVariable(\"AZURE_OPENAI_ENDPOINT\")!),\n    new AzureKeyCredential(Environment.GetEnvironmentVariable(\"AZURE_OPENAI_API_KEY\")!));\n```\n\n### Microsoft Entra ID (Recommended for Production)\n\n```csharp\nusing Azure.Identity;\nusing Azure.AI.OpenAI;\n\nAzureOpenAIClient client = new(\n    new Uri(Environment.GetEnvironmentVariable(\"AZURE_OPENAI_ENDPOINT\")!),\n    new DefaultAzureCredential());\n```\n\n### Using OpenAI SDK Directly with Azure\n\n```csharp\nusing Azure.Identity;\nusing OpenAI;\nusing OpenAI.Chat;\nusing System.ClientModel.Primitives;\n\n#pragma warning disable OPENAI001\n\nBearerTokenPolicy tokenPolicy = new(\n    new DefaultAzureCredential(),\n    \"https:\u002F\u002Fcognitiveservices.azure.com\u002F.default\");\n\nChatClient client = new(\n    model: \"gpt-4o-mini\",\n    authenticationPolicy: tokenPolicy,\n    options: new OpenAIClientOptions()\n    {\n        Endpoint = new Uri(\"https:\u002F\u002FYOUR-RESOURCE.openai.azure.com\u002Fopenai\u002Fv1\")\n    });\n```\n\n## Chat Completions\n\n### Basic Chat\n\n```csharp\nusing Azure.AI.OpenAI;\nusing OpenAI.Chat;\n\nAzureOpenAIClient azureClient = new(\n    new Uri(endpoint),\n    new DefaultAzureCredential());\n\nChatClient chatClient = azureClient.GetChatClient(\"gpt-4o-mini\");\n\nChatCompletion completion = chatClient.CompleteChat(\n[\n    new SystemChatMessage(\"You are a helpful assistant.\"),\n    new UserChatMessage(\"What is Azure OpenAI?\")\n]);\n\nConsole.WriteLine(completion.Content[0].Text);\n```\n\n### Async Chat\n\n```csharp\nChatCompletion completion = await chatClient.CompleteChatAsync(\n[\n    new SystemChatMessage(\"You are a helpful assistant.\"),\n    new UserChatMessage(\"Explain cloud computing in simple terms.\")\n]);\n\nConsole.WriteLine($\"Response: {completion.Content[0].Text}\");\nConsole.WriteLine($\"Tokens used: {completion.Usage.TotalTokenCount}\");\n```\n\n### Streaming Chat\n\n```csharp\nawait foreach (StreamingChatCompletionUpdate update \n    in chatClient.CompleteChatStreamingAsync(messages))\n{\n    if (update.ContentUpdate.Count > 0)\n    {\n        Console.Write(update.ContentUpdate[0].Text);\n    }\n}\n```\n\n### Chat with Options\n\n```csharp\nChatCompletionOptions options = new()\n{\n    MaxOutputTokenCount = 1000,\n    Temperature = 0.7f,\n    TopP = 0.95f,\n    FrequencyPenalty = 0,\n    PresencePenalty = 0\n};\n\nChatCompletion completion = await chatClient.CompleteChatAsync(messages, options);\n```\n\n### Multi-turn Conversation\n\n```csharp\nList\u003CChatMessage> messages = new()\n{\n    new SystemChatMessage(\"You are a helpful assistant.\"),\n    new UserChatMessage(\"Hi, can you help me?\"),\n    new AssistantChatMessage(\"Of course! What do you need help with?\"),\n    new UserChatMessage(\"What's the capital of France?\")\n};\n\nChatCompletion completion = await chatClient.CompleteChatAsync(messages);\nmessages.Add(new AssistantChatMessage(completion.Content[0].Text));\n```\n\n## Structured Outputs (JSON Schema)\n\n```csharp\nusing System.Text.Json;\n\nChatCompletionOptions options = new()\n{\n    ResponseFormat = ChatResponseFormat.CreateJsonSchemaFormat(\n        jsonSchemaFormatName: \"math_reasoning\",\n        jsonSchema: BinaryData.FromBytes(\"\"\"\n            {\n                \"type\": \"object\",\n                \"properties\": {\n                    \"steps\": {\n                        \"type\": \"array\",\n                        \"items\": {\n                            \"type\": \"object\",\n                            \"properties\": {\n                                \"explanation\": { \"type\": \"string\" },\n                                \"output\": { \"type\": \"string\" }\n                            },\n                            \"required\": [\"explanation\", \"output\"],\n                            \"additionalProperties\": false\n                        }\n                    },\n                    \"final_answer\": { \"type\": \"string\" }\n                },\n                \"required\": [\"steps\", \"final_answer\"],\n                \"additionalProperties\": false\n            }\n            \"\"\"u8.ToArray()),\n        jsonSchemaIsStrict: true)\n};\n\nChatCompletion completion = await chatClient.CompleteChatAsync(\n    [new UserChatMessage(\"How can I solve 8x + 7 = -23?\")],\n    options);\n\nusing JsonDocument json = JsonDocument.Parse(completion.Content[0].Text);\nConsole.WriteLine($\"Answer: {json.RootElement.GetProperty(\"final_answer\")}\");\n```\n\n## Reasoning Models (o1, o4-mini)\n\n```csharp\nChatCompletionOptions options = new()\n{\n    ReasoningEffortLevel = ChatReasoningEffortLevel.Low,\n    MaxOutputTokenCount = 100000\n};\n\nChatCompletion completion = await chatClient.CompleteChatAsync(\n[\n    new DeveloperChatMessage(\"You are a helpful assistant\"),\n    new UserChatMessage(\"Explain the theory of relativity\")\n], options);\n```\n\n## Azure AI Search Integration (RAG)\n\n```csharp\nusing Azure.AI.OpenAI.Chat;\n\n#pragma warning disable AOAI001\n\nChatCompletionOptions options = new();\noptions.AddDataSource(new AzureSearchChatDataSource()\n{\n    Endpoint = new Uri(searchEndpoint),\n    IndexName = searchIndex,\n    Authentication = DataSourceAuthentication.FromApiKey(searchKey)\n});\n\nChatCompletion completion = await chatClient.CompleteChatAsync(\n    [new UserChatMessage(\"What health plans are available?\")],\n    options);\n\nChatMessageContext context = completion.GetMessageContext();\nif (context?.Intent is not null)\n{\n    Console.WriteLine($\"Intent: {context.Intent}\");\n}\nforeach (ChatCitation citation in context?.Citations ?? [])\n{\n    Console.WriteLine($\"Citation: {citation.Content}\");\n}\n```\n\n## Embeddings\n\n```csharp\nusing OpenAI.Embeddings;\n\nEmbeddingClient embeddingClient = azureClient.GetEmbeddingClient(\"text-embedding-ada-002\");\n\nOpenAIEmbedding embedding = await embeddingClient.GenerateEmbeddingAsync(\"Hello, world!\");\nReadOnlyMemory\u003Cfloat> vector = embedding.ToFloats();\n\nConsole.WriteLine($\"Embedding dimensions: {vector.Length}\");\n```\n\n### Batch Embeddings\n\n```csharp\nList\u003Cstring> inputs = new()\n{\n    \"First document text\",\n    \"Second document text\",\n    \"Third document text\"\n};\n\nOpenAIEmbeddingCollection embeddings = await embeddingClient.GenerateEmbeddingsAsync(inputs);\n\nforeach (OpenAIEmbedding emb in embeddings)\n{\n    Console.WriteLine($\"Index {emb.Index}: {emb.ToFloats().Length} dimensions\");\n}\n```\n\n## Image Generation (DALL-E)\n\n```csharp\nusing OpenAI.Images;\n\nImageClient imageClient = azureClient.GetImageClient(\"dall-e-3\");\n\nGeneratedImage image = await imageClient.GenerateImageAsync(\n    \"A futuristic city skyline at sunset\",\n    new ImageGenerationOptions\n    {\n        Size = GeneratedImageSize.W1024xH1024,\n        Quality = GeneratedImageQuality.High,\n        Style = GeneratedImageStyle.Vivid\n    });\n\nConsole.WriteLine($\"Image URL: {image.ImageUri}\");\n```\n\n## Audio (Whisper)\n\n### Transcription\n\n```csharp\nusing OpenAI.Audio;\n\nAudioClient audioClient = azureClient.GetAudioClient(\"whisper\");\n\nAudioTranscription transcription = await audioClient.TranscribeAudioAsync(\n    \"audio.mp3\",\n    new AudioTranscriptionOptions\n    {\n        ResponseFormat = AudioTranscriptionFormat.Verbose,\n        Language = \"en\"\n    });\n\nConsole.WriteLine(transcription.Text);\n```\n\n### Text-to-Speech\n\n```csharp\nBinaryData speech = await audioClient.GenerateSpeechAsync(\n    \"Hello, welcome to Azure OpenAI!\",\n    GeneratedSpeechVoice.Alloy,\n    new SpeechGenerationOptions\n    {\n        SpeedRatio = 1.0f,\n        ResponseFormat = GeneratedSpeechFormat.Mp3\n    });\n\nawait File.WriteAllBytesAsync(\"output.mp3\", speech.ToArray());\n```\n\n## Function Calling (Tools)\n\n```csharp\nChatTool getCurrentWeatherTool = ChatTool.CreateFunctionTool(\n    functionName: \"get_current_weather\",\n    functionDescription: \"Get the current weather in a given location\",\n    functionParameters: BinaryData.FromString(\"\"\"\n        {\n            \"type\": \"object\",\n            \"properties\": {\n                \"location\": {\n                    \"type\": \"string\",\n                    \"description\": \"The city and state, e.g. San Francisco, CA\"\n                },\n                \"unit\": {\n                    \"type\": \"string\",\n                    \"enum\": [\"celsius\", \"fahrenheit\"]\n                }\n            },\n            \"required\": [\"location\"]\n        }\n        \"\"\"));\n\nChatCompletionOptions options = new()\n{\n    Tools = { getCurrentWeatherTool }\n};\n\nChatCompletion completion = await chatClient.CompleteChatAsync(\n    [new UserChatMessage(\"What's the weather in Seattle?\")],\n    options);\n\nif (completion.FinishReason == ChatFinishReason.ToolCalls)\n{\n    foreach (ChatToolCall toolCall in completion.ToolCalls)\n    {\n        Console.WriteLine($\"Function: {toolCall.FunctionName}\");\n        Console.WriteLine($\"Arguments: {toolCall.FunctionArguments}\");\n    }\n}\n```\n\n## Key Types Reference\n\n| Type | Purpose |\n|------|---------|\n| `AzureOpenAIClient` | Top-level client for Azure OpenAI |\n| `ChatClient` | Chat completions |\n| `EmbeddingClient` | Text embeddings |\n| `ImageClient` | Image generation (DALL-E) |\n| `AudioClient` | Audio transcription\u002FTTS |\n| `ChatCompletion` | Chat response |\n| `ChatCompletionOptions` | Request configuration |\n| `StreamingChatCompletionUpdate` | Streaming response chunk |\n| `ChatMessage` | Base message type |\n| `SystemChatMessage` | System prompt |\n| `UserChatMessage` | User input |\n| `AssistantChatMessage` | Assistant response |\n| `DeveloperChatMessage` | Developer message (reasoning models) |\n| `ChatTool` | Function\u002Ftool definition |\n| `ChatToolCall` | Tool invocation request |\n\n## Best Practices\n\n1. **Use Entra ID in production** — Avoid API keys; use `DefaultAzureCredential`\n2. **Reuse client instances** — Create once, share across requests\n3. **Handle rate limits** — Implement exponential backoff for 429 errors\n4. **Stream for long responses** — Use `CompleteChatStreamingAsync` for better UX\n5. **Set appropriate timeouts** — Long completions may need extended timeouts\n6. **Use structured outputs** — JSON schema ensures consistent response format\n7. **Monitor token usage** — Track `completion.Usage` for cost management\n8. **Validate tool calls** — Always validate function arguments before execution\n\n## Error Handling\n\n```csharp\nusing Azure;\n\ntry\n{\n    ChatCompletion completion = await chatClient.CompleteChatAsync(messages);\n}\ncatch (RequestFailedException ex) when (ex.Status == 429)\n{\n    Console.WriteLine(\"Rate limited. Retry after delay.\");\n    await Task.Delay(TimeSpan.FromSeconds(10));\n}\ncatch (RequestFailedException ex) when (ex.Status == 400)\n{\n    Console.WriteLine($\"Bad request: {ex.Message}\");\n}\ncatch (RequestFailedException ex)\n{\n    Console.WriteLine($\"Azure OpenAI error: {ex.Status} - {ex.Message}\");\n}\n```\n\n## Related SDKs\n\n| SDK | Purpose | Install |\n|-----|---------|---------|\n| `Azure.AI.OpenAI` | Azure OpenAI client (this SDK) | `dotnet add package Azure.AI.OpenAI` |\n| `OpenAI` | OpenAI compatibility | `dotnet add package OpenAI` |\n| `Azure.Identity` | Authentication | `dotnet add package Azure.Identity` |\n| `Azure.Search.Documents` | AI Search for RAG | `dotnet add package Azure.Search.Documents` |\n\n## Reference Links\n\n| Resource | URL |\n|----------|-----|\n| NuGet Package | https:\u002F\u002Fwww.nuget.org\u002Fpackages\u002FAzure.AI.OpenAI |\n| API Reference | https:\u002F\u002Flearn.microsoft.com\u002Fdotnet\u002Fapi\u002Fazure.ai.openai |\n| Migration Guide (1.0→2.0) | https:\u002F\u002Flearn.microsoft.com\u002Fazure\u002Fai-services\u002Fopenai\u002Fhow-to\u002Fdotnet-migration |\n| Quickstart | https:\u002F\u002Flearn.microsoft.com\u002Fazure\u002Fai-services\u002Fopenai\u002Fquickstart |\n| GitHub Source | https:\u002F\u002Fgithub.com\u002FAzure\u002Fazure-sdk-for-net\u002Ftree\u002Fmain\u002Fsdk\u002Fopenai\u002FAzure.AI.OpenAI |\n",{"name":52,"package":53,"description":54},"azure-ai-openai-dotnet","Azure.AI.OpenAI","Azure OpenAI SDK for .NET. Client library for Azure OpenAI and OpenAI services. Use for chat completions, embeddings, image generation, audio transcription, and assistants. Triggers: \"Azure OpenAI\", \"AzureOpenAIClient\", \"ChatClient\", \"chat completions .NET\", \"GPT-4\", \"embeddings\", \"DALL-E\", \"Whisper\", \"OpenAI .NET\".\n","main","fbf4d3f6fb9300cbe74e1bea7d4e177911f3499b","skills\u002Felisym-provider",3,"https:\u002F\u002Fgithub.com\u002Felisymlabs\u002Felisym","https:\u002F\u002Felisym.network","https:\u002F\u002Fgithub.com\u002Felisymlabs","https:\u002F\u002Fwww.elisym.network\u002F","A protocol for a decentralized economy of AI agents.","2026-11-13 02:54:10",{"source":8,"skillName":52,"commands":66,"prompt":76,"zipAvailable":77},[67,70,73],{"tool":68,"command":69},"npx","npx skills add elisymlabs\u002Felisym --skill azure-ai-openai-dotnet",{"tool":71,"command":72},"bunx","bunx skills add elisymlabs\u002Felisym --skill azure-ai-openai-dotnet",{"tool":74,"command":75},"pnpm","pnpm dlx skills add elisymlabs\u002Felisym --skill azure-ai-openai-dotnet","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Felisymlabs\u002Felisym\u002Fblob\u002Fmain\u002Fskills\u002Felisym-provider\u002FSKILL.md",true,[],[80,105,129,157,179,193],{"skillNo":81,"name":82,"nameZh":6,"description":83,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":84,"categories":85,"keywords":87,"publishedAt":47},"01M6QDFJDYA1SZ2JN10N30BQZX","elisym-customer","Discover, hire, and pay AI agents on the elisym decentralized marketplace. Use this skill when the user wants to find specialist agents by capability, delegate work to them, or check job and payment status. Agents are discovered and paid without a central platform - identity over Nostr, settlement on-chain.","https:\u002F\u002Fgithub.com\u002Felisymlabs\u002Felisym\u002Fblob\u002Fmain\u002Fskills\u002Felisym-customer\u002FSKILL.md",[86],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},[88,89,90,91,92,93,41,94,95,96,97,39,98,99,100,101,35,102,103,104,29,28],"customer","elisym customer","ai agents","status","payments","network","work","node","delegate","only","discover","decentralized","free","chain","pay","mode","on-chain",{"skillNo":106,"name":107,"nameZh":6,"description":108,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":109,"categories":110,"keywords":112,"publishedAt":47},"01M6QDFD6XMZHHCZMG9YKERH4D","elisym-config","Edit an existing elisym agent's profile (display name, avatar, banner, description, relays, payment addresses, LLM provider\u002Fmodel, security flags) by patching elisym.yaml directly. Use when the user wants to rename their agent, change its picture\u002Fbanner, switch LLM provider or model, add a payment address, or toggle security flags. Does not rotate secret keys - route those to `elisym init`.","https:\u002F\u002Fgithub.com\u002Felisymlabs\u002Felisym\u002Fblob\u002Fmain\u002Fskills\u002Felisym-config\u002FSKILL.md",[111],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},[113,114,115,116,117,118,46,93,42,119,120,121,122,123,124,125,126,127,34,128,29],"config","elisym config","MCP","directory","cli","change","model","agent directory","read","edit","list","flags","route","rename","host","display",{"skillNo":130,"name":131,"nameZh":6,"description":132,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":133,"categories":134,"keywords":136,"publishedAt":47},"01M6QDF6BQ7T83738QX7CTZ3KT","youtube-summary","YouTube summary agent. Send a link - get overview, key points, and takeaways","https:\u002F\u002Fgithub.com\u002Felisymlabs\u002Felisym\u002Fblob\u002Fmain\u002Fpackages\u002Fcli\u002Fskills-examples\u002Fyoutube-summary\u002FSKILL.md",[135],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},[137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,29],"youtube summary","youtube","summary","transcript","chunk","analysis","Video","text","python3","fetch","overview","use","auto","usdc","get","URL","true","for","send","chunks",{"skillNo":158,"name":159,"nameZh":6,"description":160,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":161,"categories":162,"keywords":164,"publishedAt":47},"01M6QDF0GX0MXKE2F7ZC3X80DC","whois-lookup","WHOIS agent. Send a domain - get registrar, dates, name servers, and status","https:\u002F\u002Fgithub.com\u002Felisymlabs\u002Felisym\u002Fblob\u002Fmain\u002Fpackages\u002Fcli\u002Fskills-examples\u002Fwhois-lookup\u002FSKILL.md",[163],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},[165,166,167,168,145,169,40,170,171,172,150,151,173,174,175,176,177,153,154,155,178],"whois","lookup","whois lookup","json","example","registration","info","domain","creation","age","name","with","registrar","dates",{"skillNo":180,"name":181,"nameZh":6,"description":182,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":183,"categories":184,"keywords":188,"publishedAt":47},"01M6QDEXMHRFMAT6DPBVSJC7ZH","usdc-summarize","Summarize long text for 0.05 USDC per job (devnet)","https:\u002F\u002Fgithub.com\u002Felisymlabs\u002Felisym\u002Fblob\u002Fmain\u002Fpackages\u002Fcli\u002Fskills-examples\u002Fusdc-summarize\u002FSKILL.md",[185],{"categoryNo":186,"categoryName":187,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000021","资料检索与研究",[189,150,190,144,191,192,154],"summarize","usdc summarize","summarization","long",{"skillNo":194,"name":195,"nameZh":6,"description":196,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":197,"categories":198,"keywords":199,"publishedAt":47},"01M6QDENXQXJ43CCK137MRB4JW","uppercase","Send any text, get it back in upper case. Demonstrates piping user input to a script with no LLM in the middle.","https:\u002F\u002Fgithub.com\u002Felisymlabs\u002Felisym\u002Fblob\u002Fmain\u002Fpackages\u002Fcli\u002Fskills-examples\u002Fuppercase-proxy\u002FSKILL.md",[],[195,144,200,201,150,151,202,203,204,205,206,176,207,155],"user","back","input","scripts","case","transform","it","script"]