-
Notifications
You must be signed in to change notification settings - Fork 6.6k
feat(generative-ai): Add new sample for Context Cache's list feature #12596
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(generative-ai): Add new sample for Context Cache's list feature #12596
Conversation
Here is the summary of changes. You are about to add 1 region tag.
This comment is generated by snippet-bot.
|
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. |
539e963
to
026ee6c
Compare
# or convert the ContentCache object to a dictionary: | ||
for cc in cached_content_list: | ||
print(json.dumps(cc.to_dict(), indent=2)) |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
import json | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import json |
…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
Description
Adds a sample for the "Get a list of context caches" section of the
context-cache/context-cache-getinfo
Vertex AI page.Checklist
nox -s py-3.8
(see Test Environment Setup)nox -s lint
(see Test Environment Setup)