本文へスキップ
Skillpedia
エージェント48k · #3887

azure-ai-language-conversations-py

できること

このツールは、会話の中で人が何を求めているのかをコンピュータープログラムが理解するのに役立ちます。テキストの中から主な意図(インテント)と、重要な情報(エンティティ)を特定します。

使う場面

  • ✓「会議を予約して」のような依頼をチャットボットに理解させたいとき。
  • ✓名前や日付など、メッセージから特定の情報を抽出したいとき。
  • ✓ユーザーの自然言語を解釈する必要があるシステムを構築するとき。

スキルのリンク

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

コピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。

使い方

いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。

貼り付け用メッセージ

このスキルを使って手伝ってください:https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/azure-ai-language-conversations-py/SKILL.md このリンクのSKILL.mdファイルを読んで、私の作業でその指示に従ってください。
こういうスキルを、AIが自分で見つけてくれたら?無料のSkillpedia MCPをインストール。1行で、作業の前に15,000+のスキルから探してくれます。1分でインストール →

AIへの頼み方の例

“この文章を分析してください:「明日、サンパウロからリオデジャネイロへのフライトを予約したいです。」”

毎週5つの新しいスキル。1分で読めます。

仕組み

プログラムがテキストをAzureのサービスに送信して分析します。このサービスはAIモデルを使い、意図(例:「フライト予約」)とエンティティ(例:「サンパウロ」「リオデジャネイロ」「明日」)を特定します。

技術的な内容(元のSKILL.md)

作者による元のテキスト(英語)をGitHubからそのまま表示しています。

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

…
よくある質問

「インテント」と「エンティティ」とは何ですか?

インテントは、ユーザーがしたいこと(例:「メールを送る」「ピザを注文する」)です。エンティティは、インテントを完了するために必要な重要な情報(例:「送信先」「ピザのトッピング」「住所」)です。

使うにはプログラマーである必要がありますか?

このツールは開発者向けですが、言葉を理解するプログラムの作成を簡単にしてくれます。使うために言語の専門家である必要はありません。

会話の内容を使っても安全ですか?

このツールは安全性を重視して設計されています。パスワードやキーが露出しないような最新の認証方式を使用し、データを保護します。

詳細

作者による元の説明

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

人気

GitHubのスター
48k
ランキング
#3887
ライセンス
MIT
更新日
2026/10/15

このスキルは役に立ちますか?

0

ログイン して投票しましょう。

コメント

  • …

このリポジトリの他のスキル

似ているスキル