편집

다음을 통해 공유


pac copilot

Tools and utilities for copilot management

Commands

Command Description
pac copilot create Creates a new copilot using an existing template file as the reference.
pac copilot extract-template Extracts a template file from an existing copilot in an environment.
pac copilot extract-translation Extracts file containing localized content for one or more bots.
pac copilot list List of copilots in the current or target Dataverse environment.
pac copilot merge-translation Merge files containing localized content for one or more bots.
pac copilot model list AI Builder models in the current environment.
pac copilot model predict Sends text or prompt to AI Model
pac copilot model prepare-fetch Takes the FetchXML file from the AI Large Language Model (LLM) and prepares it for execution against the current environment.
pac copilot publish Publish a Custom Copilot
pac copilot status Poll the deployment status of a specified copilot in the current or target Dataverse environment.

pac copilot create

Creates a new copilot using an existing template file as the reference.

Required Parameters for copilot create

--displayName

The display name of the new copilot

--schemaName

The schema name (unique name) of the new copilot.

--solution -s

Name of the solution.

--templateFileName

Source yaml file containing the copilot template that was extracted using the extract-template command.

Optional Parameters for copilot create

--environment -env

Specifies the target Dataverse. The value may be a Guid or absolute https URL. When not specified, the active organization selected for the current auth profile will be used.

pac copilot extract-template

Extracts a template file from an existing copilot in an environment.

Example

This command extracts a template file from an existing copilot in an environment.

pac copilot extract-template `
   --environment 2e250e7a-5607-4fea-aa4e-1aeb7bf79118 `
   --bot 9ee3f7aa-ab79-4cf6-a726-d85c8c18cc3e `
   --templateFileName NewTestCopilot.yaml

The command returns output like the following for a copilot using the English and German languages:

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

Required Parameters for copilot extract-template

--bot -id

The Copilot ID or schema name (unique name found in Bot Details or file name in solution explorer).

--templateFileName

Location of the yaml file to write the copilot template to.

Optional Parameters for copilot extract-template

--environment -env

Specifies the target Dataverse. The value may be a Guid or absolute https URL. When not specified, the active organization selected for the current auth profile will be used.

--overwrite -o

Allow overwrite of the output data file if it already exists.

This parameter requires no value. It's a switch.

pac copilot extract-translation

Extracts file containing localized content for one or more bots.

Example

This command extracts a file containing localized content for one or more copilots.

pac copilot extract-translation `
   --environment 2e250e7a-5607-4fea-aa4e-1aeb7bf79118 `
   --bot 9ee3f7aa-ab79-4cf6-a726-d85c8c18cc3e `
   --all `
   --outdir . `
   --format json

The command returns output like the following:

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

Optional Parameters for copilot extract-translation

--all -a

Write localization files for all supported languages. By default, only the primary language is written.

This parameter requires no value. It's a switch.

--bot -id

The Copilot ID or schema name (unique name found in Bot Details or file name in solution explorer).

--environment -env

Specifies the target Dataverse. The value may be a Guid or absolute https URL. When not specified, the active organization selected for the current auth profile will be used.

--format

The file format in which to write localized files, either 'resx' or 'json'. The default is 'resx'.

--outdir

The output directory to write to.

--overwrite -o

Allow overwrite of the output data file if it already exists.

This parameter requires no value. It's a switch.

--sourcedir -src

Source solution directory. When specified, will ignore the connected environment when looking for bots and instead look for content in the solution folder.

pac copilot list

List of copilots in the current or target Dataverse environment.

Example

This command lists all copilots in the current or target Dataverse environment.

pac copilot list --environment 2e250e7a-5607-4fea-aa4e-1aeb7bf79118

The command returns output like the following:

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

Optional Parameters for copilot list

--environment -env

Specifies the target Dataverse. The value may be a Guid or absolute https URL. When not specified, the active organization selected for the current auth profile will be used.

pac copilot merge-translation

Merge files containing localized content for one or more bots.

Example

This command merges files containing localized content for one or more copilots.

pac copilot merge-translation `
   --environment 2e250e7a-5607-4fea-aa4e-1aeb7bf79118 `
   --file ms_store_newTestCopilot.de-DE.json `
   --solution SolutionName

The command returns output like the following when updating the German language:

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.

Learn about how to manage errors from the merge-translation command

Optional Parameters for copilot merge-translation

--environment -env

Specifies the target Dataverse. The value may be a Guid or absolute https URL. When not specified, the active organization selected for the current auth profile will be used.

--file -f

The list of files that contain translations. Glob patterns are supported.

--solution -s

Name of the solution.

--sourcedir -src

Source solution directory. When specified, will ignore the connected environment when looking for bots and instead look for content in the solution folder.

--verbose

Output more diagnostic information during data import/export

This parameter requires no value. It's a switch.

--whatif

Does not execute the command, but outputs the details of what would happen.

This parameter requires no value. It's a switch.

merge-translation errors

Based on the example above, if one error exists in the file used to update the copilot, the output looks like:

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.

The --verbose flag adds details about the error:

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 models in the current environment.

Example

This command lists all AI Builder models.

pac copilot model list --environment 2e250e7a-5607-4fea-aa4e-1aeb7bf79118

The command returns output like the following:

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

Optional Parameters for copilot model list

--environment -env

Specifies the target Dataverse. The value may be a Guid or absolute https URL. When not specified, the active organization selected for the current auth profile will be used.

pac copilot model predict

Sends text or prompt to AI Model

Optional Parameters for copilot model predict

--environment -env

Specifies the target Dataverse. The value may be a Guid or absolute https URL. When not specified, the active organization selected for the current auth profile will be used.

--model-id -id

AI Builder model Id

--model-name -n

Full or partial AI Model name

--prompt -p

Prompt to send to AI Model

--text -t

Text to send to AI Model

pac copilot model prepare-fetch

Takes the FetchXML file from the AI Large Language Model (LLM) and prepares it for execution against the current environment.

Required Parameters for copilot model prepare-fetch

--inputFile -i

Input FetchXML file that usually comes from AI LLM.

--outputFile -o

Output FetchXML file that is ready to execute against the current environment.

Optional Parameters for copilot model prepare-fetch

--environment -env

Specifies the target Dataverse. The value may be a Guid or absolute https URL. When not specified, the active organization selected for the current auth profile will be used.

pac copilot publish

Publish a Custom Copilot

Required Parameters for copilot publish

--bot -id

The Copilot ID or schema name (unique name found in Bot Details or file name in solution explorer).

Optional Parameters for copilot publish

--environment -env

Specifies the target Dataverse. The value may be a Guid or absolute https URL. When not specified, the active organization selected for the current auth profile will be used.

pac copilot status

Poll the deployment status of a specified copilot in the current or target Dataverse environment.

Example

This command polls the deployment status of a specified copilot in the current or target Dataverse environment.

pac copilot status `
   --environment 2e250e7a-5607-4fea-aa4e-1aeb7bf79118 `
   --bot-id 9ee3f7aa-ab79-4cf6-a726-d85c8c18cc3e

The command returns output like the following:

Connected as user@contoso.org
Connected to... Contoso Organization
Virtual Agent New Bot German with ID 9ee3f7aa-ab79-4cf6-a726-d85c8c18cc3e has been provisioned.

Required Parameters for copilot status

--bot-id -id

The ID of a copilot (Chatbot).

Optional Parameters for copilot status

--environment -env

Specifies the target Dataverse. The value may be a Guid or absolute https URL. When not specified, the active organization selected for the current auth profile will be used.

See also

Microsoft Power Platform CLI Command Groups
Microsoft Power Platform CLI overview