Skip to content

Conversation

Valeriy-Burlaka
Copy link
Contributor

@Valeriy-Burlaka Valeriy-Burlaka commented Sep 16, 2024

Description

Adds a sample for the "Get a list of context caches" section of the context-cache/context-cache-getinfo Vertex AI page.

Checklist

@Valeriy-Burlaka Valeriy-Burlaka requested review from a team as code owners September 16, 2024 16:35
Copy link

snippet-bot bot commented Sep 16, 2024

Here is the summary of changes.

You are about to add 1 region tag.

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

Copy link

google-cla bot commented Sep 16, 2024

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@Valeriy-Burlaka Valeriy-Burlaka marked this pull request as draft September 16, 2024 16:35
@product-auto-label product-auto-label bot added the samples Issues that are directly related to samples. label Sep 16, 2024
@Valeriy-Burlaka Valeriy-Burlaka force-pushed the vburlaka-genai-samples-context-cache-list-all branch from 539e963 to 026ee6c Compare September 23, 2024 16:38
Comment on lines 47 to 49
# or convert the ContentCache object to a dictionary:
for cc in cached_content_list:
print(json.dumps(cc.to_dict(), indent=2))
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't know if there's a reason to change this to a dictionary. Devs can use the CachedContent class

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@holtskinner , no doubts they can! But I also wanted to show them an alternative, that the object also serializable as a dictionary. Paired with the example output comment below, it provides more context about what you can get from the object. I'm simply trying to look at the docs as a total Vertex newcomer (which I am!) and incorporate some bits of context that significantly overlap with the main focus of a sample. I'm happy to re-consider and remove this bit if it's not helpful.

Comment on lines 25 to 26
import json

Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
import json

@Valeriy-Burlaka Valeriy-Burlaka marked this pull request as ready for review September 23, 2024 16:50
@msampathkumar msampathkumar changed the title feat: (Gen AI) Create sample for #get-context-cache-list section feat(generative-ai): Add new sample for Context Cache's list feature Sep 24, 2024
@msampathkumar msampathkumar added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Sep 24, 2024
@kokoro-team kokoro-team removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Sep 24, 2024
@msampathkumar msampathkumar self-assigned this Sep 24, 2024
@Valeriy-Burlaka Valeriy-Burlaka requested a review from a team as a code owner September 24, 2024 11:05
@Valeriy-Burlaka Valeriy-Burlaka merged commit 8d9600e into GoogleCloudPlatform:main Sep 26, 2024
11 checks passed
riathakkar pushed a commit to riathakkar/python-docs-samples that referenced this pull request Oct 8, 2024
…oogleCloudPlatform#12596)

* Gen AI: Add sample for the 'get list of content caches' section

* review comments: make sample simpler

* review comments: rename the sample to follow standard naming practice

* lint failure: rollback import statements re-arrangement

* Update comments to follow the runnable-snippets-plan standard

* refresh CI builds
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

samples Issues that are directly related to samples.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants