azure-ai-language-conversations-py – skill DevOps & Hạ tầng cho agent AI
Triển khai Conversational Language Understanding (CLU) bằng SDK azure-ai-language-conversations cho Python. Dùng khi làm việc với ConversationAnalysisClient để phân tích ý định và thực thể trong hội thoại, xây dựng tính năng NLP, hoặc tích hợp hiểu ngôn ngữ vào ứng dụng.
Cài skill azure-ai-language-conversations-py bằng một lệnh
Chọn công cụ bạn đang dùng, copy lệnh và dán vào terminal. Skill sẽ nằm trong thư mục skills của công cụ đó và sẵn sàng dùng ở phiên làm việc tiếp theo.
Claude Code
mkdir -p ~/.claude/skills && curl -fsSL https://skill.dn1nguoi.com/z/azure-ai-language-conversations-py-57505.tgz | tar xz -C ~/.claude/skills
Gọi trong Claude Code: /azure-ai-language-conversations-py – rồi mô tả công việc bạn muốn làm.
Codex
mkdir -p ~/.codex/skills && curl -fsSL https://skill.dn1nguoi.com/z/azure-ai-language-conversations-py-57505.tgz | tar xz -C ~/.codex/skills
Gọi trong Codex: $azure-ai-language-conversations-py – rồi mô tả công việc bạn muốn làm.
Hermes Agent
mkdir -p ~/.hermes/skills && curl -fsSL https://skill.dn1nguoi.com/z/azure-ai-language-conversations-py-57505.tgz | tar xz -C ~/.hermes/skills
Gọi trong Hermes Agent: /azure-ai-language-conversations-py – rồi mô tả công việc bạn muốn làm.
DeepSeek
mkdir -p ~/.deepcode/skills && curl -fsSL https://skill.dn1nguoi.com/z/azure-ai-language-conversations-py-57505.tgz | tar xz -C ~/.deepcode/skills
Gọi trong DeepSeek: /azure-ai-language-conversations-py – rồi mô tả công việc bạn muốn làm.
Nội dung SKILL.md
Nội dung SKILL.md gốc bằng tiếng Anh.
Azure AI Language Conversations for Python
When to Use
Use this skill when you need implement Conversational Language Understanding (CLU) using the azure-ai-language-conversations Python SDK. Use when working with ConversationAnalysisClient to analyze conversation intent and entities, building NLP features, or integrating language understanding into applications.
System Prompt
You are an expert Python developer specializing in Azure AI Services and Natural Language Processing.
Your task is to help users implement Conversational Language Understanding (CLU) using the azure-ai-language-conversations SDK.
When responding to requests about Azure AI Language Conversations:
1. Select and pin a supported, tested version of the azure-ai-language-conversations SDK.
2. Emphasize the use of ConversationAnalysisClient with DefaultAzureCredential.
3. Provide clear code examples demonstrating how to structure the conversation payload.
4. Handle exceptions properly.
Authentication & Lifecycle
> 🔑 Two rules apply to every code sample below:
>
> 1. Prefer DefaultAzureCredential. Configure the intended credential and least-privilege data-plane roles for the target resource. API keys are supported where enabled; they require secret storage and rotation and do not provide per-user Entra identity.
> - Local dev: sign in using an enabled developer credential and verify the selected tenant/account.
> - Production: set AZURE_TOKEN_CREDENTIALS=prod (or AZURE_TOKEN_CREDENTIALS=<specific_credential>) only with an azure-identity version supporting that setting; otherwise use an explicit managed/workload identity credential.
> 2. Wrap every client in a context manager so HTTP transports, sockets, and token caches are released deterministically:
> - Sync: with <Client>(...) as client:
> - Async: async with <Client>(...) as client: and async with DefaultAzureCredential() as credential: (from azure.identity.aio)
>
> Snippets may abbreviate this setup, but production code should always follow both rules.
ConversationAnalysisClient accepts a TokenCredential such as DefaultAzureCredential. Use the token credential — it works locally (Azure CLI / VS Code / Developer CLI) and in Azure (managed identity, workload identity) with no code change.
Legacy: API Key (existing keyed deployments)
New code should use DefaultAzureCredential. Use AzureKeyCredential only if you have an existing keyed deployment that hasn't been migrated to Entra ID yet — for example, regulated environments still completing their Entra rollout.
import os
from azure.core.credentials import AzureKeyCredential
from azure.ai.language.conversations import ConversationAnalysisClient
endpoint = os.environ["AZURE_CONVERSATIONS_ENDPOINT"]
key = os.environ["AZURE_CONVERSATIONS_KEY"]
with ConversationAnalysisClient(endpoint, AzureKeyCredential(key)) as client:
# See "Basic Conversation Analysis" below for the analyze_conversation payload
...Best Practices
- Pick sync OR async and stay consistent. Do not mix
azure.ai.language.conversationssync clients withazure.ai.language.conversations.aioasync clients in the same call path. Choose one mode per module. - Always use context managers for clients and async credentials. Wrap every client in
with ConversationAnalysisClient(...) as client:(sync) orasync with ConversationAnalysisClient(...) as client:(async). For asyncDefaultAzureCredentialfromazure.identity.aio, also useasync with credential:so tokens and transports are cleaned up. - Use
DefaultAzureCredentialfor portable auth across local dev and Azure with the correct tenant, identity and roles; store and rotate supported API keys when needed. - Use environment variables for the endpoint, project name, and deployment name.
- Clearly map the
participantIdandidin theconversationItempayload.
Examples
Basic Conversation Analysis
import os
from azure.identity import DefaultAzureCredential
from azure.ai.language.conversations import ConversationAnalysisClient
endpoint = os.environ["AZURE_CONVERSATIONS_ENDPOINT"]
project_name = os.environ["AZURE_CONVERSATIONS_PROJECT"]
deployment_name = os.environ["AZURE_CONVERSATIONS_DEPLOYMENT"]
# DefaultAzureCredential works locally and in Azure with no code change.
credential = DefaultAzureCredential()
with ConversationAnalysisClient(endpoint, credential) as client:
query = "Send an email to Carol about the tomorrow's meeting"
result = client.analyze_conversation(
task={
"kind": "Conversation",
"analysisInput": {
"conversationItem": {
"participantId": "1",
"id": "1",
"modality": "text",
"language": "en",
"text": query
},
"isLoggingEnabled": False
},
"parameters": {
"projectName": project_name,
"deploymentName": deployment_name,
"verbose": True
}
}
)
print(f"Top intent: {result['result']['prediction']['topIntent']}")
credential.close()Obtain permission to send conversation text to Azure. Minimize personal data and set appropriate retention/logging controls; isLoggingEnabled=False is not a complete privacy guarantee. Intent predictions are probabilistic and must not directly authorize sensitive actions.
Limitations
- Use this skill only when the task clearly matches its upstream source and local project context.
- Verify commands, generated code, dependencies, credentials, and external service behavior before applying changes.
- Do not treat examples as a substitute for environment-specific tests, security review, or user approval for destructive or costly actions.
Skill liên quan
- istio-traffic-management – Cấu hình quản lý lưu lượng Istio gồm định tuyến, cân bằng tải, circuit breaker và triển…
- azure-ai-openai-dotnet – SDK Azure OpenAI cho .NET. Thư viện client cho Azure OpenAI và dịch vụ OpenAI. Dùng cho…
- azure-ai-projects-dotnet – SDK Azure AI Projects cho .NET. Client cấp cao cho dự án Azure AI Foundry gồm agent…
- azure-ai-projects-py – Xây dựng ứng dụng AI trên Microsoft Foundry bằng SDK azure-ai-projects.
- azure-ai-projects-ts – SDK cấp cao cho dự án Azure AI Foundry, bao gồm agents, connections, deployments và…
- azure-ai-textanalytics-py – SDK Azure AI Text Analytics để phân tích cảm xúc, nhận diện thực thể, cụm từ khóa, nhận…
- azure-ai-transcription-py – SDK Azure AI Transcription cho Python. Dùng để chuyển file âm thanh thành văn bản kèm…
- k8s-manifest-generator – Tạo manifest Kubernetes sẵn sàng cho production cho Deployments, Services, ConfigMaps và…