共用方式為


pac copilot

副手管理的工具和公用程式

Commands

Command Description
pac copilot create 使用現有的範本檔案作為參考建立新的副手。
pac copilot extract-template 從環境中的現有副手擷取範本檔案。
pac copilot extract-translation 擷取包含一或多個機器人的當地語系化內容的檔案。
pac copilot list 目前或目標 Dataverse 環境中的副手清單。
pac copilot mcp 有關本地 MCP(模型上下文協議)服務器的信息。
pac copilot merge-translation 合併包含一或多個機器人的當地語系化內容的檔案。
pac copilot model list AI Builder 模型。
pac copilot model predict 向 AI 模型發送文本或提示
pac copilot model prepare-fetch 從 AI 大型語言模型 (LLM) 取得 FetchXML 檔案,並準備針對目前環境執行。
pac copilot publish 發佈自訂 Copilot
pac copilot status 輪詢目前或目標 Dataverse 環境中指定副手的部署狀態。

pac copilot create

使用現有的範本檔案作為參考建立新的副手。

所需參數 copilot create

--displayName

新副手的顯示名稱

--schemaName

新副手的結構描述名稱 (唯一名稱)。

--solution -s

方案的名稱。

--templateFileName

來源 yaml 檔案,其中包含使用 extract-template 命令擷取的副手範本。

可選參數 copilot create

--environment -env

指定目標 Dataverse。 值可以是 Guid 或絕對 https URL。 如果未指定,則會使用為目前驗證設定檔選取的作用中組織。

pac copilot extract-template

從環境中的現有副手擷取範本檔案。

Example

此命令會從環境中的現有副手擷取範本檔案。

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 或結構描述名稱 (在 Bot 詳細資料中找到的唯一名稱或解決方案總管中的檔案名稱)。

--templateFileName

要寫入副手範本的 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

此命令會擷取包含一或多個副手的當地語系化內容的檔案。

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 或結構描述名稱 (在 Bot 詳細資料中找到的唯一名稱或解決方案總管中的檔案名稱)。

--environment -env

指定目標 Dataverse。 值可以是 Guid 或絕對 https URL。 如果未指定,則會使用為目前驗證設定檔選取的作用中組織。

--format

寫入當地語系化檔案的檔案格式,'resx' 或 'json'。 預設值為 'resx'。

--outdir

要寫入的輸出目錄。

--overwrite -o

如果輸出資料檔案已存在,則允許覆寫輸出資料檔案。

此參數不需要任何值。 這是一個開關。

--sourcedir -src

來源解決方案目錄。 指定時,會在尋找機器人時忽略連線的環境,而是在解決方案資料夾中尋找內容。

pac copilot list

目前或目標 Dataverse 環境中的副手清單。

Example

此命令會列出目前或目標 Dataverse 環境中的所有副手。

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 list

--environment -env

指定目標 Dataverse。 值可以是 Guid 或絕對 https URL。 如果未指定,則會使用為目前驗證設定檔選取的作用中組織。

pac copilot mcp

有關本地 MCP(模型上下文協議)服務器的信息。

Example

pac copilot mcp --run

可選參數 copilot mcp

--run -r

執行本地的 MCP(模型情境協定)伺服器。

此參數不需要任何值。 這是一個開關。

備註

學習如何使用內建 MCP 伺服器的 Power Platform CLI

pac copilot merge-translation

合併包含一或多個機器人的當地語系化內容的檔案。

Example

此命令會合併包含一或多個副手的當地語系化內容的檔案。

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.

瞭解如何從 merge-translation 指令管理錯誤

可選參數 copilot merge-translation

--environment -env

指定目標 Dataverse。 值可以是 Guid 或絕對 https URL。 如果未指定,則會使用為目前驗證設定檔選取的作用中組織。

--file -f

包含翻譯的檔案清單。 支援 Glob 模式。

--solution -s

方案的名稱。

--sourcedir -src

來源解決方案目錄。 指定時,會在尋找機器人時忽略連線的環境,而是在解決方案資料夾中尋找內容。

--verbose

在資料匯入/匯出期間輸出更多診斷資訊

此參數不需要任何值。 這是一個開關。

--whatif

不執行命令,但輸出將發生的情況的詳細資訊。

此參數不需要任何值。 這是一個開關。

合併翻譯錯誤

根據上述範例,如果用來更新副手的檔案中存在一個錯誤,則輸出如下所示:

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 model list

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 model list

--environment -env

指定目標 Dataverse。 值可以是 Guid 或絕對 https URL。 如果未指定,則會使用為目前驗證設定檔選取的作用中組織。

pac copilot model predict

向 AI 模型發送文本或提示

可選參數 copilot model predict

--environment -env

指定目標 Dataverse。 值可以是 Guid 或絕對 https URL。 如果未指定,則會使用為目前驗證設定檔選取的作用中組織。

--model-id -id

AI Builder 模型識別碼

--model-name -n

完整或部分 AI 模型名稱

--prompt -p

提示傳送至 AI 模型

--text -t

要傳送至 AI 模型的文字

pac copilot model prepare-fetch

從 AI 大型語言模型 (LLM) 取得 FetchXML 檔案,並準備針對目前環境執行。

所需參數 copilot model prepare-fetch

--inputFile -i

輸入通常來自 AI LLM 的 FetchXML 檔案。

--outputFile -o

輸出 FetchXML 檔案,可針對目前環境執行。

可選參數 copilot model prepare-fetch

--environment -env

指定目標 Dataverse。 值可以是 Guid 或絕對 https URL。 如果未指定,則會使用為目前驗證設定檔選取的作用中組織。

pac copilot publish

發佈自訂 Copilot

所需參數 copilot publish

--bot -id

Copilot ID 或結構描述名稱 (在 Bot 詳細資料中找到的唯一名稱或解決方案總管中的檔案名稱)。

可選參數 copilot publish

--environment -env

指定目標 Dataverse。 值可以是 Guid 或絕對 https URL。 如果未指定,則會使用為目前驗證設定檔選取的作用中組織。

pac copilot status

輪詢目前或目標 Dataverse 環境中指定副手的部署狀態。

Example

此命令會輪詢目前或目標 Dataverse 環境中指定副手的部署狀態。

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 status

--bot-id -id

副手 (聊天機器人) 的 ID。

可選參數 copilot status

--environment -env

指定目標 Dataverse。 值可以是 Guid 或絕對 https URL。 如果未指定,則會使用為目前驗證設定檔選取的作用中組織。

另請參閱

Microsoft Power Platform CLI 命令群組
Microsoft Power Platform CLI 概觀