Chuyển đến nội dung
Skillpedia
Agent48k · #3887

azure-ai-language-conversations-py

Skill này làm gì

Công cụ này giúp chương trình máy tính hiểu điều người ta muốn nói trong một cuộc hội thoại. Nó xác định ý định chính và các thông tin quan trọng (thực thể) trong văn bản.

Khi nào nên dùng

  • ✓Khi bạn muốn chatbot hiểu các yêu cầu như “đặt lịch họp”.
  • ✓Khi bạn trích xuất thông tin cụ thể từ tin nhắn, như tên hoặc ngày tháng.
  • ✓Khi bạn xây dựng hệ thống cần diễn giải ngôn ngữ tự nhiên của người dùng.

Liên kết skill

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/azure-ai-language-conversations-py/SKILL.md

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/azure-ai-language-conversations-py/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Phân tích câu này: 'Tôi muốn đặt vé máy bay từ São Paulo đến Rio de Janeiro vào ngày mai.'”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Chương trình gửi văn bản tới một dịch vụ Azure để phân tích. Dịch vụ dùng các mô hình trí tuệ nhân tạo để xác định ý định (ví dụ 'đặt vé máy bay') và các thực thể (ví dụ 'São Paulo', 'Rio de Janeiro', 'ngày mai').

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết 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. Always use the latest 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. It works locally (Azure CLI / VS Code / Developer CLI) and in Azure (managed identity, workload identity) with no code change. Avoid connection strings, account/API keys — they bypass Entra audit and rotation.
    • Local dev: DefaultAzureCredential works as-is.
    • Production: set AZURE_TOKEN_CREDENTIALS=prod (or AZURE_TOKEN_CREDENTIALS=<specific_credential>) to constrain the credential chain to production-safe credentials.
  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.conversations sync clients with azure.ai.language.conversations.aio async 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) or async with ConversationAnalysisClient(...) as client: (async). For async DefaultAzureCredential from azure.identity.aio, also use async with credential: so tokens and transports are cleaned up.
  • Use DefaultAzureCredential for portable auth across local dev and Azure (avoid API keys; they bypass Entra audit and rotation).
  • Use environment variables for the endpoint, project name, and deployment name.
  • Clearly map the participantId and id in the conversationItem payload.

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",

…
Câu hỏi thường gặp

“Intents” và “entities” là gì?

Intents là điều người dùng muốn làm (ví dụ 'gửi email', 'đặt pizza'). Entities là các thông tin quan trọng để hoàn thành ý định đó (ví dụ 'người nhận', 'topping pizza', 'địa chỉ').

Tôi có phải là lập trình viên để dùng công cụ này không?

Công cụ dành cho lập trình viên, nhưng nó đơn giản hóa việc tạo chương trình hiểu ngôn ngữ. Bạn không cần là chuyên gia ngôn ngữ để dùng nó.

Dùng hội thoại của tôi có an toàn không?

Công cụ được thiết kế an toàn. Nó dùng các phương thức xác thực hiện đại, tránh lộ mật khẩu hoặc khóa, giúp bảo vệ dữ liệu của bạn.

Chi tiết

Mô tả gốc của tác giả

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.

repo: sickn33/agentic-awesome-skills

Độ phổ biến

Sao GitHub
48k
Vị trí xếp hạng
#3887
Giấy phép
MIT
Cập nhật
15/10/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự