Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New command: m365 spp model apply #6119

Open
Tracked by #6074
mkm17 opened this issue Jul 4, 2024 · 12 comments · May be fixed by #6453
Open
Tracked by #6074

New command: m365 spp model apply #6119

mkm17 opened this issue Jul 4, 2024 · 12 comments · May be fixed by #6453

Comments

@mkm17
Copy link
Contributor

mkm17 commented Jul 4, 2024

Usage

m365 spp model apply [options]

Description

Applies (or syncs) a trained document understanding model to a document library.

Options

Option Description
-u, --webUrl <webUrl> The URL of the site where the library is located.
-i, --id [id] The unique ID of the model to retrieve. Specify id or title but not both.
-t, --title [title] The display name (case-sensitive) of the model to retrieve. Specify id or title but not both.
--listTitle [listTitle] The title of the library on which to apply the model. Specify either listTitle, listId, or listUrl but not multiple.
--listId [listId] The ID of the library on which to apply the model. Specify either listTitle, listId, or listUrl but not multiple.
--listUrl [listUrl] Server or web-relative URL of the library on which to apply the model. Specify either listTitle, listId, or listUrl but not multiple.
--defaultView Specifies whether to set the new model view as the library default

Examples

Applies a trained document understanding model by id to a document library based on the list title.

m365 spp model apply --webUrl 'https://contoso.sharepoint.com' --id '7645e69d-21fb-4a24-a17a-9bdfa7cb63dc' --listTitle 'Shared Documents'

Applies a trained document understanding model by title to a document library based on the list title.

m365 spp model apply --webUrl 'https://contoso.sharepoint.com' --title 'ModelExample' --listTitle 'Shared Documents'

Applies a trained document understanding model by title to a document library based on the list url.

m365 spp model apply --webUrl 'https://contoso.sharepoint.com' --title 'ModelExample' --listUrl '/Shared Documents'

Applies a trained document understanding model by title to a document library based on the list id.

m365 spp model apply --webUrl 'https://contoso.sharepoint.com' --title 'ModelExample' --listId 'b4cfa0d9-b3d7-49ae-a0f0-f14ffdd005f7'

Additional Info

This endpoint can be used: https://learn.microsoft.com/en-us/sharepoint/dev/apis/syntex/rest-applymodel-method

@Adam-it Adam-it added needs peer review Needs second pair of eyes to review the spec or PR feature request labels Jul 5, 2024
@Adam-it
Copy link
Member

Adam-it commented Jul 5, 2024

@mkm17 awesome work 👏👏 You Rock 🤩

I have a few comments we could consider:

  • why do we specify default properties? Do we expect this command will return some list?
  • what are possible values we may provide to viewOption? if it's only NewViewAsDefault I would suggest we specify this as flag option in our command and then we should specify it like this in spec --viewOption so withouth [viewOption]
  • could we also model by title and specify to use ether title or id
  • lets use id instead of modelUniqueId. First of all since the command is spo stx model apply then the model word does not need to be duplicated in the options. Also id will be more aligned with what is typically used in CLI already
  • libraryUrl I don't quite feel this naming. Usually we use list... but I get it that we should only support libs not lists... hmm usually in such a case we have like folderRelativeUrl or something similar.. but I man sure how to correct this naming here🤔

@pnp/cli-for-microsoft-365-maintainers any other feed? or suggestion on my last point 👆

@mkm17 mkm17 changed the title New command: m365 spo stx model apply New command: m365 spo premium model apply Jul 9, 2024
@mkm17
Copy link
Contributor Author

mkm17 commented Jul 9, 2024

@Adam-it ok, I have removed siteUrl and added folderUrl. It is a similar approach to the file add command. The rest of your comments have been applied.

@Jwaegebaert
Copy link
Contributor

Another great job @mkm17!

I also would suggest removing the default properties. This won't be a list command so it isn't necessary here to specify them.
Regarding --viewOption, I'm not quite sure about the name for this option as it sounds a bit vague compared to the description. Maybe something like --viewDefault or --defaultModel.
I would also opt for --folderUrl, which looks clear enough.

@mkm17
Copy link
Contributor Author

mkm17 commented Jul 10, 2024

@Jwaegebaert what about --newDefaultView as a name of the option?

@milanholemans
Copy link
Contributor

To me folderUrl isn't that clear. It looks like I can specify any folder in a list which isn't the case right?
Why not try to be consistent and use listTitle, listUrl, listId? Even if you can only specify doc libraries, I think we can still use these options?

@Jwaegebaert
Copy link
Contributor

@Jwaegebaert what about --newDefaultView as a name of the option?

I find the new part a bit vague and feel it doesn't add much meaning to what it does, but on the other hand, defaultView seems like a good way to go about it.

Why not try to be consistent and use listTitle, listUrl, listId? Even if you can only specify doc libraries, I think we can still use these options?

It seems like we aren't very consistent yet. Most commands do use this casing, but it's not everywhere just yet. Still, it's a good idea to apply similar naming here too.

@mkm17
Copy link
Contributor Author

mkm17 commented Jul 12, 2024

Ok, I have taken the same approach as in the sensitivitylabel

@mkm17 mkm17 changed the title New command: m365 spo premium model apply New command: m365 spp model apply Jul 16, 2024
@Adam-it
Copy link
Member

Adam-it commented Jul 23, 2024

@mkm17 awesome work. Lets open it up 👍

@Adam-it Adam-it added help wanted and removed needs peer review Needs second pair of eyes to review the spec or PR labels Jul 23, 2024
@mkm17
Copy link
Contributor Author

mkm17 commented Jul 28, 2024

Ok, I can take also this one ;)

@Jwaegebaert
Copy link
Contributor

Hey @mkm17, thank you for all the hard work you’ve put in, it’s really appreciated! We’ve noticed that you have several issues assigned that haven't yet been created with a PR. To ensure everyone has a chance to get involved, especially with Hacktoberfest, I’ll be unassigning you from some of these issues.

We recommend focusing on 1 to 2 issues at a time. Once you’ve submitted a PR for an issue, you can easily claim another open one. This approach helps you manage the workload more effectively and ensures you can give each task the attention it needs.

Thanks again for your continued contributions!

@Jwaegebaert Jwaegebaert added help wanted hacktoberfest Issue perfect for hacktoberfest and removed work in progress labels Sep 26, 2024
@mkm17
Copy link
Contributor Author

mkm17 commented Sep 26, 2024

@Jwaegebaert Omg, time passed so quickly. Yes, definitely let's open it to everyone. Thanks!

@mkm17
Copy link
Contributor Author

mkm17 commented Oct 6, 2024

@Jwaegebaert the same with this one, can I take it?

mkm17 added a commit to mkm17/cli-microsoft365 that referenced this issue Oct 7, 2024
mkm17 added a commit to mkm17/cli-microsoft365 that referenced this issue Oct 28, 2024
mkm17 added a commit to mkm17/cli-microsoft365 that referenced this issue Oct 28, 2024
@mkm17 mkm17 linked a pull request Oct 28, 2024 that will close this issue
mkm17 added a commit to mkm17/cli-microsoft365 that referenced this issue Oct 30, 2024
mkm17 added a commit to mkm17/cli-microsoft365 that referenced this issue Nov 1, 2024
@Adam-it Adam-it removed the hacktoberfest Issue perfect for hacktoberfest label Nov 3, 2024
mkm17 added a commit to mkm17/cli-microsoft365 that referenced this issue Dec 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants