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

feat(modelarmor): created samples for model armor #13187

Open
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

mihirvala-crestdata
Copy link

@mihirvala-crestdata mihirvala-crestdata commented Feb 25, 2025

Description

Added more Model Armor code samples for following use cases:

Quickstart

Create a template and sanitize user prompt and model response using it.

Floor Settings

Get Floor Settings of given Folder, Organization & Project
Update Floor Settings of given Folder, Organization & Project
Disable Floor Settings of given Folder, Organization & Project


Template CRUD

Create a template with labels
Create Template with template metadata
Create a template with Basic Sensitive Data Protection configuration
Create a template with Advanced Sensitive Data Protection configuration

List all available templates in given project and location
List all available templates with filter in given project and location
 
View template with given template_id
 
Update template configuration for given template_id
Update template with Mask Configuration
Update template metadata
Update labels of a template
 
Delete template with given template_id


User Prompt Sanitization

Sanitize the user prompt based on the given template configuration
Scan a PDF file based on the given template configuration


Model Response Sanitization

Sanitize the model response based on the given template configuration
Sanitize the model response along with user prompt


Checklist

@mihirvala-crestdata mihirvala-crestdata requested review from a team as code owners February 25, 2025 18:12
@product-auto-label product-auto-label bot added the samples Issues that are directly related to samples. label Feb 25, 2025
Copy link

snippet-bot bot commented Feb 25, 2025

Here is the summary of changes.

You are about to add 24 region tags.
You are about to delete 6 region tags.

This comment is generated by snippet-bot.
If you find problems with this result, please file an issue at:
https://github.com/googleapis/repo-automation-bots/issues.
To update this comment, add snippet-bot:force-run label or use the checkbox below:

  • Refresh this comment

@vipul7499 vipul7499 added kokoro:force-run Add this label to force Kokoro to re-run the tests. kokoro:run Add this label to force Kokoro to re-run the tests. labels Feb 27, 2025
@kokoro-team kokoro-team removed kokoro:run Add this label to force Kokoro to re-run the tests. kokoro:force-run Add this label to force Kokoro to re-run the tests. labels Feb 27, 2025
@vipul7499 vipul7499 added kokoro:force-run Add this label to force Kokoro to re-run the tests. kokoro:run Add this label to force Kokoro to re-run the tests. labels Feb 28, 2025
@kokoro-team kokoro-team removed kokoro:run Add this label to force Kokoro to re-run the tests. kokoro:force-run Add this label to force Kokoro to re-run the tests. labels Feb 28, 2025
@vipul7499 vipul7499 added kokoro:force-run Add this label to force Kokoro to re-run the tests. kokoro:run Add this label to force Kokoro to re-run the tests. labels Feb 28, 2025
@kokoro-team kokoro-team removed kokoro:run Add this label to force Kokoro to re-run the tests. kokoro:force-run Add this label to force Kokoro to re-run the tests. labels Feb 28, 2025
@glasnt glasnt added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Mar 6, 2025
@kokoro-team kokoro-team removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Mar 6, 2025
@glasnt glasnt requested a review from a team March 7, 2025 04:41
Copy link
Contributor

@glasnt glasnt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved from the "tests pass and follows styleguide" standpoint. Team added to repo, so CODEOWNERS is now valid.

However, this needs subject matter expert approval (from @GoogleCloudPlatform/cloud-modelarmor-team who I have manually assigned to this PR, since this PR adds the automation that would assign them automatically)

Do not merge until subject matter approval has been done.

@glasnt glasnt added the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Mar 7, 2025
@iennae
Copy link
Contributor

iennae commented Mar 13, 2025

@gemini review

Copy link
Contributor

OK. I will review the code and provide feedback.

Copy link
Contributor

Warning

You have reached your daily quota limit. As a reminder, free tier users are limited to 5 requests per day. Please wait up to 24 hours and I will start processing your requests again!

1 similar comment
Copy link
Contributor

Warning

You have reached your daily quota limit. As a reminder, free tier users are limited to 5 requests per day. Please wait up to 24 hours and I will start processing your requests again!

@utsav1810 utsav1810 self-requested a review March 14, 2025 04:39
@harshnasitcrest
Copy link

Awaiting content review approval from Google team to merge this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
do not merge Indicates a pull request not ready for merge, due to either quality or timing. samples Issues that are directly related to samples.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants