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: (Gen AI): Add sample for Gemini parallel function calling example #12637

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

Conversation

Valeriy-Burlaka
Copy link
Contributor

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

Description

Adds a new sample for the "Update the context cache using its expire_time parameter" section of the multimodal/function-calling Vertex AI page.

Checklist

  • I have followed Sample Guidelines from AUTHORING_GUIDE.MD
  • README is updated to include all relevant information
  • Tests pass: nox -s py-3.8 and nox -s py-3.11
  • Lint pass: nox -s lint
  • These samples need a new API enabled in testing projects to pass (let us know which ones)
  • These samples need a new/updated env vars in testing projects set to pass (let us know which ones)
  • This sample adds a new sample directory, and I updated the CODEOWNERS file with the codeowners for this sample
  • This sample adds a new Product API, and I updated the Blunderbuss issue/PR auto-assigner with the codeowners for this sample
  • Please merge this PR for me once it is approved

@Valeriy-Burlaka Valeriy-Burlaka self-assigned this Sep 26, 2024
@product-auto-label product-auto-label bot added the samples Issues that are directly related to samples. label Sep 26, 2024
@msampathkumar msampathkumar self-assigned this Sep 26, 2024

# Initialize Gemini model
model = GenerativeModel(
model_name="gemini-1.5-pro-001",
Copy link
Member

Choose a reason for hiding this comment

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

Can you try to use this model ?

Suggested change
model_name="gemini-1.5-pro-001",
model_name="gemini-1.5-pro-002",

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi @msampathkumar ! Thanks, updated.

# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import backoff
Copy link
Member

Choose a reason for hiding this comment

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

Can you update this filename to test_function_calling.py ? This follows a syntax of test_<parent_folder_name>.py. Going forward I wish to have only 1 test file for each folder.

Copy link
Contributor Author

@Valeriy-Burlaka Valeriy-Burlaka Sep 27, 2024

Choose a reason for hiding this comment

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

There are 2 other test files in this directory: chat_function_calling_test.py and examples_function_calling_test.py. Should I consolidate those tests inside the test_function_calling.py file as well?
Thanks!

Copy link

snippet-bot bot commented Sep 26, 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

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.

2 participants