GoogleCloudPlatform / python-docs-samples

Code samples used on cloud.google.com
Apache License 2.0
7.38k stars 6.4k forks source link

chore(generativai): Update create code samples to include `display_name` #12526

Closed msampathkumar closed 1 month ago

msampathkumar commented 1 month ago

Description

For context caching - create code samples, updating the sample arguments to use display_name. This is a newly added SDK feature.

Fixes: b/357634471, b/362459779

A few lint updates are added by Owlbot.

Note: Before submitting a pull request, please open an issue for discussion if you are not associated with Google.

Checklist

msampathkumar commented 1 month ago

SDK is updated! updating requirment.txt file

msampathkumar commented 1 month ago

Metrics are working with

from vertexai.preview.evaluation import EvalTask, MetricPromptTemplateExamples

metrics=[
    MetricPromptTemplateExamples.Pointwise.SUMMARIZATION_QUALITY,
    MetricPromptTemplateExamples.Pointwise.GROUNDEDNESS,
    MetricPromptTemplateExamples.Pointwise.VERBOSITY,
    ...
    ...
    ],

This looks more new SDK changes. To use MetricPromptTemplateExamples.Pairwise metrics, the reference model is required. To be sure I am checking with developer, who worked on this recently.