GoogleCloudPlatform / golang-samples

Sample apps and code written for Google Cloud in the Go programming language.
Apache License 2.0
4.29k stars 1.73k forks source link

feat(vertexai): Context caching #4267

Closed Deleplace closed 2 months ago

Deleplace commented 2 months ago

Adapted from the Python samples for Context caching

Region tags:

generativeaionvertexai_gemini_create_context_cache]
generativeaionvertexai_gemini_get_context_cache
generativeaionvertexai_gemini_use_context_cache
generativeaionvertexai_gemini_update_context_cache
generativeaionvertexai_gemini_delete_context_cache
snippet-bot[bot] commented 2 months ago

Here is the summary of changes.

You are about to add 5 region tags. - [vertexai/context-caching/contextcaching_create.go:18](https://github.com/Deleplace/fork-golang-samples/blob/144233d4dc81ab54d1bb8bda3813c020758e135b/vertexai/context-caching/contextcaching_create.go#L18), tag `generativeaionvertexai_gemini_create_context_cache` - [vertexai/context-caching/contextcaching_delete.go:18](https://github.com/Deleplace/fork-golang-samples/blob/144233d4dc81ab54d1bb8bda3813c020758e135b/vertexai/context-caching/contextcaching_delete.go#L18), tag `generativeaionvertexai_gemini_delete_context_cache` - [vertexai/context-caching/contextcaching_get.go:18](https://github.com/Deleplace/fork-golang-samples/blob/144233d4dc81ab54d1bb8bda3813c020758e135b/vertexai/context-caching/contextcaching_get.go#L18), tag `generativeaionvertexai_gemini_get_context_cache` - [vertexai/context-caching/contextcaching_update.go:18](https://github.com/Deleplace/fork-golang-samples/blob/144233d4dc81ab54d1bb8bda3813c020758e135b/vertexai/context-caching/contextcaching_update.go#L18), tag `generativeaionvertexai_gemini_update_context_cache` - [vertexai/context-caching/contextcaching_use.go:18](https://github.com/Deleplace/fork-golang-samples/blob/144233d4dc81ab54d1bb8bda3813c020758e135b/vertexai/context-caching/contextcaching_use.go#L18), tag `generativeaionvertexai_gemini_use_context_cache`

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:

Deleplace commented 2 months ago

Note that createContextCache returns a string. This is necessary for the test to refer to the cached content that it has just created.

ymotongpoo commented 2 months ago

@Deleplace do you mean this is port of these samples? (the link you mentioned is pointing at controlled generation) https://github.com/GoogleCloudPlatform/python-docs-samples/tree/621454ef68f7fbda02060d1a249acb83d5e490d6/generative_ai/context_caching

Deleplace commented 2 months ago

@Deleplace do you mean this is port of these samples? (the link you mentioned is pointing at controlled generation) https://github.com/GoogleCloudPlatform/python-docs-samples/tree/621454ef68f7fbda02060d1a249acb83d5e490d6/generative_ai/context_caching

Thanks! Indeed the link was wrong, I updated it at the top of the PR.