用于 Copilot 管理的工具和实用工具
指令
| Command | Description |
|---|---|
| pac copilot create | 使用现有模板文件作为引用创建新的 copilot。 |
| pac copilot extract-template | 从环境中的现有 copilot 中提取模板文件。 |
| pac copilot extract-translation | 提取包含一个或多个机器人的本地化内容的文件。 |
| pac copilot 列表 | 当前或目标 Dataverse 环境中的 copilot 列表。 |
| pac copilot mcp | 有关本地 MCP(模型上下文协议)服务器的信息。 |
| pac copilot merge-translation | 合并包含一个或多个机器人的本地化内容的文件。 |
| pac copilot 模型列表 | 当前环境中的 AI Builder 模型。 |
| pac copilot 模型预测 | 向 AI 模型发送文本或提示 |
| pac copilot 模型 prepare-fetch | 从 AI 大型语言模型(LLM)获取 FetchXML 文件,并准备针对当前环境执行该文件。 |
| pac copilot 发布 | 发布自定义 Copilot |
| pac copilot 状态 | 在当前或目标 Dataverse 环境中轮询指定 copilot 的部署状态。 |
pac copilot create
使用现有模板文件作为引用创建新的 copilot。
copilot 创建所需的参数
--displayName
新 copilot 的显示名称
--schemaName
新 copilot 的架构名称(唯一名称)。
--solution
-s
解决方案的名称。
--templateFileName
包含使用 extract-template 命令提取的 copilot 模板的源 yaml 文件。
用于 copilot create 的可选参数
--environment
-env
指定目标 Dataverse。 该值可以是 Guid 或绝对 https URL。 如果未指定,将使用为当前身份验证配置文件选择的活动组织。
pac copilot extract-template
从环境中的现有 copilot 中提取模板文件。
Example
此命令从环境中的现有 copilot 中提取模板文件。
pac copilot extract-template `
--environment 2e250e7a-5607-4fea-aa4e-1aeb7bf79118 `
--bot 9ee3f7aa-ab79-4cf6-a726-d85c8c18cc3e `
--templateFileName NewTestCopilot.yaml
该命令使用英语和德语返回类似以下内容的输出:
Connected as user@contoso.org
Loaded 34 components for bot 'New Test Copilot ' with id 9ee3f7aa-ab79-4cf6-a726-d85c8c18cc3e. Primary language: English, supported languages: German
New Test Copilot -> C:\Users\user\NewTestCopilot.yaml
copilot extract-template 的必需参数
--bot
-id
Copilot ID 或架构名称(在机器人详细信息中找到的唯一名称或解决方案资源管理器中的文件名)。
--templateFileName
要向其写入 copil 模板的 yaml 文件的位置。
copilot extract-template 的可选参数
--environment
-env
指定目标 Dataverse。 该值可以是 Guid 或绝对 https URL。 如果未指定,将使用为当前身份验证配置文件选择的活动组织。
--overwrite
-o
如果输出数据文件已存在,则允许覆盖输出数据文件。
此参数不需要任何值。 这是一个开关。
--templateName
如果未指定名称,则模板名称或“kickStartTemplate”。
--templateVersion
如果未指定版本,则为 X.X.X 格式的模板版本或 1.0.0。
pac copilot extract-translation
提取包含一个或多个机器人的本地化内容的文件。
Example
此命令提取一个文件,其中包含一个或多个 copilot 的本地化内容。
pac copilot extract-translation `
--environment 2e250e7a-5607-4fea-aa4e-1aeb7bf79118 `
--bot 9ee3f7aa-ab79-4cf6-a726-d85c8c18cc3e `
--all `
--outdir . `
--format json
该命令返回如下所示的输出:
Connected as user@contoso.org
Loaded 32 components for bot 'New Test Copilot' with id 9ee3f7aa-ab79-4cf6-a726-d85c8c18cc3e. Primary language: English, supported languages: German
copilot extract-translation 的可选参数
--all
-a
为所有支持的语言编写本地化文件。 默认情况下,仅编写主要语言。
此参数不需要任何值。 这是一个开关。
--bot
-id
Copilot ID 或架构名称(在机器人详细信息中找到的唯一名称或解决方案资源管理器中的文件名)。
--environment
-env
指定目标 Dataverse。 该值可以是 Guid 或绝对 https URL。 如果未指定,将使用为当前身份验证配置文件选择的活动组织。
--format
要在其中写入本地化文件的文件格式,即“resx”或“json”。 默认值为“resx”。
--outdir
要写入的输出目录。
--overwrite
-o
如果输出数据文件已存在,则允许覆盖输出数据文件。
此参数不需要任何值。 这是一个开关。
--sourcedir
-src
源解决方案目录。 指定后,将在查找机器人时忽略连接的环境,而是在解决方案文件夹中查找内容。
pac copilot 列表
当前或目标 Dataverse 环境中的 copilot 列表。
Example
此命令列出当前或目标 Dataverse 环境中的所有 copilot。
pac copilot list --environment 2e250e7a-5607-4fea-aa4e-1aeb7bf79118
该命令返回如下所示的输出:
Name Bot ID Component State Is Managed Solution ID Status Code State Code
Ask Me Anything Copilot 584e012c-dc95-46d6-af5a-1263b6a44342 Published Unmanaged 285af946-6383-49a0-8615-4e2afafeaf38 Active Provisioned
New Test Copilot 9ee3f7aa-ab79-4cf6-a726-d85c8c18cc3e Published Unmanaged 285af946-6383-49a0-8615-4e2afafeaf38 Active Provisioned
copilot 列表的可选参数
--environment
-env
指定目标 Dataverse。 该值可以是 Guid 或绝对 https URL。 如果未指定,将使用为当前身份验证配置文件选择的活动组织。
pac copilot mcp
有关本地 MCP(模型上下文协议)服务器的信息。
pac copilot merge-translation
合并包含一个或多个机器人的本地化内容的文件。
Example
此命令合并包含一个或多个 copilot 的本地化内容的文件。
pac copilot merge-translation `
--environment 2e250e7a-5607-4fea-aa4e-1aeb7bf79118 `
--file ms_store_newTestCopilot.de-DE.json `
--solution SolutionName
更新德语时,此命令将返回如下所示的输出:
Connected as user@contoso.org
Loading language German into bot 'ms_store_newTestCopilot' (New Test Copilot) from file 'C:\Users\user\ms_store_newTestCopilot'. 0 key(s) were missing, 0 value(s) were not used. Use the --verbose switch to get more details.
Updated 16 out of 16 components.
copilot 合并转换的可选参数
--environment
-env
指定目标 Dataverse。 该值可以是 Guid 或绝对 https URL。 如果未指定,将使用为当前身份验证配置文件选择的活动组织。
--file
-f
包含翻译的文件列表。 支持 Glob 模式。
--solution
-s
解决方案的名称。
--sourcedir
-src
源解决方案目录。 指定后,将在查找机器人时忽略连接的环境,而是在解决方案文件夹中查找内容。
--verbose
在数据导入/导出过程中输出更多诊断信息
此参数不需要任何值。 这是一个开关。
--whatif
不执行命令,但输出所发生情况的详细信息。
此参数不需要任何值。 这是一个开关。
合并转换错误
根据上面的示例,如果在用于更新 copilot 的文件中存在一个错误,则输出如下所示:
Connected as user@contoso.org
Loading language German into bot 'ms_store_newTestCopilot' (New Test Copilot) from file 'C:\Users\user\ms_store_newTestCopilot'. 1 key(s) were missing, 1 value(s) were not used. Use the --verbose switch to get more details.
Updated 16 out of 16 components.
该 --verbose 标志将添加有关错误的详细信息:
Connected as user@contoso.org
Missing translation key: 'dialog(ms_store_newTestCopilot.topic.Lesson2)'.'trigger(main)'.'action(LbWwpD)'.Entity.Definition.'closedListItem(Redmond)'.DisplayName.
Unused translation: 'dialog(ms_store_newTestCopilot.topic.Lesson2)'.'trigger(main)'.'action(LbWwpD)'.Entity.Definition.'closedListItem(Redmont)'.DisplayName, value: Redmond
Loading language German into bot 'ms_store_newTestCopilot' (New Test Copilot) from file 'C:\Users\user\ms_store_newTestCopilot'. 1 key(s) were missing, 1 value(s) were not used. Use the --verbose switch to get more details.
Updated 16 out of 16 components.
pac copilot 模型列表
当前环境中的 AI Builder 模型。
Example
此命令列出所有 AI Builder 模型。
pac copilot model list --environment 2e250e7a-5607-4fea-aa4e-1aeb7bf79118
该命令返回如下所示的输出:
Id State Name
32a9e265-1149-4155-af54-d2856d2b83f5 Active Document Processing 2023/09/20, 12:21:40
2bcd7b94-50bc-4767-af4a-367c63fb5487 Inactive AI Classify
4e72b59a-17d6-451e-8657-89fbdec56d7a Inactive AI Extract
572f57a7-7a8f-49fc-adb4-331e02c509a6 Inactive AI Reply
b9b636cf-9748-47a7-b617-6df5f00f5151 Inactive AI Sentiment
c076eac8-f218-4feb-8ad1-7ee4fb039419 Inactive AI Summarize
a0440df3-2656-e911-8194-000d3a6cd5a5 Inactive BusinessCard model
62d1e848-5ca7-490a-94bf-79baabe85ef4 Inactive CategoryClassification model
4da7ec17-5c26-4fd2-9ddb-be4f7eda21a9 Inactive DataGenieEmailAddressValidation
51f4da11-5702-401d-b53a-9638744e8ac9 Inactive Document Layout Analysis Model
d1bb8d57-24ab-3b36-9592-bd792e153b79 Inactive DVCopilotQueryModel
3fbd4e5c-32bc-40fc-acce-59c2821cf113 Inactive Empty Dynamic Prompt
8c281981-c5d6-484f-bac7-4924ddd0b8ae Inactive EntityExtraction model
a1afa5d4-7a44-4c31-9cd2-e852a78431fa Inactive GptPromptEngineering model
2c444168-f8b1-4c6a-9313-2d9c03be6fea Inactive Id Scanning Model
77365cfa-7021-4cb7-a9b2-dc9823cde772 Inactive ImageDescription model
aef1bdd2-2a74-4f74-b4eb-9dfa22e35ded Inactive Invoice Model
5ed4d0fd-e9d4-4026-b09b-71f83ea90c60 Inactive Invoice Processing Model
c8425db7-c5a7-4226-b38e-c93a044c0fe1 Inactive KeyPhraseExtraction model
17a6f893-5b0b-4867-8fac-fb2eda9080b2 Inactive LanguageDetection model
046ab801-2756-e911-8194-000d3a6cd5a5 Inactive ObjectDetectionProposal model
892d3698-ba03-3d15-8e9e-843ca4ac5e7d Inactive PowerAppsAppCopilotModel
baa44529-bebe-49e6-837a-80bee63b0d2c Inactive Receipt Scanning Model
f1c549c2-a97e-47a5-b612-c5c2bab0f163 Inactive SentimentAnalysis model
7f8a7856-003a-3662-9871-0000d7674433 Inactive SimsModel
86419a67-205a-454f-b6fc-601394f2786d Inactive TextRecognition model
6225038a-8b5a-4913-bfd2-d8236f4102ba Inactive TextTranslation model
02e1fca3-232a-4f58-8c93-bdd8c9cd6de9 Inactive TextTranslationInternal model
copilot 模型列表的可选参数
--environment
-env
指定目标 Dataverse。 该值可以是 Guid 或绝对 https URL。 如果未指定,将使用为当前身份验证配置文件选择的活动组织。
pac copilot 模型预测
向 AI 模型发送文本或提示
copilot 模型预测的可选参数
--environment
-env
指定目标 Dataverse。 该值可以是 Guid 或绝对 https URL。 如果未指定,将使用为当前身份验证配置文件选择的活动组织。
--model-id
-id
AI Builder 模型 ID
--model-name
-n
完整或部分 AI 模型名称
--prompt
-p
提示发送到 AI 模型
--text
-t
要发送到 AI 模型的文本
pac copilot 模型 prepare-fetch
从 AI 大型语言模型(LLM)获取 FetchXML 文件,并准备针对当前环境执行该文件。
copilot 模型 prepare-fetch 所需的参数
--inputFile
-i
通常来自 AI LLM 的输入 FetchXML 文件。
--outputFile
-o
输出准备针对当前环境执行的 FetchXML 文件。
copilot 模型 prepare-fetch 的可选参数
--environment
-env
指定目标 Dataverse。 该值可以是 Guid 或绝对 https URL。 如果未指定,将使用为当前身份验证配置文件选择的活动组织。
pac copilot 发布
发布自定义 Copilot
copilot 发布所需的参数
--bot
-id
Copilot ID 或架构名称(在机器人详细信息中找到的唯一名称或解决方案资源管理器中的文件名)。
copilot 发布的可选参数
--environment
-env
指定目标 Dataverse。 该值可以是 Guid 或绝对 https URL。 如果未指定,将使用为当前身份验证配置文件选择的活动组织。
pac copilot 状态
在当前或目标 Dataverse 环境中轮询指定 copilot 的部署状态。
Example
此命令轮询当前或目标 Dataverse 环境中的指定 copilot 的部署状态。
pac copilot status `
--environment 2e250e7a-5607-4fea-aa4e-1aeb7bf79118 `
--bot-id 9ee3f7aa-ab79-4cf6-a726-d85c8c18cc3e
该命令返回如下所示的输出:
Connected as user@contoso.org
Connected to... Contoso Organization
Virtual Agent New Bot German with ID 9ee3f7aa-ab79-4cf6-a726-d85c8c18cc3e has been provisioned.
copilot 状态的必需参数
--bot-id
-id
copilot (Chatbot) 的 ID。
copilot 状态的可选参数
--environment
-env
指定目标 Dataverse。 该值可以是 Guid 或绝对 https URL。 如果未指定,将使用为当前身份验证配置文件选择的活动组织。
另请参阅
Microsoft Power Platform CLI 命令组
Microsoft Power Platform CLI 概述