microsoft/skills

azure-ai-language-conversations-py

用 CLU 从对话文本识别意图与实体

  • SKILL.md 已保存
  • 中文用法已整理
  • 安装与运行未实测
先判断是否解决你的问题

azure-ai-language-conversations-py 是什么?

此 Skill 说明如何用 azure-ai-language-conversations 的 ConversationAnalysisClient,将一段对话文本发送到已训练、已部署的 CLU 项目并读取意图预测。它不是通用聊天生成模型,也不负责自动创建训练项目。

中文说明由本站依据来源整理;英文原文保留在页面下方。

按客户端选择安装入口

怎么接入你的 Agent?

  1. 定位完整 Skill 目录

    打开本项目来源,核对 SKILL.md 及其引用的脚本和资料。

  2. 交给你正在用的 Agent

    在下面选择客户端,展开并复制安装指令,让 Agent 读取来源后选择安装方式。

  3. 确认识别,再做具体任务

    让 Agent 回报安装目录和识别到的名称 azure-ai-language-conversations-py,然后按本页使用示例提供材料。

展开并复制给 Codex 的安装指令
发送给 Codex

安装并检查 azure-ai-language-conversations-py

请在 Codex 的当前工作环境中安装并检查 azure-ai-language-conversations-py 这个 Skill。

项目身份:microsoft/skills / azure-ai-language-conversations-py
来源:https://github.com/microsoft/skills/blob/f03ec5392f7a0f3aca12af47477e92f1edf7b44c/.github/plugins/azure-sdk-python/skills/azure-ai-language-conversations-py/SKILL.md
已定位的源文件:.github/plugins/azure-sdk-python/skills/azure-ai-language-conversations-py/SKILL.md

1. 先阅读真实 SKILL.md 和它引用的必要文件,确认触发条件、安装方式、依赖与权限;尊重源文件要求的审批步骤。
2. 按当前客户端支持的方式安装完整 Skill 目录,保留已有配置,不只复制一段提示词。涉及缺失凭证、目标目录或权限时先列出缺项并向我确认。
3. 安装后回读实际目录、Skill 名称和识别结果,说明哪些步骤已完成,哪些只是文档检查,不得把安装成功当作任务已经实测。
4. 如来源提供了可安全验证的示例,在我提供所需输入后做一个最小任务;创建、修改、删除、部署或发送内容前,按源文件和我的授权执行。
准备输入,再按步骤执行

装好以后,具体怎么用?

准备哪些材料

  • 安装 Python SDK 并配置 AZURE_CONVERSATIONS_ENDPOINT、AZURE_CONVERSATIONS_PROJECT、AZURE_CONVERSATIONS_DEPLOYMENT。
  • CLU 项目须事先有训练好的项目和部署名称,调用身份须具备访问权限。
  • 明确 participantId、conversationItem id、modality、language 等输入字段与业务语言。

实际使用顺序

  1. 用 DefaultAzureCredential 初始化 client,并用 with 管理资源;旧密钥模式仅用于现有密钥部署。
  2. 按源文 conversation task 结构传 conversationItem、projectName、deploymentName;isLoggingEnabled 应按数据处理要求配置。
  3. 从 result.result.prediction 读取 topIntent,并按你的流程解析意图和实体;未命中或低置信时安排澄清/兜底。
  4. 捕获 SDK/service 异常,区分无预测、权限、部署名和请求格式问题。
使用示例

从一个具体任务开始

本站根据源文件编写的使用示例,未在本站实际运行。示例中的文件由你提供。

安装并识别 Skill 后发送

复制一个具体任务

请使用此 Skill 为我的 Python 服务设计一个 CLU 分类函数:输入一条中文文本,显式传项目/部署配置,返回 topIntent 和各意图分值;如果中文模型或部署是否支持无法从项目资料确认,请标出待核验项。先给代码草案,不调用服务。
预期结果

得到请求结构与结果映射方案;不会凭空产生意图模型或部署。

使用前先看这些限制

使用条件与边界

  • CLU 输出依赖已训练并部署的项目,安装 SDK 不能替你生成领域意图模型。
  • 源文主要示例是英文句子;能否准确分析中文取决于项目训练语料、语言设置和服务支持情况。
  • topIntent 是分类预测,不是自然语言生成的回答。
针对这个 Skill 的疑问

常见问题

部署名称是什么?

它是 Language 项目中已发布模型的 deployment 名称,不是 SDK 包名或资源名称。

输入文本后为什么没有意图?

核对项目与部署参数、训练标签覆盖、语言配置和响应 prediction;模型不会为未训练的业务意图自动创建分类。

需要核对时再展开原文

来源原文与资料状态

源文件
已保存 SKILL.md,抓取于 2026-11-16T12:36:35.145Z
中文使用说明
已针对下方源文件版本整理用途、用法和常见问题
安装与任务测试
本站未执行安装或任务测试
来源复核
本页中文用法已对照保存版本的完整 SKILL.md 阅读整理
展开 SKILL.md 原文、章节与历史收录资料

.github/plugins/azure-sdk-python/skills/azure-ai-language-conversations-py/SKILL.md · 抓取时间 2026-11-16T12:36:35.145Z

以下保留源文件的 description、章节及摘录,供核对中文说明;完整文件通过上方链接打开。

抓取成功不代表已完成安装或任务测试。

来源 description(原文)

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.

查看源文件章节 / Source sections
  • 原文:Azure AI Language Conversations for Python
  • 原文:System Prompt
  • 原文:Authentication & Lifecycle
  • 原文:Legacy: API Key (existing keyed deployments)
  • 原文:Best Practices
  • 示例 / Examples
  • 原文:Basic Conversation Analysis
  • 原文:Reference Files
原文: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. ```python 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.

原文:Basic Conversation Analysis

```python 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']}") ```

原文:Reference Files

| File | Contents | |------|----------| | [references/capabilities.md](references/capabilities.md) | Additional non-hero capabilities, operation-group coverage, and production checklists. | | [references/non-hero-scenarios.md](references/non-hero-scenarios.md) | Dedicated non-hero examples for secondary/advanced scenarios. |

文件 SHA256:4b51c68f15f6155f4621be975bdbb9f41ce79097c9a7cd1784669d8f87cae665

仓库许可证记录:MIT;skill-declaration-captured-not-interpreted,查看来源。

SKILL.md原文description · 2026-11-16T12:36:35.145Z

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.

查看历史简介来源

历史收录数据

来源仓库microsoft/skills
Skill源路径.github/plugins/azure-sdk-python/skills/azure-ai-language-conversations-py/SKILL.md

安装前请让使用的Agent先读取这个SKILL.md及其所在目录,确认依赖和所需权限。此页不生成未经来源验证的安装命令。

返回 Skills 目录,按任务继续筛选 · MCP与Skills教程与资源